Remove plugins

TempleTrek
Stronghold
SlayerMusiq
PlankMakeHelper
This commit is contained in:
zeruth
2019-04-21 17:55:47 -04:00
parent f6873a3bdf
commit cbb94b499b
14 changed files with 0 additions and 1425 deletions

View File

@@ -1,21 +0,0 @@
package net.runelite.client.plugins.kittennotifier;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
@ConfigGroup("kittennotifier")
public interface KittenNotifierConfig extends Config{
@ConfigItem(
keyName = "absolutelyNeeded",
name = "Notify only on Absolute Need",
description = "Only notify when kitten absolutely needs food or attention."
)
default boolean absolutelyNeeded() { return false; }
@ConfigItem(
keyName = "catOwned",
name = "",
description = "",
hidden = true
)
default boolean catOwned() { return false; }
}

View File

@@ -1,86 +0,0 @@
package net.runelite.client.plugins.kittennotifier;
import com.google.inject.Provides;
import net.runelite.api.ChatMessageType;
import net.runelite.api.events.ChatMessage;
import net.runelite.api.events.GameTick;
import net.runelite.api.events.NpcActionChanged;
import net.runelite.api.events.NpcSpawned;
import net.runelite.client.Notifier;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.api.NPC;
import net.runelite.api.Client;
import javax.inject.Inject;
@PluginDescriptor(
name = "Kitten Notifier",
description = "Sends a notification when your kitten needs food, attention, or is grown.",
tags = {"kitten, notifications"},
type = "utility"
)
public class KittenNotifierPlugin extends Plugin{
public boolean catOwned = false;
@Inject
private Notifier notifier;
@Inject
private KittenNotifierConfig config;
@Inject
private Client client;
@Provides
KittenNotifierConfig getConfig(ConfigManager configManager)
{
return configManager.getConfig(KittenNotifierConfig.class);
}
@Subscribe
public void onChatMessage(ChatMessage event) {
if (event.getType() == ChatMessageType.ENGINE && !config.catOwned()) {
if (!config.absolutelyNeeded()) {
if (event.getMessage().contentEquals("<col=ef1020>Your kitten is hungry.</col>")) {
notifier.notify("Your kitten is hungry.");
}
if (event.getMessage().contentEquals("<col=ef1020>Your kitten wants attention.</col>")) {
notifier.notify("Your kitten wants attention.");
}
}
if (event.getMessage().contentEquals("<col=ef1020>Your kitten is very hungry.</col>")) {
notifier.notify("Your kitten is very hungry.");
}
if (event.getMessage().contentEquals("<col=ef1020>Your kitten really wants attention.</col>")) {
notifier.notify("Your kitten really wants attention.");
}
}
}
@Subscribe
public void onGameTick(GameTick event) {
if (!config.catOwned()) {
for (NPC npc : client.getNpcs()) {
if (npc.getInteracting()!=null)
if (npc.getInteracting().getName().contentEquals(client.getLocalPlayer().getName())) {
if (npc.getName().equals("Cat") && !config.catOwned()) {
// If this if statement is included in previous it could null.
catOwned = true;
notifier.notify("Your kitten has grown into a cat.");
}
}
}
}
}
@Subscribe
public void onNpcSpawned(NpcSpawned event) {
NPC cat = event.getNpc();
if (cat.getInteracting()!=null)
if (cat.getInteracting().getName().equalsIgnoreCase(client.getLocalPlayer().getName())) {
if (cat.getName().contains("itten") && !config.catOwned()) {
catOwned = false;
}
}
else if (cat.getName().equals("Cat")) {
if (cat.getInteracting().getName().equalsIgnoreCase(client.getLocalPlayer().getName())) {
catOwned = true;
}
}
}
}

View File

@@ -1,88 +0,0 @@
package net.runelite.client.plugins.plankmakehelper;
import net.runelite.api.*;
import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetInfo;
import net.runelite.api.widgets.WidgetItem;
import net.runelite.client.ui.overlay.*;
import javax.inject.Inject;
import java.awt.*;
public class PlankMakeOverlay extends Overlay {
private final PlankMakePlugin plugin;
private final Client client;
@Inject
public PlankMakeOverlay(final PlankMakePlugin plugin, final Client client) {
super(plugin);
this.plugin = plugin;
this.client = client;
setPosition(OverlayPosition.DETACHED);
setLayer(OverlayLayer.ALWAYS_ON_TOP);
setPriority(OverlayPriority.MED);
}
@Override
public Dimension render(Graphics2D graphics) {
if (hasPlankableItems()) {
renderInventory(graphics);
renderPlankMakeSpell(graphics);
}
return null;
}
private void renderInventory(Graphics2D graphics) {
Widget inventory = client.getWidget(WidgetInfo.INVENTORY);
int firstItemSeenIndex = -1;
if (inventory != null) {
for (WidgetItem item : inventory.getWidgetItems()) {
if (PlankMakePlugin.isLogAndPlankable(item.getId())) {
if (firstItemSeenIndex == -1) {
firstItemSeenIndex = item.getIndex();
}
if (!inventory.isHidden()) {
if (item.getIndex() != firstItemSeenIndex) {
OverlayUtil.renderPolygon(graphics, RectangleToPolygon(item.getCanvasBounds()), Color.BLUE);
}
}
}
}
if (firstItemSeenIndex != -1) {
OverlayUtil.renderPolygon(graphics, RectangleToPolygon(inventory.getWidgetItem(firstItemSeenIndex).getCanvasBounds()), Color.CYAN);
}
}
}
private void renderPlankMakeSpell(Graphics2D graphics) {
Widget plankMakeSpell = client.getWidget(218,128);
if (plankMakeSpell != null && (plankMakeSpell.getCanvasLocation().getX() != 29 & plankMakeSpell.getCanvasLocation().getY() != 32)) {
OverlayUtil.renderPolygon(graphics, RectangleToPolygon(plankMakeSpell.getBounds()), Color.CYAN);
}
}
private boolean hasPlankableItems() {
ItemContainer invo = client.getItemContainer(InventoryID.INVENTORY);
if (invo != null) {
if (invo.getItems().length > 0) {
for (Item item : invo.getItems()) {
if (PlankMakePlugin.isLogAndPlankable(item.getId())) {
return true;
}
}
}
}
return false;
}
static Polygon RectangleToPolygon(Rectangle rect) {
int[] xpoints = {rect.x, rect.x + rect.width, rect.x + rect.width, rect.x};
int[] ypoints = {rect.y, rect.y, rect.y + rect.height, rect.y + rect.height};
return new Polygon(xpoints, ypoints, 4);
}
}

