|
|
|
@@ -24,18 +24,16 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
package net.runelite.client.plugins.batools;
|
|
|
|
package net.runelite.client.plugins.batools;
|
|
|
|
|
|
|
|
|
|
|
|
import net.runelite.api.Item;
|
|
|
|
|
|
|
|
import net.runelite.api.Prayer;
|
|
|
|
|
|
|
|
import net.runelite.api.SoundEffectID;
|
|
|
|
|
|
|
|
import net.runelite.api.Tile;
|
|
|
|
|
|
|
|
import net.runelite.api.kit.KitType;
|
|
|
|
|
|
|
|
import net.runelite.client.eventbus.Subscribe;
|
|
|
|
|
|
|
|
import com.google.inject.Provides;
|
|
|
|
import com.google.inject.Provides;
|
|
|
|
import java.awt.event.KeyEvent;
|
|
|
|
import java.awt.event.KeyEvent;
|
|
|
|
import java.awt.image.BufferedImage;
|
|
|
|
import java.awt.image.BufferedImage;
|
|
|
|
import java.time.Duration;
|
|
|
|
import java.time.Duration;
|
|
|
|
import java.time.Instant;
|
|
|
|
import java.time.Instant;
|
|
|
|
import java.util.*;
|
|
|
|
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.inject.Inject;
|
|
|
|
import lombok.Getter;
|
|
|
|
import lombok.Getter;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
@@ -47,6 +45,8 @@ import net.runelite.api.ItemID;
|
|
|
|
import net.runelite.api.MenuEntry;
|
|
|
|
import net.runelite.api.MenuEntry;
|
|
|
|
import net.runelite.api.NPC;
|
|
|
|
import net.runelite.api.NPC;
|
|
|
|
import net.runelite.api.NpcID;
|
|
|
|
import net.runelite.api.NpcID;
|
|
|
|
|
|
|
|
import net.runelite.api.Prayer;
|
|
|
|
|
|
|
|
import net.runelite.api.SoundEffectID;
|
|
|
|
import net.runelite.api.Varbits;
|
|
|
|
import net.runelite.api.Varbits;
|
|
|
|
import net.runelite.api.coords.WorldPoint;
|
|
|
|
import net.runelite.api.coords.WorldPoint;
|
|
|
|
import net.runelite.api.events.ChatMessage;
|
|
|
|
import net.runelite.api.events.ChatMessage;
|
|
|
|
@@ -65,6 +65,7 @@ import net.runelite.api.widgets.WidgetID;
|
|
|
|
import net.runelite.api.widgets.WidgetInfo;
|
|
|
|
import net.runelite.api.widgets.WidgetInfo;
|
|
|
|
import net.runelite.client.chat.ChatMessageManager;
|
|
|
|
import net.runelite.client.chat.ChatMessageManager;
|
|
|
|
import net.runelite.client.config.ConfigManager;
|
|
|
|
import net.runelite.client.config.ConfigManager;
|
|
|
|
|
|
|
|
import net.runelite.client.eventbus.Subscribe;
|
|
|
|
import net.runelite.client.game.ItemManager;
|
|
|
|
import net.runelite.client.game.ItemManager;
|
|
|
|
import net.runelite.client.input.KeyListener;
|
|
|
|
import net.runelite.client.input.KeyListener;
|
|
|
|
import net.runelite.client.input.KeyManager;
|
|
|
|
import net.runelite.client.input.KeyManager;
|
|
|
|
@@ -85,9 +86,9 @@ import org.apache.commons.lang3.ArrayUtils;
|
|
|
|
)
|
|
|
|
)
|
|
|
|
public class BAToolsPlugin extends Plugin implements KeyListener
|
|
|
|
public class BAToolsPlugin extends Plugin implements KeyListener
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int inGameBit = 0;
|
|
|
|
private int inGameBit = 0;
|
|
|
|
int tickNum;
|
|
|
|
private int tickNum;
|
|
|
|
int pastCall = 0;
|
|
|
|
private int pastCall = 0;
|
|
|
|
private int currentWave = 1;
|
|
|
|
private int currentWave = 1;
|
|
|
|
private static final int BA_WAVE_NUM_INDEX = 2;
|
|
|
|
private static final int BA_WAVE_NUM_INDEX = 2;
|
|
|
|
private final List<MenuEntry> entries = new ArrayList<>();
|
|
|
|
private final List<MenuEntry> entries = new ArrayList<>();
|
|
|
|
@@ -100,12 +101,6 @@ public class BAToolsPlugin extends Plugin implements KeyListener
|
|
|
|
@Inject
|
|
|
|
@Inject
|
|
|
|
private Client client;
|
|
|
|
private Client client;
|
|
|
|
|
|
|
|
|
|
|
|
@Inject
|
|
|
|
|
|
|
|
private ConfigManager configManager;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Inject
|
|
|
|
|
|
|
|
private ChatMessageManager chatMessageManager;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Inject
|
|
|
|
@Inject
|
|
|
|
private OverlayManager overlayManager;
|
|
|
|
private OverlayManager overlayManager;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -165,19 +160,15 @@ public class BAToolsPlugin extends Plugin implements KeyListener
|
|
|
|
@Subscribe
|
|
|
|
@Subscribe
|
|
|
|
public void onWidgetLoaded(WidgetLoaded event)
|
|
|
|
public void onWidgetLoaded(WidgetLoaded event)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch (event.getGroupId())
|
|
|
|
if (event.getGroupId() == WidgetID.BA_REWARD_GROUP_ID)
|
|
|
|
{
|
|
|
|
|
|
|
|
case WidgetID.BA_REWARD_GROUP_ID:
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Widget rewardWidget = client.getWidget(WidgetInfo.BA_REWARD_TEXT);
|
|
|
|
Widget rewardWidget = client.getWidget(WidgetInfo.BA_REWARD_TEXT);
|
|
|
|
|
|
|
|
|
|
|
|
if (rewardWidget != null && rewardWidget.getText().contains("<br>5"))
|
|
|
|
if (rewardWidget != null && rewardWidget.getText().contains("<br>5"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tickNum = 0;
|
|
|
|
tickNum = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Subscribe
|
|
|
|
@Subscribe
|
|
|
|
public void onGameTick(GameTick event)
|
|
|
|
public void onGameTick(GameTick event)
|
|
|
|
@@ -210,38 +201,37 @@ public class BAToolsPlugin extends Plugin implements KeyListener
|
|
|
|
counter.setCount(tickNum);
|
|
|
|
counter.setCount(tickNum);
|
|
|
|
if (config.defTimer())
|
|
|
|
if (config.defTimer())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//log.info("" + tickNum++);
|
|
|
|
|
|
|
|
tickNum++;
|
|
|
|
tickNum++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget weapon = client.getWidget(593, 1);
|
|
|
|
Widget weapon = client.getWidget(593, 1);
|
|
|
|
|
|
|
|
|
|
|
|
if(config.attackStyles()
|
|
|
|
if (config.attackStyles()
|
|
|
|
&& weapon!=null
|
|
|
|
&& weapon != null
|
|
|
|
&& inGameBit == 1
|
|
|
|
&& inGameBit == 1
|
|
|
|
&& weapon.getText().contains("Crystal halberd") || weapon.getText().contains("Dragon claws")
|
|
|
|
&& weapon.getText().contains("Crystal halberd") || weapon.getText().contains("Dragon claws")
|
|
|
|
&& client.getWidget(WidgetInfo.BA_ATK_LISTEN_TEXT)!=null)
|
|
|
|
&& client.getWidget(WidgetInfo.BA_ATK_LISTEN_TEXT) != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
String style = client.getWidget(WidgetInfo.BA_ATK_LISTEN_TEXT).getText();
|
|
|
|
String style = client.getWidget(WidgetInfo.BA_ATK_LISTEN_TEXT).getText();
|
|
|
|
|
|
|
|
|
|
|
|
if(style.contains("Defensive"))
|
|
|
|
if (style.contains("Defensive"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_ONE).setHidden(true);
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_ONE).setHidden(true);
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_TWO).setHidden(true);
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_TWO).setHidden(true);
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_THREE).setHidden(true);
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_THREE).setHidden(true);
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_FOUR).setHidden(false);
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_FOUR).setHidden(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(style.contains("Aggressive"))
|
|
|
|
else if (style.contains("Aggressive"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_ONE).setHidden(true);
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_ONE).setHidden(true);
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_TWO).setHidden(false);
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_TWO).setHidden(false);
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_THREE).setHidden(true);
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_THREE).setHidden(true);
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_FOUR).setHidden(true);
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_FOUR).setHidden(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(style.contains("Controlled"))
|
|
|
|
else if (style.contains("Controlled"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(weapon.getText().contains("Crystal halberd"))
|
|
|
|
if (weapon.getText().contains("Crystal halberd"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_ONE).setHidden(false);
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_ONE).setHidden(false);
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_THREE).setHidden(true);
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_THREE).setHidden(true);
|
|
|
|
@@ -254,7 +244,7 @@ public class BAToolsPlugin extends Plugin implements KeyListener
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_TWO).setHidden(true);
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_TWO).setHidden(true);
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_FOUR).setHidden(true);
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_FOUR).setHidden(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(style.contains("Accurate") && weapon.getText().contains("Dragon claws"))
|
|
|
|
else if (style.contains("Accurate") && weapon.getText().contains("Dragon claws"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_ONE).setHidden(false);
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_ONE).setHidden(false);
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_TWO).setHidden(true);
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_TWO).setHidden(true);
|
|
|
|
@@ -278,9 +268,9 @@ public class BAToolsPlugin extends Plugin implements KeyListener
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_FOUR).setHidden(false);
|
|
|
|
client.getWidget(WidgetInfo.COMBAT_STYLE_FOUR).setHidden(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(config.prayerMetronome() && isAnyPrayerActive())
|
|
|
|
if (config.prayerMetronome() && isAnyPrayerActive())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for(int i = 0; i < config.prayerMetronomeVolume(); i++)
|
|
|
|
for (int i = 0; i < config.prayerMetronomeVolume(); i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
client.playSoundEffect(SoundEffectID.GE_INCREMENT_PLOP);
|
|
|
|
client.playSoundEffect(SoundEffectID.GE_INCREMENT_PLOP);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -354,7 +344,6 @@ public class BAToolsPlugin extends Plugin implements KeyListener
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int spawnNumber = healers.size();
|
|
|
|
int spawnNumber = healers.size();
|
|
|
|
healers.put(npc, new Healer(npc, spawnNumber, currentWave));
|
|
|
|
healers.put(npc, new Healer(npc, spawnNumber, currentWave));
|
|
|
|
//log.info("spawn number: " + spawnNumber + " on wave " + currentWave);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -392,13 +381,13 @@ public class BAToolsPlugin extends Plugin implements KeyListener
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Actor opponent = event.getTarget();
|
|
|
|
Actor opponent = event.getTarget();
|
|
|
|
|
|
|
|
|
|
|
|
if (opponent != null && opponent instanceof NPC && isNpcHealer(((NPC) opponent).getId()) && event.getSource() != client.getLocalPlayer())
|
|
|
|
if (opponent instanceof NPC && isNpcHealer(((NPC) opponent).getId()) && event.getSource() != client.getLocalPlayer())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
lastInteracted = opponent;
|
|
|
|
lastInteracted = opponent;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean isNpcHealer(int npcId)
|
|
|
|
private static boolean isNpcHealer(int npcId)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return npcId == NpcID.PENANCE_HEALER ||
|
|
|
|
return npcId == NpcID.PENANCE_HEALER ||
|
|
|
|
npcId == NpcID.PENANCE_HEALER_5766 ||
|
|
|
|
npcId == NpcID.PENANCE_HEALER_5766 ||
|
|
|
|
@@ -439,7 +428,7 @@ public class BAToolsPlugin extends Plugin implements KeyListener
|
|
|
|
if (correctCall != null) //&& callWidget.getTextColor()==16316664)
|
|
|
|
if (correctCall != null) //&& callWidget.getTextColor()==16316664)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
entries.add(correctCall);
|
|
|
|
entries.add(correctCall);
|
|
|
|
client.setMenuEntries(entries.toArray(new MenuEntry[entries.size()]));
|
|
|
|
client.setMenuEntries(entries.toArray(new MenuEntry[0]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -452,24 +441,31 @@ public class BAToolsPlugin extends Plugin implements KeyListener
|
|
|
|
{
|
|
|
|
{
|
|
|
|
swap("quick-start", option, target, true);
|
|
|
|
swap("quick-start", option, target, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(config.removeBA() && client.getVar(Varbits.IN_GAME_BA) == 1 && !option.contains("tell-"))//if in barbarian assault and menu isnt from a horn
|
|
|
|
else if (config.removeBA() && client.getVar(Varbits.IN_GAME_BA) == 1 && !option.contains("tell-"))//if in barbarian assault and menu isnt from a horn
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(itemId == ItemID.LOGS && !target.contains("healing vial"))
|
|
|
|
if (itemId == ItemID.LOGS && !target.contains("healing vial"))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (client.getWidget(WidgetInfo.BA_DEF_ROLE_TEXT) == null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(client.getWidget(WidgetInfo.BA_DEF_ROLE_TEXT) == null)
|
|
|
|
|
|
|
|
remove(new String[]{"take", "light"}, target, true);
|
|
|
|
remove(new String[]{"take", "light"}, target, true);
|
|
|
|
|
|
|
|
}
|
|
|
|
else//remove "Light" option (and "Take" option if not defender).
|
|
|
|
else//remove "Light" option (and "Take" option if not defender).
|
|
|
|
|
|
|
|
{
|
|
|
|
remove("light", target, true);
|
|
|
|
remove("light", target, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(option.equals("use"))
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (option.equals("use"))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (config.removeHealWrongFood())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (config.removeHealWrongFood()) {
|
|
|
|
|
|
|
|
Widget healer = client.getWidget(WidgetInfo.BA_HEAL_LISTEN_TEXT);
|
|
|
|
Widget healer = client.getWidget(WidgetInfo.BA_HEAL_LISTEN_TEXT);
|
|
|
|
if (healer != null) {
|
|
|
|
if (healer != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
String item = target.split("-")[0].trim();
|
|
|
|
String item = target.split("-")[0].trim();
|
|
|
|
List<String> poison = Arrays.asList("poisoned tofu", "poisoned meat", "poisoned worms");
|
|
|
|
List<String> poison = Arrays.asList("poisoned tofu", "poisoned meat", "poisoned worms");
|
|
|
|
List<String> vials = Arrays.asList("healing vial", "healing vial(1)", "healing vial(2)", "healing vial(3)", "healing vial(4)");//"healing vial(4)"
|
|
|
|
List<String> vials = Arrays.asList("healing vial", "healing vial(1)", "healing vial(2)", "healing vial(3)", "healing vial(4)");//"healing vial(4)"
|
|
|
|
if (poison.contains(item)) {//if item is a poison item
|
|
|
|
if (poison.contains(item))
|
|
|
|
|
|
|
|
{//if item is a poison item
|
|
|
|
int calledPoison = 0;
|
|
|
|
int calledPoison = 0;
|
|
|
|
switch (healer.getText())//choose which poison to hide the use/destroy option for
|
|
|
|
switch (healer.getText())//choose which poison to hide the use/destroy option for
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@@ -490,10 +486,13 @@ public class BAToolsPlugin extends Plugin implements KeyListener
|
|
|
|
{
|
|
|
|
{
|
|
|
|
remove(new String[]{"use", "destroy", "examine"}, target, true);//remove options
|
|
|
|
remove(new String[]{"use", "destroy", "examine"}, target, true);//remove options
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (!target.contains("penance healer")) {
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (!target.contains("penance healer"))
|
|
|
|
|
|
|
|
{
|
|
|
|
remove(option, target, true);
|
|
|
|
remove(option, target, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (vials.contains(item))//if item is the healer's healing vial
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (vials.contains(item))//if item is the healer's healing vial
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
if (!target.equals(item))//if target is not the vial itself
|
|
|
|
if (!target.equals(item))//if target is not the vial itself
|
|
|
|
@@ -508,26 +507,26 @@ public class BAToolsPlugin extends Plugin implements KeyListener
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(option.equals("attack") && client.getWidget(WidgetInfo.BA_ATK_ROLE_TEXT) == null && !target.equals("queen spawn"))//if not attacker
|
|
|
|
else if (option.equals("attack") && client.getWidget(WidgetInfo.BA_ATK_ROLE_TEXT) == null && !target.equals("queen spawn"))//if not attacker
|
|
|
|
{//remove attack option from everything but queen spawns
|
|
|
|
{//remove attack option from everything but queen spawns
|
|
|
|
remove(option, target, true);
|
|
|
|
remove(option, target, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if((option.equals("fix") || (option.equals("block") && target.equals("penance cave"))) && client.getWidget(WidgetInfo.BA_DEF_ROLE_TEXT) == null)//if not defender
|
|
|
|
else if ((option.equals("fix") || (option.equals("block") && target.equals("penance cave"))) && client.getWidget(WidgetInfo.BA_DEF_ROLE_TEXT) == null)//if not defender
|
|
|
|
{//the check for option requires checking target as well because defensive attack style option is also called "block".
|
|
|
|
{//the check for option requires checking target as well because defensive attack style option is also called "block".
|
|
|
|
remove(option, target, true);
|
|
|
|
remove(option, target, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if((option.equals("load")) && client.getWidget(WidgetInfo.BA_COLL_ROLE_TEXT) == null)//if not collector, remove hopper options
|
|
|
|
else if ((option.equals("load")) && client.getWidget(WidgetInfo.BA_COLL_ROLE_TEXT) == null)//if not collector, remove hopper options
|
|
|
|
{
|
|
|
|
{
|
|
|
|
remove(new String[]{option, "look-in"}, target, true);
|
|
|
|
remove(new String[]{option, "look-in"}, target, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(config.removeWrongEggs() && option.equals("take"))
|
|
|
|
else if (config.removeWrongEggs() && option.equals("take"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Widget eggToColl = client.getWidget(WidgetInfo.BA_COLL_LISTEN_TEXT);
|
|
|
|
Widget eggToColl = client.getWidget(WidgetInfo.BA_COLL_LISTEN_TEXT);
|
|
|
|
if(eggToColl != null)//if we're a collector
|
|
|
|
if (eggToColl != null)//if we're a collector
|
|
|
|
{
|
|
|
|
{
|
|
|
|
List<Integer> eggsToHide = new ArrayList<>();
|
|
|
|
List<Integer> eggsToHide = new ArrayList<>();
|
|
|
|
eggsToHide.add(ItemID.HAMMER);
|
|
|
|
eggsToHide.add(ItemID.HAMMER);
|
|
|
|
switch(eggToColl.getText())//choose which eggs to hide take option for
|
|
|
|
switch (eggToColl.getText())//choose which eggs to hide take option for
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case "Red eggs":
|
|
|
|
case "Red eggs":
|
|
|
|
eggsToHide.add(ItemID.BLUE_EGG);
|
|
|
|
eggsToHide.add(ItemID.BLUE_EGG);
|
|
|
|
@@ -542,7 +541,7 @@ public class BAToolsPlugin extends Plugin implements KeyListener
|
|
|
|
eggsToHide.add(ItemID.BLUE_EGG);
|
|
|
|
eggsToHide.add(ItemID.BLUE_EGG);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(eggsToHide.contains(itemId))
|
|
|
|
if (eggsToHide.contains(itemId))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
remove(option, target, true);//hide wrong eggs
|
|
|
|
remove(option, target, true);//hide wrong eggs
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -550,7 +549,7 @@ public class BAToolsPlugin extends Plugin implements KeyListener
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
List<Integer> defenderItems = Arrays.asList(ItemID.HAMMER, ItemID.TOFU, ItemID.CRACKERS, ItemID.WORMS);//logs are handled separately due to hiding "light" option too.
|
|
|
|
List<Integer> defenderItems = Arrays.asList(ItemID.HAMMER, ItemID.TOFU, ItemID.CRACKERS, ItemID.WORMS);//logs are handled separately due to hiding "light" option too.
|
|
|
|
if(client.getWidget(WidgetInfo.BA_DEF_ROLE_TEXT) == null || !defenderItems.contains(itemId))//if not defender, or item is not a defenderItem
|
|
|
|
if (client.getWidget(WidgetInfo.BA_DEF_ROLE_TEXT) == null || !defenderItems.contains(itemId))//if not defender, or item is not a defenderItem
|
|
|
|
{
|
|
|
|
{
|
|
|
|
remove(option, target, true);//hide everything except hammer/logs and bait if Defender
|
|
|
|
remove(option, target, true);//hide everything except hammer/logs and bait if Defender
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -586,7 +585,7 @@ public class BAToolsPlugin extends Plugin implements KeyListener
|
|
|
|
if (client.getWidget(WidgetInfo.BA_COLL_LISTEN_TEXT) != null && inGameBit == 1 && config.eggBoi() && event.getTarget().endsWith("egg") && shiftDown)
|
|
|
|
if (client.getWidget(WidgetInfo.BA_COLL_LISTEN_TEXT) != null && inGameBit == 1 && config.eggBoi() && event.getTarget().endsWith("egg") && shiftDown)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
String[] currentCall = client.getWidget(WidgetInfo.BA_COLL_LISTEN_TEXT).getText().split(" ");
|
|
|
|
String[] currentCall = client.getWidget(WidgetInfo.BA_COLL_LISTEN_TEXT).getText().split(" ");
|
|
|
|
//log.info("1 " + currentCall[0]);
|
|
|
|
|
|
|
|
MenuEntry[] menuEntries = client.getMenuEntries();
|
|
|
|
MenuEntry[] menuEntries = client.getMenuEntries();
|
|
|
|
MenuEntry correctEgg = null;
|
|
|
|
MenuEntry correctEgg = null;
|
|
|
|
entries.clear();
|
|
|
|
entries.clear();
|
|
|
|
@@ -606,7 +605,7 @@ public class BAToolsPlugin extends Plugin implements KeyListener
|
|
|
|
{
|
|
|
|
{
|
|
|
|
entries.add(correctEgg);
|
|
|
|
entries.add(correctEgg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
client.setMenuEntries(entries.toArray(new MenuEntry[entries.size()]));
|
|
|
|
client.setMenuEntries(entries.toArray(new MenuEntry[0]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (client.getWidget(WidgetInfo.BA_HEAL_LISTEN_TEXT) != null && inGameBit == 1 && config.osHelp() && event.getTarget().equals("<col=ffff>Healer item machine") && shiftDown)
|
|
|
|
if (client.getWidget(WidgetInfo.BA_HEAL_LISTEN_TEXT) != null && inGameBit == 1 && config.osHelp() && event.getTarget().equals("<col=ffff>Healer item machine") && shiftDown)
|
|
|
|
@@ -701,7 +700,7 @@ public class BAToolsPlugin extends Plugin implements KeyListener
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MenuEntry[] entries = client.getMenuEntries();
|
|
|
|
MenuEntry[] entries = client.getMenuEntries();
|
|
|
|
int idx = searchIndex(entries, option, target, strict);
|
|
|
|
int idx = searchIndex(entries, option, target, strict);
|
|
|
|
if(idx >= 0 && entries[idx] != null)
|
|
|
|
if (idx >= 0 && entries[idx] != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
entries = ArrayUtils.removeElement(entries, entries[idx]);
|
|
|
|
entries = ArrayUtils.removeElement(entries, entries[idx]);
|
|
|
|
client.setMenuEntries(entries);
|
|
|
|
client.setMenuEntries(entries);
|
|
|
|
@@ -711,12 +710,14 @@ public class BAToolsPlugin extends Plugin implements KeyListener
|
|
|
|
private void remove(String[] options, String target, boolean strict)
|
|
|
|
private void remove(String[] options, String target, boolean strict)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MenuEntry[] entries = client.getMenuEntries();
|
|
|
|
MenuEntry[] entries = client.getMenuEntries();
|
|
|
|
for(int i = 0; i < options.length; i++)
|
|
|
|
for (String option : options)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int idx = searchIndex(entries, option, target, strict);
|
|
|
|
|
|
|
|
if (idx >= 0 && entries[idx] != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int idx = searchIndex(entries, options[i], target, strict);
|
|
|
|
|
|
|
|
if(idx >= 0 && entries[idx] != null)
|
|
|
|
|
|
|
|
entries = ArrayUtils.removeElement(entries, entries[idx]);
|
|
|
|
entries = ArrayUtils.removeElement(entries, entries[idx]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
client.setMenuEntries(entries);
|
|
|
|
client.setMenuEntries(entries);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|