View File

@@ -1,50 +0,0 @@
package net.runelite.client.plugins.plankmakehelper;
import net.runelite.api.Client;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.ui.overlay.OverlayManager;
import javax.inject.Inject;
@PluginDescriptor(
name = "Plank Make Helper",
description = "Highlights planks and plank make spell",
tags = {"overlay", "plankmaking", "lunar", "money", "moneymaking", "gp"},
type = "utility"
)
public class PlankMakePlugin extends Plugin {
@Inject
private OverlayManager overlayManager;
@Inject
private Client client;
@Inject
private PlankMakeOverlay overlay;
@Override
protected void startUp() {
overlayManager.add(overlay);
}
@Override
protected void shutDown() {
overlayManager.remove(overlay);
}
static boolean isLogAndPlankable(int itemID) {
switch (itemID) {
case 6332: //mahogany
case 1521: //oak
case 6333: //teak
case 1511: //plain
return true;
default:
return false;
}
}
}

View File

@@ -1,207 +0,0 @@
package net.runelite.client.plugins.slayermusiq;
import net.runelite.client.util.LinkBrowser;
import net.runelite.api.ChatMessageType;
import net.runelite.api.events.ChatMessage;
import net.runelite.client.chat.ChatColorType;
import net.runelite.client.chat.ChatMessageBuilder;
import net.runelite.client.chat.ChatMessageManager;
import net.runelite.client.chat.QueuedMessage;
public class QuestGuideLinks {
private static final Link[] QUEST_GUIDE_LINKS = {
// Free Quests
new Link("Cook's Assistant", "https://www.youtube.com/watch?v=ehmtDRelj3c"),
new Link("Romeo & Juliet", "https://www.youtube.com/watch?v=rH_biWSNWVY"),
new Link("Demon Slayer", "https://www.youtube.com/watch?v=hgACrzJSiQk"),
new Link("Shield of Arrav", "https://www.youtube.com/watch?v=a_imLDKUdzg"),
new Link("Sheep Shearer", "https://www.youtube.com/watch?v=XFG3aNwK68s"),
new Link("The Restless Ghost", "https://www.youtube.com/watch?v=UkWNcsG_pXM"),
new Link("Ernest the Chicken", "https://www.youtube.com/watch?v=cq8NIVhSqh4"),
new Link("Vampire Slayer", "https://www.youtube.com/watch?v=FcEuxsDJWCU"),
new Link("Imp Catcher", "https://www.youtube.com/watch?v=LHgnl0FbOzk"),
new Link("Prince Ali Rescue", "https://www.youtube.com/watch?v=hrSPl1GfFaw"),
new Link("Doric's Quest", "https://www.youtube.com/watch?v=5TYyxHU27a4"),
new Link("Black Knights' Fortress", "https://www.youtube.com/watch?v=aekoZi3f9cU"),
new Link("Witch's Potion", "https://www.youtube.com/watch?v=XV4i5sPUvXo"),
new Link("The Knight's Sword", "https://www.youtube.com/watch?v=UkBWaI0rOqE"),
new Link("Goblin Diplomacy", "https://www.youtube.com/watch?v=P9BKOb_dLoY"),
new Link("Pirate's Treasure", "https://www.youtube.com/watch?v=zcD87PQW8Qk"),
new Link("Dragon Slayer", "https://www.youtube.com/watch?v=bMtCjlFOaBI"),
new Link("Rune Mysteries", "https://www.youtube.com/watch?v=l8ZhaN8uoS0"),
new Link("Misthalin Mystery", "https://www.youtube.com/watch?v=QlFqVAobAlQ"),
new Link("The Corsair Curse", "https://www.youtube.com/watch?v=wi7mUAHExz4"),
new Link("X Marks the Spot", "https://www.youtube.com/watch?v=GhRgvEG5jxQ"),
// Members Quests
new Link("Druidic Ritual", "https://www.youtube.com/watch?v=QIfU6HSmH4w"),
new Link("Lost City", "https://www.youtube.com/watch?v=T-kQNUSjFZI"),
new Link("Witch's House", "https://www.youtube.com/watch?v=TLsg7Wa-LUA"),
new Link("Merlin's Crystal", "https://www.youtube.com/watch?v=ESX-qriNtCE"),
new Link("Heroes' Quest", "https://www.youtube.com/watch?v=hK2N0WLKviE"),
new Link("Scorpion Catcher", "https://www.youtube.com/watch?v=xpqdec7_ZWg"),
new Link("Family Crest", "https://www.youtube.com/watch?v=0mk_Cgjr738"),
new Link("Monk's Friend", "https://www.youtube.com/watch?v=avi4y4G3Hcw"),
new Link("Temple of Ikov", "https://www.youtube.com/watch?v=5K7jDgr_4Z4"),
new Link("Clock Tower", "https://www.youtube.com/watch?v=GUCkkQFzyDw"),
new Link("Holy Grail", "https://www.youtube.com/watch?v=cgXoV1QlYco"),
new Link("Tree Gnome Village", "https://www.youtube.com/watch?v=T6Su__yuyRI"),
new Link("Fight Arena", "https://www.youtube.com/watch?v=4Nqjep2E5pw"),
new Link("Hazeel Cult", "https://www.youtube.com/watch?v=2_fhFJW6cNY"),
new Link("Sheep Herder", "https://www.youtube.com/watch?v=akC9FeYCG1Q"),
new Link("Plague City", "https://www.youtube.com/watch?v=Hf2wQQZL5CU"),
new Link("Waterfall Quest", "https://www.youtube.com/watch?v=xWBSnGkQTi4"),
new Link("Jungle Potion", "https://www.youtube.com/watch?v=xqLKsFz08As"),
new Link("The Grand Tree", "https://www.youtube.com/watch?v=N5e_Jus_E-Y"),
new Link("Underground Pass", "https://www.youtube.com/watch?v=5klGJg1wY8k"),
new Link("Observatory Quest", "https://www.youtube.com/watch?v=yxa9B6svv44"),
new Link("Watchtower", "https://www.youtube.com/watch?v=Vb10GoYP7FE"),
new Link("Dwarf Cannon", "https://www.youtube.com/watch?v=pROFg5jcCR0"),
new Link("Murder Mystery", "https://www.youtube.com/watch?v=P1IDGCA2f9o"),
new Link("The Dig Site", "https://www.youtube.com/watch?v=TOdcWV4MzuU"),
new Link("Gertrude's Cat", "https://www.youtube.com/watch?v=g7S09wA8EAY"),
new Link("Legends' Quest", "https://www.youtube.com/watch?v=Lid8enDEF_U"),
new Link("Death Plateau", "https://www.youtube.com/watch?v=SIQFmTvnb6w"),
new Link("Big Chompy Bird Hunting", "https://www.youtube.com/watch?v=s2fytMOHJXI"),
new Link("Elemental Workshop I", "https://www.youtube.com/watch?v=tbZD2RDqvfQ"),
new Link("Nature Spirit", "https://www.youtube.com/watch?v=Enf8vUWb5o0"),
new Link("Priest in Peril", "https://www.youtube.com/watch?v=fyYri6wUQIU"),
new Link("Regicide", "https://www.youtube.com/watch?v=KkWM-ok3C4Y"),
new Link("Tai Bwo Wannai Trio", "https://www.youtube.com/watch?v=Mdair5mvZL0"),
new Link("Troll Stronghold", "https://www.youtube.com/watch?v=zqmUs-f3AKA"),
new Link("Horror from the Deep", "https://www.youtube.com/watch?v=9htK8kb6DR8"),
new Link("Throne of Miscellania", "https://www.youtube.com/watch?v=fzGMnv2skBE"),
new Link("Monkey Madness I", "https://www.youtube.com/watch?v=VnoRfeBnPFA"),
new Link("Haunted Mine", "https://www.youtube.com/watch?v=cIc6loJHm9Q"),
new Link("Troll Romance", "https://www.youtube.com/watch?v=j2zifZVu7Gc"),
new Link("In Search of the Myreque", "https://www.youtube.com/watch?v=5nmYFHdAXAQ"),
new Link("Creature of Fenkenstrain", "https://www.youtube.com/watch?v=swqUVIs7B7M"),
new Link("Roving Elves", "https://www.youtube.com/watch?v=J3qf9DnT9cA"),
new Link("One Small Favour", "https://www.youtube.com/watch?v=ix_0-W3e9ps"),
new Link("Mountain Daughter", "https://www.youtube.com/watch?v=HETx_LX7aiY"),
new Link("Between a Rock...", "https://www.youtube.com/watch?v=cB11I45EGgA"),
new Link("The Golem", "https://www.youtube.com/watch?v=qpEHpiO6lLw"),
new Link("Desert Treasure", "https://www.youtube.com/watch?v=BuIqulIsICo"),
new Link("Icthlarin's Little Helper", "https://www.youtube.com/watch?v=wpNKm8_vUOM"),
new Link("Tears of Guthix", "https://www.youtube.com/watch?v=EMonDNI0uPk"),
new Link("The Lost Tribe", "https://www.youtube.com/watch?v=spZErjRnCdc"),
new Link("The Giant Dwarf", "https://www.youtube.com/watch?v=Z7PsGpOYgxY"),
new Link("Recruitment Drive", "https://www.youtube.com/watch?v=sOuzMpA_xtw"),
new Link("Mourning's Ends Part I", "https://www.youtube.com/watch?v=vuzAdk-h3c0"),
new Link("Garden of Tranquillity", "https://www.youtube.com/watch?v=7hbCzYnLCsQ"),
new Link("A Tail of Two Cats", "https://www.youtube.com/watch?v=SgN9Yw_YqHk"),
new Link("Wanted!", "https://www.youtube.com/watch?v=ZHZAKDCfXGs"),
new Link("Mourning's Ends Part II", "https://www.youtube.com/watch?v=FK5sLogGbU8"),
new Link("Rum Deal", "https://www.youtube.com/watch?v=I14CIu5x2S8"),
new Link("Shadow of the Storm", "https://www.youtube.com/watch?v=5ZvWd3XCQjI"),
new Link("Ratcatchers", "https://www.youtube.com/watch?v=s7G22fEuhTc"),
new Link("Spirits of the Elid", "https://www.youtube.com/watch?v=A1zAX55hZC0"),
new Link("Devious Minds", "https://www.youtube.com/watch?v=_UtlFmrWt1w"),
new Link("Enakhra's Lament", "https://www.youtube.com/watch?v=Y3kEIPYVaVE"),
new Link("Cabin Fever", "https://www.youtube.com/watch?v=k5DtxNXhOaw"),
new Link("Fairytale I - Growing Pains", "https://www.youtube.com/watch?v=cfGI9qFOmsg"),
new Link("Recipe for Disaster", "https://www.youtube.com/watch?v=hrAyyInJaTA"),
new Link("In Aid of the Myreque", "https://www.youtube.com/watch?v=O2Ru2NmuTaA"),
new Link("A Soul's Bane", "https://www.youtube.com/watch?v=dp8dp79qp6I"),
new Link("Rag and Bone Man", "https://www.youtube.com/watch?v=3owXSeN56W8"),
new Link("Swan Song", "https://www.youtube.com/watch?v=IpmERThXv2g"),
new Link("Royal Trouble", "https://www.youtube.com/watch?v=bVWUlKzNXEg"),
new Link("Death to the Dorgeshuun", "https://www.youtube.com/watch?v=2XJHuLhig98"),
new Link("Fairytale II - Cure a Queen", "https://www.youtube.com/watch?v=P6KkRk4_e3U"),
new Link("Lunar Diplomacy", "https://www.youtube.com/watch?v=vmeSKb7IBgQ"),
new Link("The Eyes of Glouphrie", "https://www.youtube.com/watch?v=0YCPwmZcxKA"),
new Link("Darkness of Hallowvale", "https://www.youtube.com/watch?v=QziKl99qdtU"),
new Link("Elemental Workshop II", "https://www.youtube.com/watch?v=Bb4E7ecIgv0"),
new Link("My Arm's Big Adventure", "https://www.youtube.com/watch?v=xa1KWOewgYA"),
new Link("Enlightened Journey", "https://www.youtube.com/watch?v=XAPthC8d7k0"),
new Link("Eagles' Peak", "https://www.youtube.com/watch?v=KDxIrrwXp7U"),
new Link("Animal Magnetism", "https://www.youtube.com/watch?v=kUyjXA7TaFU"),
new Link("Contact!", "https://www.youtube.com/watch?v=czn-yWABBWs"),
new Link("Cold War", "https://www.youtube.com/watch?v=0m1KpP-qKWI"),
new Link("The Fremennik Isles", "https://www.youtube.com/watch?v=EvxhiOWmraY"),
new Link("The Great Brain Robbery", "https://www.youtube.com/watch?v=ImHFASuNUN8"),
new Link("What Lies Below", "https://www.youtube.com/watch?v=f_9nVMGTtuo"),
new Link("Olaf's Quest", "https://www.youtube.com/watch?v=mXV5bM1NFMM"),
new Link("Dream Mentor", "https://www.youtube.com/watch?v=XDLUu0Kf0sE"),
new Link("Grim Tales", "https://www.youtube.com/watch?v=dFB0Q6v8Apw"),
new Link("King's Ransom", "https://www.youtube.com/watch?v=UJz9ZfF3uCY"),
new Link("Shilo Village", "https://www.youtube.com/watch?v=bDvBi8FT-QI"),
new Link("Biohazard", "https://www.youtube.com/watch?v=n9k87LwOGMk"),
new Link("Tower of Life", "https://www.youtube.com/watch?v=KReMcWpeY3k"),
new Link("Rag and Bone Man II", "https://www.youtube.com/watch?v=KGdHiDDUX_U"),
new Link("Zogre Flesh Eaters", "https://www.youtube.com/watch?v=vzm4949kXP4"),
new Link("Monkey Madness II", "https://www.youtube.com/watch?v=ykE5LbjABaI"),
new Link("Client of Kourend", "https://www.youtube.com/watch?v=Y-KIHF-cL9w"),
new Link("The Queen of Thieves", "https://www.youtube.com/watch?v=W94zFZVrHkQ"),
new Link("Bone Voyage", "https://www.youtube.com/watch?v=-VTR4p8kPmI"),
new Link("Dragon Slayer II", "https://www.youtube.com/watch?v=4BMb3Zwzk_U"),
new Link("The Depths of Despair", "https://www.youtube.com/watch?v=CaVUk2eAsKs"),
new Link("A Taste of Hope", "https://www.youtube.com/watch?v=VjdgEIizdSc"),
new Link("Tale of the Righteous", "https://www.youtube.com/watch?v=99yiv0tPl58"),
new Link("Making Friends with My Arm", "https://www.youtube.com/watch?v=DltzzhIsM_Q"),
new Link("The Ascent of Arceuus", "https://www.youtube.com/watch?v=4VQnfrv6S18"),
new Link("The Forsaken Tower", "https://www.youtube.com/watch?v=con0sXl5NBY"),
new Link("Fishing Contest", "https://www.youtube.com/watch?v=XYSv37A_l5w"),
new Link("Tribal Totem", "https://www.youtube.com/watch?v=XkUEIjr886M"),
new Link("Sea Slug", "https://www.youtube.com/watch?v=oOZVfa5SkVQ"),
new Link("The Tourist Trap", "https://www.youtube.com/watch?v=0bmSCCepMvo"),
new Link("Eadgar's Ruse", "https://www.youtube.com/watch?v=aVQ3DjTElXg"),
new Link("Shades of Mort'ton", "https://www.youtube.com/watch?v=eF05R8OMxgg"),
new Link("The Fremennik Trials", "https://www.youtube.com/watch?v=YUIvEgcvl5c"),
new Link("Ghosts Ahoy", "https://www.youtube.com/watch?v=aNBkLOywDfM"),
new Link("The Feud", "https://www.youtube.com/watch?v=nlBSc9IUklA"),
new Link("Forgettable Tale...", "https://www.youtube.com/watch?v=3HvFd6AxNU0"),
new Link("Making History", "https://www.youtube.com/watch?v=bOTGi2zAuhs"),
new Link("The Hand in the Sand", "https://www.youtube.com/watch?v=gdNLcZ-l1Lw"),
new Link("The Slug Menace", "https://www.youtube.com/watch?v=BRQbdr3JEZ8"),
new Link("Another Slice of H.A.M.", "https://www.youtube.com/watch?v=Yq3db7827Lk")
};
private static class Link {
private String questName;
private String url;
public Link(String questName, String url) {
this.questName = questName;
this.url = url;
}
public String getQuestName() {
return questName;
}
public void openURL() {
LinkBrowser.browse(this.url);
}
}
private static boolean openGuide(String questName) {
for (Link link : QUEST_GUIDE_LINKS) {
if (link.getQuestName().equals(questName)) {
link.openURL();
return true;
}
}
return false;
}
private static void logQuestNotFoundError(String questName, ChatMessageManager chatMessageManager) {
String chatMessage = new ChatMessageBuilder()
.append(ChatColorType.HIGHLIGHT)
.append("Could not find Slayermusiq1 guide for " + questName)
.build();
chatMessageManager.queue(QueuedMessage.builder()
.type(ChatMessageType.CONSOLE)
.runeLiteFormattedMessage(chatMessage)
.build());
}
public static void tryOpenGuide(String questName, ChatMessageManager chatMessageManager) {
boolean success = openGuide(questName);
if (!success) {
logQuestNotFoundError(questName, chatMessageManager);
}
}
}

View File

@@ -1,153 +0,0 @@
/*
* Copyright (c) 2018, Jeremy Berchtold <https://github.com/i-yam-jeremy>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// Based off RuneLite's Wiki Plugin
/*
* Copyright (c) 2018 Abex
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.slayermusiq;
import com.google.inject.Provides;
import com.google.common.primitives.Ints;
import java.awt.Dimension;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.inject.Inject;
import javax.swing.SwingUtilities;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.Client;
import net.runelite.api.MenuAction;
import net.runelite.api.MenuEntry;
import net.runelite.api.widgets.WidgetInfo;
import net.runelite.api.events.MenuEntryAdded;
import net.runelite.api.events.MenuOptionClicked;
import net.runelite.client.util.Text;
import net.runelite.client.chat.ChatMessageManager;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
@PluginDescriptor(
name = "Slayermusiq1 Guides",
description = "Adds a right-click option to go to Slayermusiq1's guides from the quest tab",
tags = {"quest", "guide", "slayermusiq"},
type = "utility"
)
@Slf4j
public class SlayermusiqPlugin extends Plugin
{
private static final int[] QUESTLIST_WIDGET_IDS = new int[]
{
WidgetInfo.QUESTLIST_FREE_CONTAINER.getId(),
WidgetInfo.QUESTLIST_MEMBERS_CONTAINER.getId(),
WidgetInfo.QUESTLIST_MINIQUEST_CONTAINER.getId(),
};
private static final String MENUOP_SLAYERMUSIQ = "Slayermusiq";
@Inject
private Client client;
@Inject
private ChatMessageManager chatMessageManager;
@Override
protected void startUp() throws Exception
{
//
}
@Override
protected void shutDown() throws Exception
{
//
}
@Subscribe
public void onMenuEntryAdded(MenuEntryAdded event)
{
int widgetID = event.getActionParam1();
if (Ints.contains(QUESTLIST_WIDGET_IDS, widgetID) && "Read Journal:".equals(event.getOption())) {
MenuEntry[] menuEntries = client.getMenuEntries();
MenuEntry newMenuEntry = createSlayermusiqOptionMenuEntry(event);
menuEntries = Arrays.copyOf(menuEntries, menuEntries.length + 1);
menuEntries[menuEntries.length - 1] = newMenuEntry;
client.setMenuEntries(menuEntries);
}
}
@Subscribe
private void onMenuOptionClicked(MenuOptionClicked ev) {
if (ev.getMenuAction() == MenuAction.RUNELITE && ev.getMenuOption().equals(MENUOP_SLAYERMUSIQ)) {
ev.consume();
String quest = Text.removeTags(ev.getMenuTarget());
QuestGuideLinks.tryOpenGuide(quest, chatMessageManager);
}
}
private MenuEntry createSlayermusiqOptionMenuEntry(MenuEntryAdded event) {
int widgetIndex = event.getActionParam0();
int widgetID = event.getActionParam1();
MenuEntry menuEntry = new MenuEntry();
menuEntry.setTarget(event.getTarget());
menuEntry.setOption(MENUOP_SLAYERMUSIQ);
menuEntry.setParam0(widgetIndex);
menuEntry.setParam1(widgetID);
menuEntry.setType(MenuAction.RUNELITE.getId());
return menuEntry;
}
}

View File

@@ -1,110 +0,0 @@
package net.runelite.client.plugins.spellbookfixer;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
@ConfigGroup("spellbookfixer")
public interface SpellbookFixerConfig extends Config
{
@ConfigItem(position = 0, keyName = "shouldHideOthers", name = "Hide Others", description = "Toggle on to hide spells not useful for pking that cannot be filtered otherwise.")
default boolean shouldHideOthers()
{
return false;
}
//ice blitz
@ConfigItem(position = 1, keyName = "shouldModifyIceBlitz", name = "Ice Blitz", description = "Toggle on to enable Ice Blitz modifications.")
default boolean shouldModifyIceBlitz() { return false; }
@ConfigItem(position = 2, keyName = "getBlitzPositionX", name = "Ice Blitz Pos X", description = "Modifies the X-axis position of Ice Blitz.")
default int getBlitzPositionX()
{
return 0;
}
@ConfigItem(position = 3, keyName = "getBlitzPositionY", name = "Ice Blitz Pos Y", description = "Modifies the Y-axis position of Ice Blitz.")
default int getBlitzPositionY()
{
return 118;
}
@ConfigItem(position = 4, keyName = "getBlitzSize", name = "Ice Blitz Size", description = "Modifies the width of Ice Blitz.")
default int getBlitzSize()
{
return 80;
}
//ice barrage
@ConfigItem(position = 5, keyName = "shouldModifyIceBarrage", name = "Ice Barrage", description = "Toggle on to enable Ice Barrage modifications.")
default boolean shouldModifyIceBarrage() { return false; }
@ConfigItem(position = 6, keyName = "getBarragePositionX", name = "Ice Barrage Pos X", description = "Modifies the X-axis position of Ice Barrage.")
default int getBarragePositionX()
{
return 0;
}
@ConfigItem(position = 7, keyName = "getBarragePositionY", name = "Ice Barrage Pos X", description = "Modifies the X-axis position of Ice Barrage.")
default int getBarragePositionY()
{
return 0;
}
@ConfigItem(position = 8, keyName = "getBarrageSize", name = "Ice Barrage Size", description = "Modifies the width position of Ice Barrage.")
default int getBarrageSize()
{
return 80;
}
//vengeance
@ConfigItem(position = 9, keyName = "shouldModifyVengeance", name = "Vengeance", description = "Toggle on to enable Vengeance modifications.")
default boolean shouldModifyVengeance() { return false; }
@ConfigItem(position = 10, keyName = "getVengeancePositionX", name = "Vengeance Pos X", description = "Modifies the X-axis position of Vengeance.")
default int getVengeancePositionX()
{
return 0;
}
@ConfigItem(position = 11, keyName = "getVengeancePositionY", name = "Vengeance Pos X", description = "Modifies the X-axis position of Vengeance.")
default int getVengeancePositionY()
{
return 0;
}
@ConfigItem(position = 12, keyName = "getVengeanceSize", name = "Vengeance Size", description = "Modifies the width position of Vengeance.")
default int getVengeanceSize()
{
return 80;
}
//teleblock
@ConfigItem(position = 13, keyName = "shouldModifyTeleBlock", name = "TeleBlock", description = "Toggle on to enable TeleBlock modifications.")
default boolean shouldModifyTeleBlock() { return false; }
@ConfigItem(position = 14, keyName = "getTeleBlockPositionX", name = "TeleBlock Pos X", description = "Modifies the X-axis position of TeleBlock.")
default int getTeleBlockPositionX()
{
return 0;
}
@ConfigItem(position = 15, keyName = "getTeleBlockPositionY", name = "TeleBlock Pos X", description = "Modifies the X-axis position of TeleBlock.")
default int getTeleBlockPositionY()
{
return 0;
}
@ConfigItem(position = 16, keyName = "getTeleBlockSize", name = "TeleBlock Size", description = "Modifies the width position of TeleBlock.")
default int getTeleBlockSize()
{
return 80;
}
//entangle
@ConfigItem(position = 17, keyName = "shouldModifyEntangle", name = "Entangle", description = "Toggle on to enable Entangle modifications.")
default boolean shouldModifyEntangle() { return false; }
@ConfigItem(position = 18, keyName = "getEntanglePositionX", name = "Entangle Pos X", description = "Modifies the X-axis position of Entangle.")
default int getEntanglePositionX()
{
return 0;
}
@ConfigItem(position = 19, keyName = "getEntanglePositionY", name = "Entangle Pos X", description = "Modifies the X-axis position of Entangle.")
default int getEntanglePositionY()
{
return 118;
}
@ConfigItem(position = 20, keyName = "getEntangleSize", name = "Entangle Size", description = "Modifies the width position of Entangle.")
default int getEntangleSize()
{
return 80;
}
}

View File

@@ -1,171 +0,0 @@
package net.runelite.client.plugins.spellbookfixer;
import com.google.inject.Provides;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.Client;
import net.runelite.api.GameState;
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.events.GameTick;
import net.runelite.api.events.WidgetLoaded;
import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetID;
import net.runelite.api.widgets.WidgetInfo;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import javax.inject.Inject;
@PluginDescriptor(
name = "Spellbook Fixer",
description = "Resize and filter spellbook for PKing",
tags = {"resize", "spellbook", "magic", "spell", "pk", "book", "filter", "bogla"},
type = "PVP"
)
@Slf4j
public class SpellbookFixerPlugin extends Plugin
{
@Inject
private Client client;
@Inject
SpellbookFixerConfig config;
@Provides
SpellbookFixerConfig provideConfig(ConfigManager configManager) { return configManager.getConfig(SpellbookFixerConfig.class); }
@Override
protected void startUp() throws Exception
{
adjustSpellbook();
}
@Override
protected void shutDown() throws Exception
{
resetSpellbook();
}
@Subscribe
public void onGameStateChanged(GameStateChanged event)
{
if (event.getGameState() == GameState.LOGGED_IN)
adjustSpellbook();
}
@Subscribe
public void onWidgetLoaded(WidgetLoaded event)
{
if (event.getGroupId() == WidgetID.SPELLBOOK_GROUP_ID)
adjustSpellbook();
}
@Subscribe
public void onGameTick(GameTick event)
{
adjustSpellbook();
}
private void adjustSpellbook()
{
if (client.getGameState() != GameState.LOGGED_IN)
return;
try
{
if (config.shouldModifyIceBarrage())
modifySpell(WidgetInfo.SPELL_ICE_BARRAGE, config.getBarragePositionX(), config.getBarragePositionY(), config.getBarrageSize());
if (config.shouldModifyIceBlitz())
modifySpell(WidgetInfo.SPELL_ICE_BLITZ, config.getBlitzPositionX(), config.getBlitzPositionY(), config.getBlitzSize());
if (config.shouldModifyVengeance())
modifySpell(WidgetInfo.SPELL_VENGEANCE, config.getVengeancePositionX(), config.getVengeancePositionY(), config.getVengeanceSize());
if (config.shouldModifyTeleBlock())
modifySpell(WidgetInfo.SPELL_TELE_BLOCK, config.getTeleBlockPositionX(), config.getTeleBlockPositionY(), config.getTeleBlockSize());
if (config.shouldModifyEntangle())
modifySpell(WidgetInfo.SPELL_ENTANGLE, config.getEntanglePositionX(), config.getEntanglePositionY(), config.getEntangleSize());
setSpellHidden(WidgetInfo.SPELL_BLOOD_BLITZ, config.shouldHideOthers());
setSpellHidden(WidgetInfo.SPELL_VENGEANCE_OTHER, config.shouldHideOthers());
setSpellHidden(WidgetInfo.SPELL_BIND, config.shouldHideOthers());
setSpellHidden(WidgetInfo.SPELL_SNARE, config.shouldHideOthers());
}
catch (Exception e)
{
//swallow
}
}
private void resetSpellbook()
{
if (client.getGameState() != GameState.LOGGED_IN)
return;
try
{
if (config.shouldModifyIceBarrage())
modifySpell(WidgetInfo.SPELL_ICE_BARRAGE, config.getBarragePositionX(), config.getBarragePositionY(), 24);
if (config.shouldModifyIceBlitz())
modifySpell(WidgetInfo.SPELL_ICE_BLITZ, config.getBlitzPositionX(), config.getBlitzPositionY(), 24);
if (config.shouldModifyVengeance())
modifySpell(WidgetInfo.SPELL_VENGEANCE, config.getVengeancePositionX(), config.getVengeancePositionY(), 24);
if (config.shouldModifyTeleBlock())
modifySpell(WidgetInfo.SPELL_TELE_BLOCK, config.getTeleBlockPositionX(), config.getTeleBlockPositionY(), 24);
if (config.shouldModifyEntangle())
modifySpell(WidgetInfo.SPELL_ENTANGLE, config.getEntanglePositionX(), config.getEntanglePositionY(), 24);
setSpellHidden(WidgetInfo.SPELL_BLOOD_BLITZ, false);
setSpellHidden(WidgetInfo.SPELL_VENGEANCE_OTHER, false);
setSpellHidden(WidgetInfo.SPELL_BIND, false);
setSpellHidden(WidgetInfo.SPELL_SNARE, false);
}
catch (Exception e)
{
//swallow
}
}
private void modifySpell(WidgetInfo widgetInfo, int posX, int posY, int size)
{
Widget widget = client.getWidget(widgetInfo);
if (widget == null)
return;
try
{
widget.setOriginalX(posX);
widget.setOriginalY(posY);
widget.setOriginalWidth(size);
widget.setOriginalHeight(size);
widget.revalidate();
}
catch (Exception e)
{
//swallow
}
}
private void setSpellHidden(WidgetInfo widgetInfo, boolean hidden)
{
Widget widget = client.getWidget(widgetInfo);
if (widget == null)
return;
widget.setHidden(hidden);
}
}

View File

@@ -1,93 +0,0 @@
/*
* Copyright (c) 2019, FlaxOnEm <flax.on.em@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.stronghold;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import net.runelite.api.widgets.Widget;
import java.util.HashMap;
import java.util.Map;
@Getter
@RequiredArgsConstructor
enum StrongholdAnswer {
PAIR_0("To pass you must answer me this: Hey adventurer!<br>You've been randomly selected for a prize of 1 year of<br>free membership! I'm just going to need some of your<br>account details so I can put it on your account!", "No way! I'm reporting you to Jagex!"),
PAIR_1("To pass you must answer me this: Can I leave my<br>account logged in while I'm out of the room?", "No."),
PAIR_2("To pass you must answer me this: How do I remove a<br>hijacker from my account?", "Use the Account Recovery System."),
PAIR_3("To pass you must answer me this: What do you do if<br>someone asks you for your password or bank PIN to<br>make you a player moderator?", "Don't give them the information and send an 'Abuse report'."),
PAIR_4("To pass you must answer me this: You're watching a<br>stream by someone claiming to be Jagex offering double<br>xp. What do you do?", "Report the stream as a scam. Real Jagex streams have a 'verified' mark."),
PAIR_5("To pass you must answer me this: My friend asks me<br>for my password so that he can do a difficult quest for<br>me. Do I give it to them?", "Don't give them my password."),
PAIR_6("To pass you must answer me this: Who can I give my<br>password to?", "Nobody."),
PAIR_7("To pass you must answer me this: How do I set up<br>two-factor authentication for my Old School RuneScape<br>account?", "Through account settings on oldschool.runescape.com."),
PAIR_8("To pass you must answer me this: What is an example<br>of a good bank PIN?", "The birthday of a famous person or event."),
PAIR_9("To pass you must answer me this: What should you do<br>if your real-life friend asks for your password so he<br>can check your stats?", "Don't give out your password to anyone. Not even close friends."),
PAIR_A("To pass you must answer me this: A player tells you to<br>search for a video online, click the link in the description<br>and comment on the forum post to win a cash prize.<br>What do you do?", "Report the player for phishing."),
PAIR_B("To pass you must answer me this: You have been<br>offered an opportunity to check out a free giveaway or<br>double XP signup via email or in game chat. What<br>should I do?", "Report the incident and do not click any links."),
PAIR_C("To pass you must answer me this: How do I set a<br>bank PIN?", "Talk to any banker."),
PAIR_D("To pass you must answer me this: What do I do if a<br>moderator asks me for my account details?", "Politely tell them no and then use the 'Report Abuse' button."),
PAIR_E("To pass you must answer me this: You are part way<br>through the Stronghold of Security when you have to<br>answer another question. After you answer the question,<br>you should...", "Read the text and follow the advice given."),
PAIR_F("To pass you must answer me this: Will Jagex prevent<br>me from saying my PIN in game?", "No."),
PAIR_G("that sound?", "No way! You'll just take my gold for your own! Reported!"),
PAIR_H("To pass you must answer me this: What should I do if<br>I receive an email asking me to verify my identity or<br>Account details due to suspicious activity?", "Don't click any links, forward the email to reportphishing@jagex.com."),
PAIR_I("To pass you must answer me this: A website claims that<br>they can make me a player moderator. What should I<br>do?", "Inform Jagex by emailing reportphishing@jagex.com."),
PAIR_J("react?", "Don't share your information and report the player."),
PAIR_K("To pass you must answer me this: What do you do if<br>someone asks you for your password or bank PIN to<br>make you a member for free?", "Don't tell them anything and click the 'Report Abuse' button."),
PAIR_L("To pass you must answer me this: Is it OK to buy an<br>Old School RuneScape account?", "No, you should never buy an account."),
PAIR_M("To pass you must answer me this: You have been<br>offered an opportunity to check out a free giveaway or<br>double XP signup via social media or stream. What<br>should I do?", "Report the incident and do not click any links."),
PAIR_N("To pass you must answer me this: Where is it safe to<br>use my Old School RuneScape password?", "Only on the Old School RuneScape website."),
PAIR_O("To pass you must answer me this: What is the best<br>way to secure your account?", "Authenticator and two-step login on my registered email."),
PAIR_P("To pass you must answer me this: Who is it ok to<br>share my account with?", "Nobody."),
PAIR_Q("To pass you must answer me this: What should you do<br>if another player messages you recommending a website<br>to purchase items and/or gold?", "Do not visit the website and report the player who messaged you."),
PAIR_R("To pass you must answer me this: Whose responsibility<br>is it to keep your account secure?", "Me."),
PAIR_S("To pass you must answer me this: Is it safe to pay<br>someone to level your account?", "No, you should never allow anyone to level your account."),
PAIR_T("To pass you must answer me this: What do I do if my<br>account is compromised?", "Secure my device and reset my password."),
PAIR_U("respond?", "Decline the offer and report that player."),
PAIR_V("To pass you must answer me this: A player says that<br>Jagex prevents you from saying your password<br>backwards in game. What do you do?", "Don't type in my password backwards and report the player."),
PAIR_W("To pass you must answer me this: What do I do if I<br>think I have a keylogger or virus?", "Virus scan my device then change my password."),
PAIR_X("To pass you must answer me this: What is the best<br>security step you can take to keep your registered<br>email secure?", "Set up 2 step authentication with my email provider.");
static final Map<String, String> MATCHES = new HashMap<>();
static {
for (StrongholdAnswer strongholdAnswer : StrongholdAnswer.values()) {
MATCHES.put(strongholdAnswer.question, strongholdAnswer.answer);
}
}
private final String question;
private final String answer;
static Widget findCorrect(final String question, final Widget[] widgets) {
final String s = MATCHES.get(question);
for (Widget widget: widgets) {
if (widget != null && widget.getText().equals(s))
return widget;
}
return null;
}
}

View File

@@ -1,108 +0,0 @@
/*
* Copyright (c) 2019, FlaxOnEm <flax.on.em@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.stronghold;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.Client;
import net.runelite.api.events.ClientTick;
import net.runelite.api.events.WidgetLoaded;
import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetID;
import net.runelite.api.widgets.WidgetInfo;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.util.ColorUtil;
import javax.inject.Inject;
import java.awt.Color;
@PluginDescriptor(
name = "Stronghold",
description = "Highlights the correct answer to Stronghold of Security questions",
tags = {"stronghold", "security", "overlay", "answer", "highlight"},
type = "utility"
)
@Slf4j
public class StrongholdPlugin extends Plugin {
private static final Color ANSWER_COLOR = new Color(230, 0, 230);
@Inject
private Client client;
private boolean queueNPCDialogue;
private boolean queueNPCOption;
private String questionCache;
@Subscribe
public void onWidgetLoaded(WidgetLoaded widgetLoaded) {
switch (widgetLoaded.getGroupId()) {
case WidgetID.DIALOG_NPC_GROUP_ID:
queueNPCDialogue = true;
break;
case WidgetID.DIALOG_OPTION_GROUP_ID:
queueNPCOption = true;
break;
}
}
@Subscribe
public void onClientTick(ClientTick t) {
if (queueNPCDialogue) {
queueNPCDialogue = false;
onNPCDialogue();
}
if (queueNPCOption) {
queueNPCOption = false;
onNPCOption();
}
}
private void onNPCDialogue() {
final Widget debugWidget = client.getWidget(WidgetInfo.DIALOG_NPC_TEXT);
final String npcText = debugWidget.getText();
if (StrongholdAnswer.MATCHES.containsKey(npcText))
questionCache = npcText;
}
private void onNPCOption() {
if (questionCache == null)
return;
final Widget optionsWidget = client.getWidget(WidgetInfo.DIALOG_OPTION);
if (optionsWidget == null)
return;
final Widget[] widgets = optionsWidget.getParent().getChildren();
final Widget answerWidget = StrongholdAnswer.findCorrect(questionCache, widgets);
questionCache = null;
if (answerWidget == null)
return;
final String answerText = answerWidget.getText();
answerWidget.setText(ColorUtil.wrapWithColorTag(answerText, ANSWER_COLOR));
}
}

View File

@@ -1,68 +0,0 @@
/*
* Copyright (c) 2018, Frosty Fridge <https://github.com/frostyfridge>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.templetrek;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Polygon;
import javax.inject.Inject;
import net.runelite.api.GroundObject;
import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayPosition;
import net.runelite.client.ui.overlay.OverlayPriority;
import net.runelite.client.ui.overlay.OverlayUtil;
public class TempleTrekBogOverlay extends Overlay
{
private final TempleTrekConfig config;
private final TempleTrekPlugin plugin;
private static final Color GREEN = new Color(0, 200, 83);
@Inject
private TempleTrekBogOverlay(TempleTrekConfig config, TempleTrekPlugin plugin)
{
super(plugin);
this.config = config;
this.plugin = plugin;
setPosition(OverlayPosition.DYNAMIC);
setPriority(OverlayPriority.LOW);
}
@Override
public Dimension render(Graphics2D graphics)
{
if (config.bogMapActive())
{
for (GroundObject bog : plugin.getBogList())
{
Polygon bogPoly = bog.getCanvasTilePoly();
OverlayUtil.renderPolygon(graphics, bogPoly, GREEN);
}
}
return null;
}
}

View File

@@ -1,55 +0,0 @@
/*
* Copyright (c) 2018, Frosty Fridge <https://github.com/frostyfridge>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.templetrek;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
@ConfigGroup("templetrek")
public interface TempleTrekConfig extends Config
{
@ConfigItem(
keyName = "bogMapActive",
name = "Bog Map",
description = "Marks out a safe route through the bog event",
position = 0
)
default boolean bogMapActive()
{
return true;
}
@ConfigItem(
keyName = "pointTrackerActive",
name = "Point Tracker",
description = "Track your Temple Trek reward points, which determine the size of your reward.",
position = 1
)
default boolean pointTrackerActive()
{
return true;
}
}

View File

@@ -1,78 +0,0 @@
/*
* Copyright (c) 2018, Frosty Fridge <https://github.com/frostyfridge>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.templetrek;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import javax.inject.Inject;
import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayPosition;
import net.runelite.client.ui.overlay.OverlayPriority;
import net.runelite.client.ui.overlay.components.LineComponent;
import net.runelite.client.ui.overlay.components.PanelComponent;
public class TempleTrekOverlay extends Overlay
{
private final TempleTrekConfig config;
private final TempleTrekPlugin plugin;
private final PanelComponent panelComponent = new PanelComponent();
@Inject
private TempleTrekOverlay(TempleTrekConfig config, TempleTrekPlugin plugin)
{
super(plugin);
this.config = config;
this.plugin = plugin;
setPosition(OverlayPosition.TOP_LEFT);
setPriority(OverlayPriority.LOW);
}
@Override
public Dimension render(Graphics2D graphics)
{
if (config.pointTrackerActive() && plugin.isInTrek())
{
int points = plugin.getRewardPoints();
double percentage = plugin.getRewardPercentage() * 100;
panelComponent.getChildren().clear();
panelComponent.getChildren().add(LineComponent.builder()
.left("Trek Points: ")
.right(Integer.toString(points))
.rightColor(percentage < 25 ? Color.RED : percentage >= 25 && percentage < 50 ? Color.YELLOW :
percentage >= 50 && percentage < 75 ? Color.BLUE : Color.GREEN)
.build());
panelComponent.getChildren().add(LineComponent.builder()
.left("Reward %: ")
.right(String.format("%.2f", percentage) + "%")
.rightColor(percentage < 25 ? Color.RED : percentage >= 25 && percentage < 50 ? Color.YELLOW :
percentage >= 50 && percentage < 75 ? Color.BLUE : Color.GREEN)
.build());
return panelComponent.render(graphics);
}
return null;
}
}

View File

@@ -1,137 +0,0 @@
/*
* Copyright (c) 2018, Frosty Fridge <https://github.com/frostyfridge>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.templetrek;
import com.google.inject.Provides;
import java.util.HashSet;
import java.util.Set;
import javax.inject.Inject;
import lombok.Getter;
import net.runelite.api.Client;
import net.runelite.api.GroundObject;
import net.runelite.api.ObjectID;
import net.runelite.api.Varbits;
import net.runelite.api.events.GroundObjectSpawned;
import net.runelite.api.events.VarbitChanged;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.ui.overlay.OverlayManager;
@PluginDescriptor(
name = "Temple Trekking",
description = "Helpers for the Temple Trek minigame",
tags = {"minigame", "overlay", "temple trek"},
type = "utility"
)
public class TempleTrekPlugin extends Plugin
{
@Inject
private Client client;
@Inject
private OverlayManager overlayManager;
@Inject
private TempleTrekOverlay overlay;
@Inject
private TempleTrekBogOverlay bogOverlay;
@Inject
private TempleTrekConfig config;
@Getter
private final Set<GroundObject> bogList = new HashSet<GroundObject>();
@Getter
private boolean inTrek = false;
@Provides
TempleTrekConfig getConfig(ConfigManager configManager)
{
return configManager.getConfig(TempleTrekConfig.class);
}
@Override
protected void startUp()
{
overlayManager.add(overlay);
overlayManager.add(bogOverlay);
}
@Override
protected void shutDown()
{
overlayManager.remove(overlay);
overlayManager.remove(bogOverlay);
bogList.clear();
}
@Subscribe
public void onGroundObjectSpawned(GroundObjectSpawned event)
{
GroundObject obj = event.getGroundObject();
if (obj.getId() == ObjectID.BOG)
{
bogList.add(obj);
}
}
//onGroundObjectDespawned is having issues handling this, so bogmap removal is here instead.
@Subscribe
public void onVarbitChanged(VarbitChanged event)
{
if (!bogList.isEmpty() && client.getVar(Varbits.TREK_EVENT) == 0)
{
bogList.clear();
}
if (!inTrek && client.getVar(Varbits.TREK_STARTED) == 1)
{
inTrek = true;
}
else if (inTrek)
{
if (client.getVar(Varbits.TREK_STATUS) == 0 && client.getVar(Varbits.TREK_POINTS) == 0)
{
inTrek = false;
}
}
}
protected int getRewardPoints()
{
return client.getVar(Varbits.TREK_POINTS);
}
protected double getRewardPercentage()
{
double percentage = 0.000126945 * getRewardPoints() - 0.0357188951;
return Math.max(percentage, 0);
}
}