npcAttackCooldowns = new HashMap<>();
-
- public boolean run(JadConfig config) {
- Microbot.enableAutoRunOn = false;
- mainScheduledFuture = scheduledExecutorService.scheduleWithFixedDelay(() -> {
- try {
- if (!Microbot.isLoggedIn() || !super.run()) return;
-
- var jadNpcs = Rs2Npc.getNpcs("Jad", false);
-
- for (Rs2NpcModel jadNpc : jadNpcs.collect(Collectors.toList())) {
- if (jadNpc == null) continue;
-
- long currentTimeMillis = System.currentTimeMillis();
- int npcIndex = jadNpc.getIndex();
-
- if (npcAttackCooldowns.containsKey(npcIndex)) {
- if (currentTimeMillis - npcAttackCooldowns.get(npcIndex) < 4600) {
- continue;
- } else {
- npcAttackCooldowns.remove(npcIndex);
- }
- }
-
- int npcAnimation = jadNpc.getAnimation();
- handleJadPrayer(npcAnimation);
- if (config.shouldAttackHealers()) {
- handleHealerInteraction();
- npcAttackCooldowns.put(npcIndex, currentTimeMillis);
- }
- }
- } catch (Exception ex) {
- System.out.println(ex.getMessage());
- }
- }, 0, 10, TimeUnit.MILLISECONDS);
- return true;
- }
-
- private void handleHealerInteraction() {
- var healer = Rs2Npc.getNpcs("hurkot", false)
- .filter(npc -> npc != null && npc.getInteracting() != Microbot.getClient().getLocalPlayer())
- .findFirst()
- .orElse(null);
-
- if (healer != null) {
- Rs2Npc.interact(healer, "attack");
- } else {
- var npc = Rs2Player.getInteracting();
- if (npc == null || npc != null && npc.getName().contains("hurkot")) {
- Rs2Npc.interact(Rs2Npc.getNpc("Jad", false), "attack");
- }
- }
-
- }
-
- @Override
- public void shutdown() {
- super.shutdown();
- npcAttackCooldowns.clear();
- }
-
- private void handleJadPrayer(int animationId) {
- if (animationId == 7592 || animationId == 2656) {
- Rs2Prayer.toggle(Rs2PrayerEnum.PROTECT_MAGIC, true);
- } else if (animationId == 7593 || animationId == 2652) {
- Rs2Prayer.toggle(Rs2PrayerEnum.PROTECT_RANGE, true);
- }
- }
-}
\ No newline at end of file
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/nmz/NmzConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/nmz/NmzConfig.java
deleted file mode 100644
index 58a6e104051..00000000000
--- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/nmz/NmzConfig.java
+++ /dev/null
@@ -1,153 +0,0 @@
-package net.runelite.client.plugins.microbot.nmz;
-
-import net.runelite.client.config.*;
-import net.runelite.client.plugins.microbot.inventorysetups.InventorySetup;
-import net.runelite.client.plugins.microbot.util.Rs2InventorySetup;
-
-@ConfigGroup("nmz")
-@ConfigInformation(
- "Before starting:
" +
- "" +
- "- Set up your inventory setup with required items
" +
- "- Ensure you have GP in the coffer
" +
- "- Have a previous dream setup already
" +
- "- Turn ON Auto Retaliate in combat settings
" +
- "
" +
- "These steps are essential for the plugin to function correctly.
"
-)
-public interface NmzConfig extends Config {
- String GROUP = "Nmz";
-
- @ConfigSection(
- name = "General",
- description = "General",
- position = 0,
- closedByDefault = false
- )
- String generalSection = "general";
-
- @ConfigItem(
- keyName = "inventorySetup",
- name = "Inventory Setup",
- description = "Inventory Setup to use for NMZ",
- position = 1,
- section = generalSection
- )
- default InventorySetup inventorySetup() { return null; }
-
- @ConfigItem(
- keyName = "How many overload potions to use",
- name = "How many overload potions to use",
- description = "How many overload potions to use",
- position = 3,
- section = generalSection
- )
- default int overloadPotionAmount()
- {
- return 8;
- }
-
- @ConfigItem(
- keyName = "How many absorption potions to use",
- name = "How many absorption potions to use",
- description = "How many absorption potions to use",
- position = 4,
- section = generalSection
- )
- default int absorptionPotionAmount()
- {
- return 19;
- }
-
- @ConfigItem(
- keyName = "Stop after death",
- name = "Stop after death",
- description = "Stop after death",
- position = 4,
- section = generalSection
- )
- default boolean stopAfterDeath()
- {
- return true;
- }
-
- @ConfigItem(
- keyName = "Use Zapper",
- name = "Use Zapper",
- description = "Use Zapper to increase nightmare zone points",
- position = 4,
- section = generalSection
- )
- default boolean useZapper()
- {
- return false;
- }
-
- @ConfigItem(
- keyName = "Use Reccurent damage",
- name = "Use Reccurent damage",
- description = "Use reccurent damage to increase nightmare zone points",
- position = 4,
- section = generalSection
- )
- default boolean useReccurentDamage()
- {
- return false;
- }
-
- @ConfigItem(
- keyName = "Use Power Surge",
- name = "Use Power Surge",
- description = "Use power surge for infinite special attack",
- position = 4,
- section = generalSection
- )
- default boolean usePowerSurge()
- {
- return false;
- }
- @ConfigItem(
- keyName = "Auto Prayer Potion",
- name = "Auto drink prayer potion",
- description = "Automatically drinks prayer potions",
- position = 5,
- section = generalSection
- )
- default boolean togglePrayerPotions()
- {
- return false;
- }
- @ConfigItem(
- keyName = "Random Mouse Movements",
- name = "Random Mouse Movements",
- description = "Random Mouse Movements",
- position = 6,
- section = generalSection
- )
- default boolean randomMouseMovements()
- {
- return true;
- }
- @ConfigItem(
- keyName = "Walk to center",
- name = "Walk to center",
- description = "Walk to center of nmz",
- position = 7,
- section = generalSection
- )
- default boolean walkToCenter()
- {
- return true;
- }
- @ConfigItem(
- keyName = "Randomly trigger rapid heal",
- name = "Randomly trigger rapid heal",
- description = "Will randomly trigger rapid heal",
- position = 8,
- section = generalSection
- )
- default boolean randomlyTriggerRapidHeal()
- {
- return true;
- }
-}
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/nmz/NmzOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/nmz/NmzOverlay.java
deleted file mode 100644
index c90c3c7ba03..00000000000
--- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/nmz/NmzOverlay.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package net.runelite.client.plugins.microbot.nmz;
-
-import net.runelite.api.Point;
-import net.runelite.client.plugins.microbot.Microbot;
-import net.runelite.client.ui.overlay.OverlayPanel;
-import net.runelite.client.ui.overlay.OverlayPosition;
-import net.runelite.client.ui.overlay.components.LineComponent;
-import net.runelite.client.ui.overlay.components.TitleComponent;
-
-import javax.inject.Inject;
-import java.awt.*;
-
-public class NmzOverlay extends OverlayPanel {
- @Inject
- NmzOverlay(NmzPlugin plugin)
- {
- super(plugin);
- setPosition(OverlayPosition.TOP_LEFT);
- setNaughty();
- }
- @Override
- public Dimension render(Graphics2D graphics) {
- try {
- panelComponent.setPreferredSize(new Dimension(200, 300));
- panelComponent.getChildren().add(TitleComponent.builder()
- .text("Micro NMZ V" + NmzScript.version)
- .color(Color.GREEN)
- .build());
-
- panelComponent.getChildren().add(LineComponent.builder().build());
-
- panelComponent.getChildren().add(LineComponent.builder()
- .left(Microbot.status)
- .build());
-
- panelComponent.getChildren().add(LineComponent.builder()
- .left("Will self damage at: " + NmzScript.maxHealth)
- .build());
-
- panelComponent.getChildren().add(LineComponent.builder()
- .left("Will drink absorption at: " + NmzScript.minAbsorption)
- .build());
-
- } catch(Exception ex) {
- System.out.println(ex.getMessage());
- }
- return super.render(graphics);
- }
-}
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/nmz/NmzPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/nmz/NmzPlugin.java
deleted file mode 100644
index fc17b8139cc..00000000000
--- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/nmz/NmzPlugin.java
+++ /dev/null
@@ -1,110 +0,0 @@
-package net.runelite.client.plugins.microbot.nmz;
-
-import com.google.inject.Provides;
-import lombok.extern.slf4j.Slf4j;
-import net.runelite.api.ChatMessageType;
-import net.runelite.api.events.ActorDeath;
-import net.runelite.api.events.ChatMessage;
-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.plugins.microbot.Microbot;
-import net.runelite.client.plugins.microbot.pluginscheduler.api.SchedulablePlugin;
-import net.runelite.client.plugins.microbot.pluginscheduler.condition.logical.AndCondition;
-import net.runelite.client.plugins.microbot.pluginscheduler.condition.logical.LogicalCondition;
-import net.runelite.client.plugins.microbot.pluginscheduler.event.PluginScheduleEntrySoftStopEvent;
-import net.runelite.client.plugins.microbot.util.Global;
-import net.runelite.client.plugins.microbot.util.gameobject.Rs2GameObject;
-import net.runelite.client.ui.overlay.OverlayManager;
-
-import javax.inject.Inject;
-import java.awt.*;
-
-@PluginDescriptor(
- name = PluginDescriptor.Mocrosoft + "Nmz",
- description = "Microbot NMZ",
- tags = {"nmz", "microbot"},
- enabledByDefault = false
-)
-@Slf4j
-public class NmzPlugin extends Plugin implements SchedulablePlugin{
- @Inject
- private NmzConfig config;
-
- @Provides
- NmzConfig provideConfig(ConfigManager configManager) {
- return configManager.getConfig(NmzConfig.class);
- }
-
- @Inject
- private OverlayManager overlayManager;
- @Inject
- private NmzOverlay nmzOverlay;
-
- @Inject
- NmzScript nmzScript;
- @Inject
- PrayerPotionScript prayerPotionScript;
- private LogicalCondition stopCondition = new AndCondition();
-
- @Override
- protected void startUp() throws AWTException {
- if (overlayManager != null) {
- overlayManager.add(nmzOverlay);
- }
- nmzScript.run();
- if (config.togglePrayerPotions()) {
- prayerPotionScript.run(config);
- }
- }
-
- protected void shutDown() {
- nmzScript.shutdown();
- overlayManager.remove(nmzOverlay);
- NmzScript.setHasSurge(false);
- }
-
- @Subscribe
- public void onPluginScheduleEntrySoftStopEvent(PluginScheduleEntrySoftStopEvent event) {
- if (event.getPlugin() == this) {
- nmzScript.shutdown();
- Microbot.getClientThread().runOnSeperateThread(() -> {
- if(!nmzScript.isOutside()) {
- Rs2GameObject.interact(26276, "Drink");
- Global.sleepUntil(nmzScript::isOutside, 10000);
- }
- Microbot.stopPlugin(this);
- return true;
- });
- }
- }
-
- @Subscribe
- public void onActorDeath(ActorDeath actorDeath) {
- if (config.stopAfterDeath() && actorDeath.getActor() == Microbot.getClient().getLocalPlayer()) {
- Microbot.getClientThread().runOnSeperateThread(() -> {
- Global.sleepUntil(nmzScript::isOutside, 10000);
- Microbot.stopPlugin(this);
- return true;
- });
- }
- }
-
- @Subscribe
- public void onChatMessage(ChatMessage event) {
- if (event.getType() == ChatMessageType.GAMEMESSAGE) {
- if (event.getMessage().equalsIgnoreCase("you feel a surge of special attack power!")) {
- NmzScript.setHasSurge(true);
- } else if (event.getMessage().equalsIgnoreCase("your surge of special attack power has ended.")) {
- NmzScript.setHasSurge(false);
- }
- }
- }
- @Override
- public LogicalCondition getStopCondition() {
- // Create a new stop condition
- return this.stopCondition;
- }
-
-}
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/nmz/NmzScript.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/nmz/NmzScript.java
deleted file mode 100644
index 0bca42354e0..00000000000
--- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/nmz/NmzScript.java
+++ /dev/null
@@ -1,379 +0,0 @@
-package net.runelite.client.plugins.microbot.nmz;
-
-import lombok.Getter;
-import lombok.Setter;
-import net.runelite.api.*;
-import net.runelite.api.coords.WorldPoint;
-import net.runelite.api.widgets.Widget;
-import net.runelite.client.plugins.microbot.Microbot;
-import net.runelite.client.plugins.microbot.Script;
-import net.runelite.client.plugins.microbot.util.Rs2InventorySetup;
-import net.runelite.client.plugins.microbot.util.bank.Rs2Bank;
-import net.runelite.client.plugins.microbot.util.combat.Rs2Combat;
-import net.runelite.client.plugins.microbot.util.gameobject.Rs2GameObject;
-import net.runelite.client.plugins.microbot.util.inventory.Rs2Inventory;
-import net.runelite.client.plugins.microbot.util.keyboard.Rs2Keyboard;
-import net.runelite.client.plugins.microbot.util.math.Rs2Random;
-import net.runelite.client.plugins.microbot.util.npc.Rs2Npc;
-import net.runelite.client.plugins.microbot.util.npc.Rs2NpcModel;
-import net.runelite.client.plugins.microbot.util.player.Rs2Player;
-import net.runelite.client.plugins.microbot.util.prayer.Rs2Prayer;
-import net.runelite.client.plugins.microbot.util.prayer.Rs2PrayerEnum;
-import net.runelite.client.plugins.microbot.util.security.Encryption;
-import net.runelite.client.plugins.microbot.util.security.Login;
-import net.runelite.client.plugins.microbot.util.walker.Rs2Walker;
-import net.runelite.client.plugins.microbot.util.widget.Rs2Widget;
-
-import javax.inject.Inject;
-import java.util.concurrent.TimeUnit;
-
-import static net.runelite.api.ObjectID.OVERLOAD_POTION;
-import static net.runelite.api.Varbits.NMZ_ABSORPTION;
-
-public class NmzScript extends Script {
-
- public static double version = 2.2;
-
- private NmzConfig config;
- private NmzPlugin plugin;
-
- public static boolean useOverload = false;
-
- public static PrayerPotionScript prayerPotionScript;
-
- public static int maxHealth = Rs2Random.between(2, 8);
- public static int minAbsorption = Rs2Random.between(100, 300);
-
- private WorldPoint center = new WorldPoint(Rs2Random.between(2270, 2276), Rs2Random.between(4693, 4696), 0);
-
- @Getter
- @Setter
- private static boolean hasSurge = false;
- private boolean initialized = false;
- private long lastCombatTime = 0;
-
- public boolean canStartNmz() {
- return Rs2Inventory.count("overload (4)") == config.overloadPotionAmount() ||
- (Rs2Inventory.hasItem("prayer potion") && config.togglePrayerPotions());
- }
-
- @Inject
- public NmzScript(NmzPlugin plugin, NmzConfig config) {
- this.plugin = plugin;
- this.config = config;
- }
-
-
- public boolean run() {
- prayerPotionScript = new PrayerPotionScript();
- Microbot.getSpecialAttackConfigs().setSpecialAttack(true);
- mainScheduledFuture = scheduledExecutorService.scheduleWithFixedDelay(() -> {
- try {
- if (!Microbot.isLoggedIn()) return;
- if (!initialized) {
- initialized = true;
- if (config.inventorySetup() != null) {
- var inventorySetup = new Rs2InventorySetup(config.inventorySetup(), mainScheduledFuture);
- if (!inventorySetup.doesInventoryMatch() || !inventorySetup.doesEquipmentMatch()) {
- Rs2Walker.walkTo(Rs2Bank.getNearestBank().getWorldPoint(), 20);
- if (!inventorySetup.loadEquipment() || !inventorySetup.loadInventory()) {
- Microbot.log("Failed to load inventory setup");
- Microbot.stopPlugin(plugin);
- return;
- }
- Rs2Bank.closeBank();
- }
- }
- Rs2Walker.walkTo(new WorldPoint(2609, 3114, 0), 5);
- }
- if (!super.run()) return;
- Rs2Combat.enableAutoRetialiate();
- if (Rs2Random.between(1, 50) == 1 && config.randomMouseMovements()) {
- Microbot.getMouse().click(Rs2Random.between(0, Microbot.getClient().getCanvasWidth()), Rs2Random.between(0, Microbot.getClient().getCanvasHeight()), true);
- }
- boolean isOutsideNmz = isOutside();
- useOverload = Microbot.getClient().getBoostedSkillLevel(Skill.RANGED) == Microbot.getClient().getRealSkillLevel(Skill.RANGED) && config.overloadPotionAmount() > 0;
- if (isOutsideNmz) {
- Rs2Walker.setTarget(null);
- handleOutsideNmz();
- } else {
- handleInsideNmz();
- }
- } catch (Exception ex) {
- Microbot.logStackTrace(this.getClass().getSimpleName(), ex);
- }
- }, 0, 1000, TimeUnit.MILLISECONDS);
- return true;
- }
-
- @Override
- public void shutdown() {
- super.shutdown();
- initialized = false;
- }
-
- public boolean isOutside() {
- return Microbot.getClient().getLocalPlayer().getWorldLocation().distanceTo(new WorldPoint(2602, 3116, 0)) < 20;
- }
-
- public void handleOutsideNmz() {
- boolean hasStartedDream = Microbot.getVarbitValue(3946) > 0;
- if (config.togglePrayerPotions())
- Rs2Prayer.toggle(Rs2PrayerEnum.PROTECT_MELEE, false);
- if (!hasStartedDream) {
- startNmzDream();
- } else {
- final String overload = "Overload (4)";
- final String absorption = "Absorption (4)";
- storePotions(OVERLOAD_POTION, "overload", config.overloadPotionAmount());
- storePotions(ObjectID.ABSORPTION_POTION, "absorption", config.absorptionPotionAmount());
- handleStore();
- fetchOverloadPotions(OVERLOAD_POTION, overload, config.overloadPotionAmount());
- if (Rs2Inventory.hasItemAmount(overload, config.overloadPotionAmount())) {
- fetchPotions(ObjectID.ABSORPTION_POTION, absorption, config.absorptionPotionAmount());
- }
- }
- if (canStartNmz()) {
- consumeEmptyVial();
- } else {
- sleep(2000);
- }
- }
-
- public void handleInsideNmz() {
- if (Rs2Player.isInCombat()) {
- lastCombatTime = System.currentTimeMillis();
- }
- if (!Rs2Player.isInCombat() && System.currentTimeMillis() - lastCombatTime > 20000) {
- Rs2NpcModel closestNpc = Rs2Npc.getNearestNpcWithAction("Attack");
-
- if (closestNpc != null) {
- Rs2Npc.interact(closestNpc, "Attack");
- }
- }
- prayerPotionScript.run();
- if (config.togglePrayerPotions())
- Rs2Prayer.toggle(Rs2PrayerEnum.PROTECT_MELEE, true);
- if (!useOrbs() && config.walkToCenter()) {
- walkToCenter();
- }
- useOverloadPotion();
- manageSelfHarm();
- useAbsorptionPotion();
- }
-
- private void walkToCenter() {
- if (center.distanceTo(Rs2Player.getWorldLocation()) > 4) {
- Rs2Walker.walkTo(center, 6);
- }
- }
-
- public void startNmzDream() {
- // Set new center so that it is random for every time joining the dream
- center = new WorldPoint(Rs2Random.between(2270, 2276), Rs2Random.between(4693, 4696), 0);
- Rs2Npc.interact(NpcID.DOMINIC_ONION, "Dream");
- sleepUntil(() -> Rs2Widget.hasWidget("Which dream would you like to experience?"));
- Rs2Widget.clickWidget("Previous:");
- sleepUntil(() -> Rs2Widget.hasWidget("Click here to continue"));
- Rs2Widget.clickWidget("Click here to continue");
- sleepUntil(() -> Rs2Widget.hasWidget("Agree to pay"));
- if (Rs2Widget.hasWidget("Agree to pay")) {
- Rs2Keyboard.typeString("1");
- Rs2Keyboard.enter();
- }
- }
-
- public boolean useOrbs() {
- boolean orbHasSpawned = false;
- if (config.useZapper()) {
- orbHasSpawned = interactWithObject(ObjectID.ZAPPER_26256);
- }
- if (config.useReccurentDamage()) {
- orbHasSpawned = interactWithObject(ObjectID.RECURRENT_DAMAGE);
- }
-
- if (config.usePowerSurge()) {
- orbHasSpawned = interactWithObject(ObjectID.POWER_SURGE);
- }
-
- return orbHasSpawned;
- }
-
- public boolean interactWithObject(int objectId) {
- TileObject rs2GameObject = Rs2GameObject.findObjectById(objectId);
- if (rs2GameObject != null) {
- Rs2Walker.walkFastLocal(rs2GameObject.getLocalLocation());
- sleepUntil(() -> Microbot.getClient().getLocalPlayer().getWorldLocation().distanceTo(rs2GameObject.getWorldLocation()) < 5);
- Rs2GameObject.interact(objectId);
- return true;
- }
- return false;
- }
-
- private void fetchOverloadPotions(int objectId, String itemName, int requiredAmount) {
- int currentAmount = Rs2Inventory.count(itemName);
-
- if (currentAmount == requiredAmount) return;
-
- int neededAmount = requiredAmount - currentAmount;
-
- Rs2GameObject.interact(objectId, "Take");
- String widgetText = "How many doses of ";
- sleepUntil(() -> Rs2Widget.hasWidget(widgetText));
-
- if (Rs2Widget.hasWidget(widgetText)) {
- // Each potion has 4 doses, so request the correct number of doses
- Rs2Keyboard.typeString(Integer.toString(neededAmount * 4));
- Rs2Keyboard.enter();
- sleepUntil(() -> Rs2Inventory.count(itemName) == requiredAmount);
- }
- }
-
-
- public void manageSelfHarm() {
- int currentHP = Microbot.getClient().getBoostedSkillLevel(Skill.HITPOINTS);
- int currentRangedLevel = Microbot.getClient().getBoostedSkillLevel(Skill.RANGED);
- int realRangedLevel = Microbot.getClient().getRealSkillLevel(Skill.RANGED);
- boolean hasOverloadPotions = config.overloadPotionAmount() > 0;
-
- if (currentHP >= maxHealth
- && !useOverload
- && (!hasOverloadPotions || currentRangedLevel != realRangedLevel)) {
- maxHealth = 1;
-
- if (Rs2Inventory.hasItem(ItemID.LOCATOR_ORB)) {
- Rs2Inventory.interact(ItemID.LOCATOR_ORB, "feel");
- } else if (Rs2Inventory.hasItem(ItemID.DWARVEN_ROCK_CAKE_7510)) {
- Rs2Inventory.interact(ItemID.DWARVEN_ROCK_CAKE_7510, "guzzle");
- }
-
- if (currentHP == 1) {
- maxHealth = Rs2Random.between(2, 4);
- }
- }
-
- if (config.randomlyTriggerRapidHeal()) {
- randomlyToggleRapidHeal();
- }
- }
-
- public void randomlyToggleRapidHeal() {
- if (Rs2Random.between(1, 50) == 2) {
- Rs2Prayer.toggle(Rs2PrayerEnum.RAPID_HEAL, true);
- sleep(300, 600);
- Rs2Prayer.toggle(Rs2PrayerEnum.RAPID_HEAL, false);
- }
- }
-
- public void useOverloadPotion() {
- if (useOverload && Rs2Inventory.hasItem("overload") && Microbot.getClient().getBoostedSkillLevel(Skill.HITPOINTS) > 50) {
- Rs2Inventory.interact(x -> x.getName().toLowerCase().contains("overload"), "drink");
- sleep(10000);
- }
- }
-
- public void useAbsorptionPotion() {
- if (Microbot.getVarbitValue(NMZ_ABSORPTION) < minAbsorption && Rs2Inventory.hasItem("absorption")) {
- for (int i = 0; i < Rs2Random.between(4, 8); i++) {
- Rs2Inventory.interact(x -> x.getName().toLowerCase().contains("absorption"), "drink");
- sleep(600, 1000);
- }
- minAbsorption = Rs2Random.between(100, 300);
- }
- }
-
- private void storePotions(int objectId, String itemName, int requiredAmount) {
- if (Rs2Inventory.count(itemName) == requiredAmount) return;
- if (Rs2Inventory.get(itemName) == null) return;
-
- Rs2GameObject.interact(objectId, "Store");
- String storeWidgetText = "Store all your ";
- sleepUntil(() -> Rs2Widget.hasWidget(storeWidgetText));
- if (Rs2Widget.hasWidget(storeWidgetText)) {
- Rs2Keyboard.typeString("1");
- Rs2Keyboard.enter();
- sleepUntil(() -> !Rs2Inventory.hasItem(objectId));
- Rs2Inventory.dropAll(itemName);
- }
- }
-
- private void fetchPotions(int objectId, String itemName, int requiredAmount) {
- if (Rs2Inventory.count(itemName) == requiredAmount) return;
-
- Rs2GameObject.interact(objectId, "Take");
- String widgetText = "How many doses of ";
- sleepUntil(() -> Rs2Widget.hasWidget(widgetText));
- if (Rs2Widget.hasWidget(widgetText)) {
- Rs2Keyboard.typeString(Integer.toString(requiredAmount * 4));
- Rs2Keyboard.enter();
- sleepUntil(() -> Rs2Inventory.count(itemName) == requiredAmount);
- }
- }
-
- public void consumeEmptyVial() {
- final int EMPTY_VIAL = 26291;
- if (Microbot.getClientThread().runOnClientThreadOptional(() ->
- Rs2Widget.getWidget(129, 6) == null || Rs2Widget.getWidget(129, 6).isHidden())
- .orElse(false)) {
- Rs2GameObject.interact(EMPTY_VIAL, "drink");
- }
- sleep(2000,4000);
- Widget widget = Rs2Widget.getWidget(129, 6);
- if (!Microbot.getClientThread().runOnClientThreadOptional(widget::isHidden).orElse(false)) {
- Rs2Widget.clickWidget(widget.getId());
- sleep(300);
- Rs2Widget.clickWidget(widget.getId());
- }
- sleep(2000,4000);
- }
-
- public void handleStore() {
- if (canStartNmz()) return;
- int varbitOverload = 3953;
- int varbitAbsorption = 3954;
- int overloadAmt = Microbot.getVarbitValue(varbitOverload);
- int absorptionAmt = Microbot.getVarbitValue(varbitAbsorption);
- int nmzPoints = Microbot.getVarbitPlayerValue(VarPlayer.NMZ_REWARD_POINTS);
-
- if (absorptionAmt > config.absorptionPotionAmount() * 4 && overloadAmt > config.overloadPotionAmount() * 4)
- return;
-
- if (!Rs2Inventory.isFull()) {
- if ((absorptionAmt < (config.absorptionPotionAmount() * 4) || overloadAmt < config.overloadPotionAmount() * 4) && nmzPoints < 100000) {
- Microbot.showMessage("BOT SHUTDOWN: Not enough points to buy potions");
- Microbot.stopPlugin(plugin);
- return;
- }
- }
-
- Rs2GameObject.interact(26273);
- sleepUntil(() -> Rs2Widget.isWidgetVisible(13500418) || Rs2Bank.isBankPinWidgetVisible(), 10000);
- if (Rs2Bank.isBankPinWidgetVisible()) {
- try {
- Rs2Bank.handleBankPin(Encryption.decrypt(Login.activeProfile.getBankPin()));
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- sleepUntil(() -> Rs2Widget.isWidgetVisible(13500418), 10000);
- }
-
- Widget benefitsBtn = Rs2Widget.getWidget(13500418);
- if (benefitsBtn == null) return;
- boolean notSelected = benefitsBtn.getSpriteId() != 813;
- if (notSelected) {
- Rs2Widget.clickWidgetFast(benefitsBtn, 4, 4);
- }
- int count = 0;
- while (count < Rs2Random.between(3, 5)) {
- Widget nmzRewardShop = Rs2Widget.getWidget(206, 6);
- if (nmzRewardShop == null) break;
- Widget overload = nmzRewardShop.getChild(6);
- Rs2Widget.clickWidgetFast(overload, 6, 4);
- Widget absorption = nmzRewardShop.getChild(9);
- Rs2Widget.clickWidgetFast(absorption, 9, 4);
- sleep(600, 1200);
- count++;
- }
- }
-
-}
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/nmz/PrayerPotionScript.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/nmz/PrayerPotionScript.java
deleted file mode 100644
index 037b55f0427..00000000000
--- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/nmz/PrayerPotionScript.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package net.runelite.client.plugins.microbot.nmz;
-
-import net.runelite.api.Skill;
-import net.runelite.client.plugins.microbot.Microbot;
-import net.runelite.client.plugins.microbot.Script;
-import net.runelite.client.plugins.microbot.util.inventory.Rs2Inventory;
-import net.runelite.client.plugins.microbot.util.inventory.Rs2ItemModel;
-import net.runelite.client.plugins.microbot.util.math.Rs2Random;
-
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
-public class PrayerPotionScript extends Script {
- public boolean run() {
- mainScheduledFuture = scheduledExecutorService.scheduleWithFixedDelay(() -> {
- try {
- if (!Microbot.isLoggedIn()) return;
- if (!super.run()) return;
- if ((Microbot.getClient().getBoostedSkillLevel(Skill.PRAYER) * 100) / Microbot.getClient().getRealSkillLevel(Skill.PRAYER) > Rs2Random.between(25, 30))
- return;
- List potions = Microbot.getClientThread().runOnClientThreadOptional(Rs2Inventory::getPotions).orElse(null);
- if (potions == null || potions.isEmpty()) {
- return;
- }
- for (Rs2ItemModel potion : potions) {
- if (potion.getName().toLowerCase().contains("prayer") || potion.getName().toLowerCase().contains("super restore") || potion.getName().toLowerCase().contains("moonlight potion")) {
- Rs2Inventory.interact(potion, "drink");
- sleep(1200, 2000);
- Rs2Inventory.dropAll("Vial");
- break;
- }
- }
- } catch (Exception ex) {
- Microbot.logStackTrace(this.getClass().getSimpleName(), ex);
- }
- }, 0, 600, TimeUnit.MILLISECONDS);
- return true;
- }
-
- public boolean run(NmzConfig config) {
- mainScheduledFuture = scheduledExecutorService.scheduleWithFixedDelay(() -> {
- try {
- if (!super.run()) return;
- if (!config.togglePrayerPotions()) return;
- if ((Microbot.getClient().getBoostedSkillLevel(Skill.PRAYER) * 100) / Microbot.getClient().getRealSkillLevel(Skill.PRAYER) > Rs2Random.between(25, 30))
- return;
- List potions = Microbot.getClientThread().runOnClientThreadOptional(Rs2Inventory::getPotions).orElse(null);
- if (potions == null || potions.isEmpty()) {
- return;
- }
- for (Rs2ItemModel potion : potions) {
- if (potion.getName().toLowerCase().contains("prayer")) {
- Rs2Inventory.interact(potion, "drink");
- sleep(1200, 2000);
- Rs2Inventory.dropAll("Vial");
- break;
- }
- }
- } catch (Exception ex) {
- Microbot.logStackTrace(this.getClass().getSimpleName(), ex);
- }
- }, 0, 600, TimeUnit.MILLISECONDS);
- return true;
- }
-}
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/tithefarm/TitheFarmingConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/tithefarm/TitheFarmingConfig.java
deleted file mode 100644
index 30a249462af..00000000000
--- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/tithefarm/TitheFarmingConfig.java
+++ /dev/null
@@ -1,137 +0,0 @@
-package net.runelite.client.plugins.microbot.tithefarm;
-
-import net.runelite.client.config.*;
-import net.runelite.client.plugins.microbot.tithefarm.enums.TitheFarmLanes;
-
-@ConfigGroup(TitheFarmingConfig.GROUP)
-@ConfigInformation("-- GUIDE --
" +
-"• Start at the entrance near the table to get seeds.
" +
-"• Have these items in your inventory:
" +
-" 8x Watering Can(8) or the Gricoller's Can.
" +
-" Seed dibber.
" +
-" Spade.
" +
-" Stamina potions (optional)
" +
-"• Make sure to have the tithe farm plugin from runelite enabled.
" +
-"• At least level 34 farming required.
" +
-"• Happy botting!
")
-public interface TitheFarmingConfig extends Config {
-
- String GROUP = "Farming";
-
- @ConfigSection(
- name = "Script Settings",
- description = "General",
- position = 0,
- closedByDefault = false
- )
- String scriptSettings = "Script Settings";
-
- @ConfigItem(
- keyName = "storing",
- name = "Store fruit threshold",
- description = "Amount of fruits to have in your inventory before storing them in the sack",
- position = 0,
- section = scriptSettings
- )
- default int storeFruitThreshold() {
- return 100;
- }
-
- @ConfigItem(
- keyName = "Lanes",
- name = "Tithe farm lanes",
- description = "Choose a lane starting from the entrance",
- position = 1,
- section = scriptSettings
- )
- default TitheFarmLanes Lanes() {
- return TitheFarmLanes.LANE_1_2;
- }
-
- @ConfigItem(
- keyName = "Gricoller's can refill threshold",
- name = "Gricoller's can refill threshold",
- description = "Percentage before refilling the gricoller's can",
- position = 2,
- section = scriptSettings
- )
- default int gricollerCanRefillThreshold() {
- return 30;
- }
-
- @ConfigItem(
- keyName = "Sleep after planting seed",
- name = "Sleep after planting seed",
- description = "Sleep after planting seed - changing this value might result in unexpected behavior",
- position = 3,
- section = scriptSettings
- )
- default int sleepAfterPlantingSeed() {
- return 2000;
- }
-
- @ConfigItem(
- keyName = "Sleep after watering seed",
- name = "Sleep after watering seed",
- description = "Sleep after watering seed - changing this value might result in unexpected behavior",
- position = 4,
- section = scriptSettings
- )
- default int sleepAfterWateringSeed() {
- return 2000;
- }
-
- @ConfigItem(
- keyName = "Sleep after harvesting seed",
- name = "Sleep after harvesting seed",
- description = "Sleep after harvesting seed - changing this value might result in unexpected behavior",
- position = 5,
- section = scriptSettings
- )
- default int sleepAfterHarvestingSeed() {
- return 2000;
- }
-
- @ConfigItem(
- keyName = "enableAntiban",
- name = "Enable Antiban Features",
- description = "Will enable features like natural mouse movements and such.",
- position = 6,
- section = scriptSettings
- )
- default boolean enableAntiban() {
- return false;
- }
-
-
- @ConfigSection(
- name = "Debug Settings",
- description = "General",
- position = 1,
- closedByDefault = false
- )
- String debugSettings = "Debug Settings";
-
- @ConfigItem(
- keyName = "Enable Debug",
- name = "Enable Debug",
- description = "Enable debugger",
- position = 0,
- section = debugSettings
- )
- default boolean enableDebugging() {
- return false;
- }
-
- @ConfigItem(
- keyName = "Enable Overlay",
- name = "Enable Overlay",
- description = "Enable Overlay",
- position = 1,
- section = debugSettings
- )
- default boolean enableOverlay() {
- return false;
- }
-}
-
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/tithefarm/TitheFarmingOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/tithefarm/TitheFarmingOverlay.java
deleted file mode 100644
index af53f20d9fd..00000000000
--- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/tithefarm/TitheFarmingOverlay.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package net.runelite.client.plugins.microbot.tithefarm;
-
-import net.runelite.api.Perspective;
-import net.runelite.api.Point;
-import net.runelite.api.coords.LocalPoint;
-import net.runelite.client.plugins.microbot.Microbot;
-import net.runelite.client.plugins.microbot.tithefarm.enums.TitheFarmMaterial;
-import net.runelite.client.plugins.microbot.tithefarm.models.TitheFarmPlant;
-import net.runelite.client.plugins.microbot.util.math.RateCalculator;
-import net.runelite.client.ui.overlay.OverlayPanel;
-import net.runelite.client.ui.overlay.OverlayPosition;
-import net.runelite.client.ui.overlay.OverlayUtil;
-import net.runelite.client.ui.overlay.components.ImageComponent;
-import net.runelite.client.ui.overlay.components.LineComponent;
-import net.runelite.client.ui.overlay.components.TitleComponent;
-
-import javax.inject.Inject;
-import java.awt.*;
-import java.awt.image.BufferedImage;
-import java.util.Objects;
-
-public class TitheFarmingOverlay extends OverlayPanel {
- TitheFarmingPlugin plugin;
-
- @Inject
- TitheFarmingOverlay(TitheFarmingPlugin plugin) {
- super(plugin);
- this.plugin = plugin;
- setPosition(OverlayPosition.TOP_LEFT);
- setNaughty();
- }
-
- @Override
- public Dimension render(Graphics2D graphics) {
- panelComponent.setPreferredSize(new Dimension(300, 300));
- panelComponent.getChildren().add(TitleComponent.builder()
- .text("TitheFarm")
- .color(Color.GREEN)
- .build());
-
- panelComponent.getChildren().add(LineComponent.builder()
- .left("Script State: ")
- .right(TitheFarmingScript.state.toString())
- .build());
-
- panelComponent.getChildren().add(LineComponent.builder()
- .left("Fruit per hour:")
- .right(String.valueOf(RateCalculator.getRatePerHour(TitheFarmingScript.fruits)))
- .build());
-
- panelComponent.getChildren().add(LineComponent.builder()
- .left("")
- .right("")
- .build());
-
- panelComponent.getChildren().add(LineComponent.builder()
- .left("Fruits farmed")
- .right("")
- .build());
-
- panelComponent.getChildren().add(new ImageComponent(getImage(Objects.requireNonNull(TitheFarmMaterial.getSeedForLevel()).getFruitId(), TitheFarmingScript.fruits)));
-
- if (plugin.config.enableOverlay()) {
- for (TitheFarmPlant plant : TitheFarmingScript.plants) {
- if (plant == null || plant.getGameObject() == null) continue;
- final Polygon polygon = Perspective.getCanvasTilePoly(Microbot.getClient(), plant.getGameObject().getLocalLocation());
-
- if (polygon != null) {
- OverlayUtil.renderPolygon(graphics, polygon, Color.CYAN);
- }
-
- final LocalPoint localLocation = LocalPoint.fromWorld(Microbot.getClient(), plant.getGameObject().getWorldLocation());
-
- if (localLocation == null) {
- continue;
- }
- }
- }
-
- if (plugin.config.enableDebugging()) {
- for (TitheFarmPlant plant : TitheFarmingScript.plants) {
- if (plant == null || plant.getGameObject() == null) continue;
-
- Point textLocation = Perspective.getCanvasTextLocation(Microbot.getClient(), graphics, plant.getGameObject().getLocalLocation(), "p: " + plant.isEmptyPatchOrSeedling(), 0);
- if (textLocation != null) {
- OverlayUtil.renderTextLocation(graphics, textLocation, "plant: " + plant.isEmptyPatchOrSeedling(), Color.green);
- OverlayUtil.renderTextLocation(graphics, new Point(textLocation.getX(), textLocation.getY() + 20), "harvest: " + plant.isValidToHarvest(), Color.green);
- OverlayUtil.renderTextLocation(graphics, new Point(textLocation.getX(), textLocation.getY() + 40), "water: " + plant.isValidToWater(), Color.green);
- }
- }
- }
- return super.render(graphics);
- }
-
- private BufferedImage getImage(int itemID, int amount)
- {
- BufferedImage image = Microbot.getItemManager().getImage(itemID, amount, true);
- return image;
- }
-}
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/tithefarm/TitheFarmingPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/tithefarm/TitheFarmingPlugin.java
deleted file mode 100644
index 54a95362fb6..00000000000
--- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/tithefarm/TitheFarmingPlugin.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package net.runelite.client.plugins.microbot.tithefarm;
-
-
-import com.google.inject.Provides;
-import lombok.extern.slf4j.Slf4j;
-import net.runelite.api.Client;
-import net.runelite.api.Item;
-import net.runelite.api.events.ChatMessage;
-import net.runelite.api.events.GameObjectSpawned;
-import net.runelite.api.events.ItemContainerChanged;
-import net.runelite.client.Notifier;
-import net.runelite.client.callback.ClientThread;
-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.plugins.microbot.Microbot;
-import net.runelite.client.plugins.microbot.tithefarm.enums.TitheFarmMaterial;
-import net.runelite.client.plugins.microbot.tithefarm.enums.TitheFarmState;
-import net.runelite.client.plugins.microbot.tithefarm.models.TitheFarmPlant;
-import net.runelite.client.plugins.microbot.util.antiban.Rs2Antiban;
-import net.runelite.client.plugins.microbot.util.antiban.Rs2AntibanSettings;
-import net.runelite.client.plugins.microbot.util.antiban.enums.Activity;
-import net.runelite.client.plugins.microbot.util.mouse.VirtualMouse;
-import net.runelite.client.ui.overlay.OverlayManager;
-
-import javax.inject.Inject;
-import java.awt.*;
-import java.util.Arrays;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-@PluginDescriptor(
- name = PluginDescriptor.Mocrosoft + "Tithe Farm",
- description = "Plays the Tithe farm minigame for you!",
- tags = {"tithe farming", "microbot", "skills", "minigame"},
- enabledByDefault = false
-)
-@Slf4j
-public class TitheFarmingPlugin extends Plugin {
-
- @Inject
- public TitheFarmingConfig config;
-
- @Provides
- TitheFarmingConfig provideConfig(ConfigManager configManager) {
- return configManager.getConfig(TitheFarmingConfig.class);
- }
-
- @Inject
- private OverlayManager overlayManager;
- @Inject
- private TitheFarmingOverlay titheFarmOverlay;
-
- private final TitheFarmingScript titheFarmScript = new TitheFarmingScript();
-
- @Override
- protected void startUp() throws AWTException {
- Microbot.pauseAllScripts.compareAndSet(true, false);
-
- if (config.enableAntiban()){
- Rs2AntibanSettings.naturalMouse = true;
- Rs2Antiban.antibanSetupTemplates.applyFarmingSetup();
- Rs2Antiban.setActivity(Activity.GENERAL_FARMING);
- Rs2Antiban.activateAntiban();
- }
-
- if (overlayManager != null) {
- overlayManager.add(titheFarmOverlay);
- }
- titheFarmScript.run(config);
- }
-
- protected void shutDown() {
- titheFarmScript.shutdown();
- overlayManager.remove(titheFarmOverlay);
- }
-
- @Subscribe
- public void onGameObjectSpawned(GameObjectSpawned event) {
- for (TitheFarmPlant plant : TitheFarmingScript.plants) {
- if (event.getGameObject().getWorldLocation().equals(plant.getGameObject().getWorldLocation())) {
- plant.setGameObject(event.getGameObject());
- }
- }
- }
-
- @Subscribe
- public void onItemContainerChanged(ItemContainerChanged event) {
- if (TitheFarmMaterial.getSeedForLevel() != null) {
- Item fruit = Arrays.stream(event.getItemContainer().getItems()).filter(x -> x.getId() == TitheFarmMaterial.getSeedForLevel().getFruitId()).findFirst().orElse(null);
- if (fruit != null) {
- TitheFarmingScript.fruits = fruit.getQuantity() - TitheFarmingScript.initialFruit;
- }
- }
- }
-
- @Subscribe
- public void onChatMessage(ChatMessage chatMessage)
- {
- String message = chatMessage.getMessage();
- if (message.contains("%")) {
- Pattern pattern = Pattern.compile("(\\d+(\\.\\d+)?)%");
- Matcher matcher = pattern.matcher(message);
-
- if (matcher.find()) {
- String percentage = matcher.group(1);
- TitheFarmingScript.gricollerCanCharges = (int) (Float.parseFloat(percentage));
- }
- } else if (message.equalsIgnoreCase("Gricoller's can is already full.")) {
- TitheFarmingScript.gricollerCanCharges = 100;
- } else if (message.equalsIgnoreCase("You don't have a suitable vessel of water for watering the plant.")) {
- TitheFarmingScript.state = TitheFarmState.REFILL_WATERCANS;
- }
- }
-}
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/tithefarm/TitheFarmingScript.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/tithefarm/TitheFarmingScript.java
deleted file mode 100644
index c33bc6a72a6..00000000000
--- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/tithefarm/TitheFarmingScript.java
+++ /dev/null
@@ -1,500 +0,0 @@
-package net.runelite.client.plugins.microbot.tithefarm;
-
-import net.runelite.api.*;
-import net.runelite.api.gameval.ObjectID;
-import net.runelite.api.coords.WorldPoint;
-import net.runelite.api.gameval.ItemID;
-import net.runelite.api.gameval.AnimationID;
-import net.runelite.client.plugins.microbot.Microbot;
-import net.runelite.client.plugins.microbot.Script;
-import net.runelite.client.plugins.microbot.breakhandler.BreakHandlerScript;
-import net.runelite.client.plugins.microbot.tithefarm.enums.TitheFarmLanes;
-import net.runelite.client.plugins.microbot.tithefarm.enums.TitheFarmMaterial;
-import net.runelite.client.plugins.microbot.tithefarm.enums.TitheFarmState;
-import net.runelite.client.plugins.microbot.tithefarm.models.TitheFarmPlant;
-import net.runelite.client.plugins.microbot.util.dialogues.Rs2Dialogue;
-import net.runelite.client.plugins.microbot.util.gameobject.Rs2GameObject;
-import net.runelite.client.plugins.microbot.util.inventory.Rs2Inventory;
-import net.runelite.client.plugins.microbot.util.inventory.Rs2ItemModel;
-import net.runelite.client.plugins.microbot.util.keyboard.Rs2Keyboard;
-import net.runelite.client.plugins.microbot.util.math.Rs2Random;
-import net.runelite.client.plugins.microbot.util.player.Rs2Player;
-import net.runelite.client.plugins.microbot.util.tabs.Rs2Tab;
-import net.runelite.client.plugins.microbot.util.walker.Rs2Walker;
-import net.runelite.client.plugins.microbot.util.widget.Rs2Widget;
-
-import java.time.Instant;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
-import static net.runelite.client.plugins.microbot.tithefarm.enums.TitheFarmState.*;
-import static net.runelite.client.plugins.microbot.util.dialogues.Rs2Dialogue.hasSelectAnOption;
-
-/**
- * TODO list:
- * -plants per hour
- * -check for seed dibber and spade inventory
- * -deposit sack
- * -test other plants
- * -move script into seperate folder
- */
-
-
-public class TitheFarmingScript extends Script {
-
- final int FARM_DOOR = 27445;
- final String FERTILISER = "gricoller's fertiliser";
-
- public static List plants = new ArrayList<>();
-
-
- public static TitheFarmState state = TitheFarmState.STARTING;
-
- public static int initialFruit = 0;
- public static int fruits = 0;
-
- public static final int WATERING_CANS_AMOUNT = 8;
-
- public static final int DISTANCE_THRESHOLD_MINIMAP_WALK = 8;
-
- public static int gricollerCanCharges = -1;
-
- public static boolean init = true;
-
- public void init(TitheFarmingConfig config) {
- TitheFarmLanes lane = config.Lanes();
-
- if (lane == TitheFarmLanes.Randomize) {
- lane = TitheFarmLanes.values()[Rs2Random.betweenInclusive(0, TitheFarmLanes.values().length - 1)];
- }
-
- switch (lane) {
- case LANE_1_2:
- plants = new ArrayList<>(Arrays.asList(
- new TitheFarmPlant(35, 25, 15),
- new TitheFarmPlant(40, 25, 16),
- new TitheFarmPlant(35, 28, 17),
- new TitheFarmPlant(40, 28, 18),
- new TitheFarmPlant(35, 31, 19),
- new TitheFarmPlant(40, 31, 20),
- new TitheFarmPlant(35, 34, 1),
- new TitheFarmPlant(40, 34, 2),
- new TitheFarmPlant(35, 40, 3),
- new TitheFarmPlant(40, 40, 4),
- new TitheFarmPlant(35, 43, 5),
- new TitheFarmPlant(40, 43, 6),
- new TitheFarmPlant(35, 46, 7),
- new TitheFarmPlant(40, 46, 8),
- new TitheFarmPlant(35, 49, 9),
- new TitheFarmPlant(40, 49, 10),
- new TitheFarmPlant(45, 49, 11),
- new TitheFarmPlant(45, 46, 12),
- new TitheFarmPlant(45, 43, 13),
- new TitheFarmPlant(45, 40, 14)));
- break;
- case LANE_2_3:
- plants = new ArrayList<>(Arrays.asList(
- new TitheFarmPlant(35, 31, -2),
- new TitheFarmPlant(35, 28, -1),
- new TitheFarmPlant(35, 25, 0),
- new TitheFarmPlant(40, 25, 1),
- new TitheFarmPlant(45, 25, 2),
- new TitheFarmPlant(40, 28, 3),
- new TitheFarmPlant(45, 28, 4),
- new TitheFarmPlant(40, 31, 5),
- new TitheFarmPlant(45, 31, 6),
- new TitheFarmPlant(40, 34, 7),
- new TitheFarmPlant(45, 34, 8),
- new TitheFarmPlant(40, 40, 9),
- new TitheFarmPlant(45, 40, 10),
- new TitheFarmPlant(40, 43, 11),
- new TitheFarmPlant(45, 43, 12),
- new TitheFarmPlant(40, 46, 13),
- new TitheFarmPlant(45, 46, 14),
- new TitheFarmPlant(40, 49, 15),
- new TitheFarmPlant(45, 49, 16)));
- break;
- case LANE_3_4:
- plants = new ArrayList<>(Arrays.asList(
- new TitheFarmPlant(40, 31, -2),
- new TitheFarmPlant(40, 28, -1),
- new TitheFarmPlant(40, 25, 0),
- new TitheFarmPlant(45, 25, 1),
- new TitheFarmPlant(50, 25, 2),
- new TitheFarmPlant(45, 28, 3),
- new TitheFarmPlant(50, 28, 4),
- new TitheFarmPlant(45, 31, 5),
- new TitheFarmPlant(50, 31, 6),
- new TitheFarmPlant(45, 34, 7),
- new TitheFarmPlant(50, 34, 8),
- new TitheFarmPlant(45, 40, 9),
- new TitheFarmPlant(50, 40, 10),
- new TitheFarmPlant(45, 43, 11),
- new TitheFarmPlant(50, 43, 12),
- new TitheFarmPlant(45, 46, 13),
- new TitheFarmPlant(50, 46, 14),
- new TitheFarmPlant(45, 49, 15),
- new TitheFarmPlant(50, 49, 16)));
- break;
- case LANE_4_5:
- plants = new ArrayList<>(Arrays.asList(
- new TitheFarmPlant(45, 31, 0),
- new TitheFarmPlant(45, 28, 1),
- new TitheFarmPlant(45, 25, 2),
- new TitheFarmPlant(50, 25, 3),
- new TitheFarmPlant(55, 25, 4),
- new TitheFarmPlant(50, 28, 5),
- new TitheFarmPlant(55, 28, 6),
- new TitheFarmPlant(50, 31, 7),
- new TitheFarmPlant(55, 31, 8),
- new TitheFarmPlant(50, 34, 9),
- new TitheFarmPlant(55, 34, 10),
- new TitheFarmPlant(50, 40, 11),
- new TitheFarmPlant(55, 40, 12),
- new TitheFarmPlant(50, 43, 13),
- new TitheFarmPlant(55, 43, 14),
- new TitheFarmPlant(50, 46, 15),
- new TitheFarmPlant(55, 46, 16),
- new TitheFarmPlant(50, 49, 17),
- new TitheFarmPlant(55, 49, 18)));
- break;
- }
- }
-
-
- public boolean run(TitheFarmingConfig config) {
- mainScheduledFuture = scheduledExecutorService.scheduleWithFixedDelay(() -> {
- try {
- if (!Microbot.isLoggedIn()) return;
- if (!super.run()) return;
- if (BreakHandlerScript.isBreakActive()) return;
-
- if (init) {
- state = STARTING;
- plants = new ArrayList<>();
- Rs2ItemModel rs2ItemSeed = Rs2Inventory.get(TitheFarmMaterial.getSeedForLevel().getFruitId());
- initialFruit = rs2ItemSeed == null ? 0 : rs2ItemSeed.getQuantity();
- init = false;
- sleep(2000); //extra sleep to have the game initialize correctly
- }
-
- //Dialogue stuff only applicable if you enter for the first time
- if (Rs2Dialogue.isInDialogue()) {
- Rs2Dialogue.clickContinue();
- sleep(400, 600);
- return;
- }
-
- if (hasSelectAnOption()) {
- Rs2Keyboard.keyPress('3');
- sleep(1500, 1800);
- return;
- }
-
- if (!isInMinigame() && !Rs2Inventory.hasItem(TitheFarmMaterial.getSeedForLevel().getName())) {
- state = TitheFarmState.TAKE_SEEDS;
- }
-
- if (validateSeedsAndPatches() && isInMinigame()) {
- state = TitheFarmState.LEAVE;
- }
-
- if (Rs2Inventory.hasItemAmount(TitheFarmMaterial.getSeedForLevel().getFruitId(), config.storeFruitThreshold())) {
- depositSack();
- return;
- }
-
- switch (state) {
- case LEAVE:
- if (!depositSack()) {
- leave();
- }
- BreakHandlerScript.setLockState(false);
- break;
- case TAKE_SEEDS:
- if (isInMinigame()) {
- state = TitheFarmState.STARTING;
- } else {
- takeSeeds();
- if (Rs2Inventory.hasItem(TitheFarmMaterial.getSeedForLevel().getName())) {
- enter();
- }
- }
- break;
- case STARTING:
- Rs2Player.toggleRunEnergy(true);
- Rs2Tab.switchToInventoryTab();
- init(config);
- validateInventory();
- DropFertiliser();
- validateRunEnergy();
- if (state != RECHARING_RUN_ENERGY)
- state = REFILL_WATERCANS;
- break;
- case RECHARING_RUN_ENERGY:
- validateRunEnergy();
- break;
- case REFILL_WATERCANS:
- refillWaterCans(config);
- BreakHandlerScript.setLockState(false);
- sleepGaussian(800, 200);
- break;
- case PLANTING_SEEDS:
- case HARVEST:
- BreakHandlerScript.setLockState(true);
- coreLoop(config);
- break;
- }
-
- if (config.enableDebugging() && plants.stream().anyMatch(x -> x.getGameObject() == null)) {
- Microbot.showMessage("There is an empty plant gameobject!");
- }
-
- } catch (Exception ex) {
- Microbot.logStackTrace(this.getClass().getSimpleName(), ex);
- }
-
- }, 0, 100, TimeUnit.MILLISECONDS);
- return true;
- }
-
- @Override
- public void shutdown() {
- super.shutdown();
- }
-
- /**
- * ALL PRIVATE SCRIPT METHODS
- */
-
- private void coreLoop(TitheFarmingConfig config) {
- if (Rs2Player.isMoving()) return;
- Comparator sortByIndex = Comparator.comparingInt(TitheFarmPlant::getIndex);
- TitheFarmPlant plant = null;
- if (state != HARVEST) {
- plant = plants.stream()
- .sorted(sortByIndex)
- .filter(TitheFarmPlant::isEmptyPatchOrSeedling) //empty patch and seedling first
- .findFirst()
- .orElseGet(() ->
- plants.stream()
- .sorted(sortByIndex)
- .filter(TitheFarmPlant::isStage1) // then stage1 plants
- .findFirst()
- .orElseGet(() ->
- plants.stream()
- .sorted(sortByIndex)
- .filter(TitheFarmPlant::isStage2) //then stage2 plants
- .findFirst()
- .orElse(null)
- )
- );
- }
-
- if (state == TitheFarmState.HARVEST && hasAllEmptyPatches()) {
- state = STARTING;
- }
-
- if (plant == null && plants.stream().anyMatch(TitheFarmPlant::isValidToHarvest)) {
- state = TitheFarmState.HARVEST;
- plant = plants.stream()
- .sorted(sortByIndex)
- .filter(TitheFarmPlant::isValidToHarvest)
- .findFirst()
- .orElse(null);
- }
-
- if (plant == null) return;
-
- final TitheFarmPlant finalPlant = plant;
-
- if (plant.getGameObject().getWorldLocation().distanceTo2D(Microbot.getClient().getLocalPlayer().getWorldLocation()) > DISTANCE_THRESHOLD_MINIMAP_WALK) {
- //Important to know that there are two world locations when you are in an instance
- //thats why we use the world location of the getLocalPlayer instead of Rs2Player.getWorldLocation
- //because Rs2Player.getWorldLocation will give us the world location in the instance and we do not want that
- WorldPoint w = WorldPoint.fromRegion(Microbot.getClient().getLocalPlayer().getWorldLocation().getRegionID(),
- plant.regionX,
- plant.regionY,
- Microbot.getClient().getPlane());
- Rs2Walker.walkMiniMap(w, 1);
- return;
- }
-
- if (plant.isEmptyPatch()) { //start planting seeds
- Rs2Inventory.interact(TitheFarmMaterial.getSeedForLevel().getName(), "Use");
- clickPatch(plant);
- // save 1 tick by manually clicking watering can immediately after planting seed
- sleepUntil(() -> Rs2Player.getAnimation() == AnimationID.FARMING_SEED_DIBBING, 2_000);
- Rs2Inventory.interact(TitheFarmMaterial.getWateringCan(), "Use");
- sleep(200,300);
- clickPatch(plant);
- sleepUntil(Rs2Player::isAnimating, config.sleepAfterPlantingSeed());
- if (Rs2Player.isAnimating()) {
- sleepUntil(() -> plants.stream().noneMatch(x -> x.getIndex() == finalPlant.getIndex() && x.isValidToWater()));
- }
- }
-
- if (plant.isValidToWater()) {
- clickPatch(plant, "water");
- sleepUntil(Rs2Player::isAnimating, config.sleepAfterWateringSeed());
- if (Rs2Player.isAnimating()) {
- sleepUntil(() -> plants.stream().noneMatch(x -> x.getIndex() == finalPlant.getIndex() && x.isValidToWater()));
- }
- plant.setPlanted(Instant.now());
- }
-
-
- if (plant.isValidToHarvest()) {
- clickPatch(plant, "harvest");
- sleepUntil(Rs2Player::isAnimating, config.sleepAfterHarvestingSeed());
- if (Rs2Player.isAnimating()) {
- sleepUntil(() -> plants.stream().anyMatch(x -> x.getIndex() == finalPlant.getIndex() && x.isEmptyPatch()));
- }
- }
- }
-
- // Helper method to validate inventory items
- private void validateInventory() {
- if (!Rs2Inventory.hasItem(ItemID.DIBBER) || !Rs2Inventory.hasItem(ItemID.SPADE)) {
- Microbot.showMessage("You need a seed dibber and a spade in your inventory!");
- shutdown();
- }
- if (!Rs2Inventory.hasItemAmount("watering can", WATERING_CANS_AMOUNT) && !Rs2Inventory.hasItem(ItemID.ZEAH_WATERINGCAN)) {
- Microbot.showMessage("You need at least 8 watering can(8) or a Gricoller's can!");
- shutdown();
- }
- }
-
-// Helper method to validate run energy and patches
- private void validateRunEnergy() {
- if (Microbot.getClient().getEnergy() < 4000 && hasAllEmptyPatches() && state != RECHARING_RUN_ENERGY) {
- state = RECHARING_RUN_ENERGY;
- Microbot.log("Recharging run energy...");
- Rs2Inventory.useRestoreEnergyItem();
- } else if (state == RECHARING_RUN_ENERGY && Microbot.getClient().getEnergy() >= 4000) {
- state = STARTING;
- }
- }
-
- private boolean validateSeedsAndPatches() {
- if (!Rs2Inventory.hasItem(TitheFarmMaterial.getSeedForLevel().getName())) {
- return true;
- }
- return false;
- }
-
-
-
- private static void clickPatch(TitheFarmPlant plant) {
- WorldPoint worldPoint = WorldPoint.fromRegion(Microbot.getClient().getLocalPlayer().getWorldLocation().getRegionID(),
- plant.regionX,
- plant.regionY,
- Microbot.getClient().getPlane());
-
- Rs2GameObject.interact(worldPoint);
-
- //Point point = Calculations.worldToCanvas(worldPoint.getX(), worldPoint.getY());
- //Microbot.getMouse().click(point);
- }
-
- private static void clickPatch(TitheFarmPlant plant, String action) {
- WorldPoint worldPoint = WorldPoint.fromRegion(Microbot.getClient().getLocalPlayer().getWorldLocation().getRegionID(),
- plant.regionX,
- plant.regionY,
- Microbot.getClient().getPlane());
-
- Rs2GameObject.interact(worldPoint, action);
- }
-
- private static void DropFertiliser() {
- if (Rs2Inventory.hasItem("Gricoller's fertiliser")) {
- Rs2Inventory.drop("Gricoller's fertiliser");
- }
- }
-
- private void refillWaterCans(TitheFarmingConfig config) {
- if (TitheFarmMaterial.hasGricollersCan()) {
- checkGricollerCharges();
- sleepUntil(() -> gricollerCanCharges != -1);
- if (gricollerCanCharges < config.gricollerCanRefillThreshold()) {
- walkToBarrel();
- Rs2Inventory.interact(ItemID.ZEAH_WATERINGCAN, "Use");
- Rs2GameObject.interact("Water barrel");
- sleepUntil(Rs2Player::isAnimating, 10000);
- } else {
- state = PLANTING_SEEDS;
- }
- } else if (TitheFarmMaterial.hasWateringCanToBeFilled()) {
- walkToBarrel();
- Rs2Inventory.interact(TitheFarmMaterial.getWateringCanToBeFilled(), "Use");
- Rs2GameObject.interact(ObjectID.WATER_BARREL1, "Use");
- sleepUntil(() -> Rs2Inventory.hasItemAmount(ItemID.WATERING_CAN_8, WATERING_CANS_AMOUNT), 60000);
- } else {
- state = PLANTING_SEEDS;
- }
- }
-
- private void walkToBarrel() {
- final TileObject gameObject = Rs2GameObject.findObjectById(ObjectID.WATER_BARREL1);
- if (gameObject.getWorldLocation().distanceTo2D(Microbot.getClient().getLocalPlayer().getWorldLocation()) > DISTANCE_THRESHOLD_MINIMAP_WALK) {
- Rs2Walker.walkMiniMap(gameObject.getWorldLocation(), 1);
- sleepUntil(Rs2Player::isMoving);
- }
- sleepUntil(() -> gameObject.getWorldLocation().distanceTo2D(Microbot.getClient().getLocalPlayer().getWorldLocation()) < DISTANCE_THRESHOLD_MINIMAP_WALK);
- }
-
- private void checkGricollerCharges() {
- gricollerCanCharges = -1;
- Rs2Inventory.interact(ItemID.ZEAH_WATERINGCAN, "check");
- }
-
- private void takeSeeds() {
- if (Rs2Inventory.hasItem(TitheFarmMaterial.getSeedForLevel().getName())) {
- Rs2Inventory.drop(TitheFarmMaterial.getSeedForLevel().getName());
- sleep(400, 600);
- }
- Rs2GameObject.interact(ObjectID.TITHE_PLANT_SEED_TABLE);
- boolean result = Rs2Widget.sleepUntilHasWidget(TitheFarmMaterial.getSeedForLevel().getName());
- if (!result) return;
- Rs2Keyboard.keyPress(TitheFarmMaterial.getSeedForLevel().getOption());
- sleep(1000);
- Rs2Keyboard.typeString(String.valueOf(Rs2Random.betweenInclusive(1000, 10000)));
- sleep(600);
- Rs2Keyboard.enter();
- sleepUntil(() -> Rs2Inventory.hasItem(TitheFarmMaterial.getSeedForLevel().getName()));
- }
-
- private void enter() {
- WallObject farmDoor = Rs2GameObject.getWallObject(FARM_DOOR);
- Rs2GameObject.interact(farmDoor);
- sleepUntil(this::isInMinigame);
- }
-
- private boolean depositSack() {
- if (Rs2Inventory.hasItem(TitheFarmMaterial.getSeedForLevel().getFruitId())) {
- Microbot.log("Storing fruits into sack for experience...");
- Rs2GameObject.interact(ObjectID.TITHE_SACK_OF_FRUIT_EMPTY);
- Rs2Player.waitForWalking();
- Rs2Player.waitForAnimation();
- return true;
- }
- return false;
- }
-
- private void leave() {
- WallObject farmDoor = Rs2GameObject.getWallObject(FARM_DOOR);
- Rs2GameObject.interact(farmDoor);
- sleepUntil(() -> !Rs2Inventory.hasItem(FERTILISER), 8000);
- }
-
- private boolean hasAllEmptyPatches() {
- return plants.stream().allMatch(TitheFarmPlant::isEmptyPatch);
- }
-
- private boolean isInMinigame() {
- return Rs2Widget.getWidget(15794178) != null;
- }
-}
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/tithefarm/enums/TitheFarmLanes.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/tithefarm/enums/TitheFarmLanes.java
deleted file mode 100644
index b2f7168123d..00000000000
--- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/tithefarm/enums/TitheFarmLanes.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package net.runelite.client.plugins.microbot.tithefarm.enums;
-
-import lombok.Getter;
-import lombok.RequiredArgsConstructor;
-
-@Getter
-@RequiredArgsConstructor
-public enum TitheFarmLanes {
- LANE_1_2("Lane one and two"),
- LANE_2_3("Lane two and three"),
- LANE_3_4("Lane three and four"),
- LANE_4_5("Lane four and five"),
- Randomize("Randomize");
-
-
- private final String name;
-
- @Override
- public String toString() {
- return name;
- }
-}
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/tithefarm/enums/TitheFarmMaterial.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/tithefarm/enums/TitheFarmMaterial.java
deleted file mode 100644
index 41577bd7f1e..00000000000
--- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/tithefarm/enums/TitheFarmMaterial.java
+++ /dev/null
@@ -1,107 +0,0 @@
-package net.runelite.client.plugins.microbot.tithefarm.enums;
-
-import lombok.Getter;
-import lombok.RequiredArgsConstructor;
-import net.runelite.api.gameval.ItemID;
-import net.runelite.api.Skill;
-import net.runelite.client.plugins.microbot.Microbot;
-import net.runelite.client.plugins.microbot.util.inventory.Rs2Inventory;
-
-@Getter
-@RequiredArgsConstructor
-public enum TitheFarmMaterial {
- GOLOVANOVA_SEED("Golovanova seed", 34, '1', ItemID.HOSIDIUS_TITHE_FRUIT_A),
- BOLOGANO_SEED("Bologano seed", 54, '2', ItemID.HOSIDIUS_TITHE_FRUIT_B),
- LOGAVANO_SEED("Logavano seed", 74, '3', ItemID.HOSIDIUS_TITHE_FRUIT_C);
-
- final String name;
- final int levelRequired;
- final char option;
- final int fruitId;
-
- public static TitheFarmMaterial getSeedForLevel() {
- if (Microbot.getClient().getRealSkillLevel(Skill.FARMING) >= LOGAVANO_SEED.levelRequired)
- return LOGAVANO_SEED;
- if (Microbot.getClient().getRealSkillLevel(Skill.FARMING) >= BOLOGANO_SEED.levelRequired)
- return BOLOGANO_SEED;
- if (Microbot.getClient().getRealSkillLevel(Skill.FARMING) >= GOLOVANOVA_SEED.levelRequired)
- return GOLOVANOVA_SEED;
-
- return LOGAVANO_SEED;
- }
-
- public static boolean hasWateringCanToBeFilled() {
- return Rs2Inventory.hasItem(ItemID.WATERING_CAN_7) || Rs2Inventory.hasItem(ItemID.WATERING_CAN_6)
- || Rs2Inventory.hasItem(ItemID.WATERING_CAN_5) || Rs2Inventory.hasItem(ItemID.WATERING_CAN_4)
- || Rs2Inventory.hasItem(ItemID.WATERING_CAN_3) || Rs2Inventory.hasItem(ItemID.WATERING_CAN_2)
- || Rs2Inventory.hasItem(ItemID.WATERING_CAN_1) || Rs2Inventory.hasItem(ItemID.WATERING_CAN_0);
- }
-
- public static boolean hasGricollersCan() {
- return Rs2Inventory.hasItem(ItemID.ZEAH_WATERINGCAN);
- }
-
- public static int getWateringCanToBeFilled() {
- if (Rs2Inventory.hasItem(ItemID.WATERING_CAN_7)) {
- return ItemID.WATERING_CAN_7;
- }
- if (Rs2Inventory.hasItem(ItemID.WATERING_CAN_6)) {
- return ItemID.WATERING_CAN_6;
- }
- if (Rs2Inventory.hasItem(ItemID.WATERING_CAN_5)) {
- return ItemID.WATERING_CAN_5;
- }
- if (Rs2Inventory.hasItem(ItemID.WATERING_CAN_4)) {
- return ItemID.WATERING_CAN_4;
- }
- if (Rs2Inventory.hasItem(ItemID.WATERING_CAN_3)) {
- return ItemID.WATERING_CAN_3;
- }
- if (Rs2Inventory.hasItem(ItemID.WATERING_CAN_2)) {
- return ItemID.WATERING_CAN_2;
- }
- if (Rs2Inventory.hasItem(ItemID.WATERING_CAN_1)) {
- return ItemID.WATERING_CAN_1;
- }
- if (Rs2Inventory.hasItem(ItemID.WATERING_CAN_0)) {
- return ItemID.WATERING_CAN_0;
- }
- return -1;
- }
-
- public static int getWateringCan() {
- if (hasGricollersCan()) {
- return ItemID.ZEAH_WATERINGCAN;
- }
- if (Rs2Inventory.hasItem(ItemID.WATERING_CAN_1)) {
- return ItemID.WATERING_CAN_1;
- }
- if (Rs2Inventory.hasItem(ItemID.WATERING_CAN_2)) {
- return ItemID.WATERING_CAN_2;
- }
- if (Rs2Inventory.hasItem(ItemID.WATERING_CAN_3)) {
- return ItemID.WATERING_CAN_3;
- }
- if (Rs2Inventory.hasItem(ItemID.WATERING_CAN_4)) {
- return ItemID.WATERING_CAN_4;
- }
- if (Rs2Inventory.hasItem(ItemID.WATERING_CAN_5)) {
- return ItemID.WATERING_CAN_5;
- }
- if (Rs2Inventory.hasItem(ItemID.WATERING_CAN_6)) {
- return ItemID.WATERING_CAN_6;
- }
- if (Rs2Inventory.hasItem(ItemID.WATERING_CAN_7)) {
- return ItemID.WATERING_CAN_7;
- }
- if (Rs2Inventory.hasItem(ItemID.WATERING_CAN_8)) {
- return ItemID.WATERING_CAN_8;
- }
- return -1;
- }
-
- @Override
- public String toString() {
- return name;
- }
-}
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/tithefarm/enums/TitheFarmState.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/tithefarm/enums/TitheFarmState.java
deleted file mode 100644
index 18efba21e66..00000000000
--- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/tithefarm/enums/TitheFarmState.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package net.runelite.client.plugins.microbot.tithefarm.enums;
-
-public enum TitheFarmState {
- STARTING,
- RECHARING_RUN_ENERGY,
- TAKE_SEEDS,
- REFILL_WATERCANS,
- PLANTING_SEEDS,
- HARVEST,
- LEAVE
-}
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/tithefarm/models/TitheFarmPlant.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/tithefarm/models/TitheFarmPlant.java
deleted file mode 100644
index 267000c8954..00000000000
--- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/tithefarm/models/TitheFarmPlant.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2023, Mocrosoft
- * 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.microbot.tithefarm.models;
-
-import lombok.Getter;
-import lombok.Setter;
-import net.runelite.api.GameObject;
-import net.runelite.api.GroundObject;
-import net.runelite.api.ObjectID;
-import net.runelite.api.TileObject;
-import net.runelite.client.plugins.microbot.Microbot;
-import net.runelite.client.plugins.microbot.tithefarm.TitheFarmingScript;
-import net.runelite.client.plugins.microbot.tithefarm.enums.TitheFarmMaterial;
-import net.runelite.client.plugins.microbot.tithefarm.enums.TitheFarmState;
-import net.runelite.client.plugins.microbot.util.gameobject.Rs2GameObject;
-import net.runelite.client.plugins.tithefarm.TitheFarmPlantState;
-
-import java.time.Duration;
-import java.time.Instant;
-import java.util.Arrays;
-import java.util.Objects;
-
-import static net.runelite.api.ObjectID.BOLOGANO_SEEDLING;
-import static net.runelite.api.coords.WorldPoint.fromRegion;
-
-public class TitheFarmPlant {
- private static final Duration PLANT_TIME = Duration.ofMinutes(1);
-
- @Getter
- @Setter
- private int index;
-
- @Getter
- @Setter
- private Instant planted;
-
- @Getter
- private final TitheFarmPlantState state;
-
- @Getter
- @Setter
- private TileObject gameObject;
-
- public int regionX;
- public int regionY;
-
- public TitheFarmPlant(int regionX, int regionY, int index) {
- this.planted = Instant.now();
- this.state = TitheFarmPlantState.UNWATERED;
- this.gameObject = Rs2GameObject.findGameObjectByLocation(fromRegion(Microbot.getClient().getLocalPlayer().getWorldLocation().getRegionID(), regionX, regionY, 0));
- this.regionX = regionX;
- this.regionY = regionY;
- this.index = index;
- }
-
- public int[] expectedPatchGameObject() {
- if (Objects.requireNonNull(TitheFarmingScript.state) == TitheFarmState.PLANTING_SEEDS) {
- return new int[]{ObjectID.TITHE_PATCH, BOLOGANO_SEEDLING, ObjectID.LOGAVANO_SEEDLING, ObjectID.GOLOVANOVA_SEEDLING};
- }
- return new int[]{};
- }
-
- public int[] expectedWateredObject() {
- switch (TitheFarmingScript.state) {
- case PLANTING_SEEDS:
- if (TitheFarmMaterial.getSeedForLevel() == TitheFarmMaterial.BOLOGANO_SEED) {
- return new int[]{BOLOGANO_SEEDLING, ObjectID.BOLOGANO_PLANT, ObjectID.BOLOGANO_PLANT_27401};
- } else if (TitheFarmMaterial.getSeedForLevel() == TitheFarmMaterial.LOGAVANO_SEED) {
- return new int[]{ObjectID.LOGAVANO_SEEDLING, ObjectID.LOGAVANO_PLANT, ObjectID.LOGAVANO_PLANT_27412};
- } else if (TitheFarmMaterial.getSeedForLevel() == TitheFarmMaterial.GOLOVANOVA_SEED) {
- return new int[]{ObjectID.GOLOVANOVA_SEEDLING, ObjectID.GOLOVANOVA_PLANT, ObjectID.GOLOVANOVA_PLANT_27390};
- }
- case HARVEST:
- //does not apply
- break;
- }
- return new int[]{};
- }
-
- public int expectedHarvestObject() {
- if (TitheFarmMaterial.getSeedForLevel() == TitheFarmMaterial.BOLOGANO_SEED) {
- return ObjectID.BOLOGANO_PLANT_27404;
- } else if (TitheFarmMaterial.getSeedForLevel() == TitheFarmMaterial.LOGAVANO_SEED) {
- return ObjectID.LOGAVANO_PLANT_27415;
- } else if (TitheFarmMaterial.getSeedForLevel() == TitheFarmMaterial.GOLOVANOVA_SEED) {
- return ObjectID.GOLOVANOVA_PLANT_27393;
- }
- return -1;
- }
-
- public boolean isEmptyPatch() {
- return gameObject.getId() == ObjectID.TITHE_PATCH;
- }
-
- public boolean isEmptyPatchOrSeedling() {
- return Arrays.stream(expectedPatchGameObject()).anyMatch(id -> id == gameObject.getId());
- }
-
- public boolean isValidToWater() {
- return Arrays.stream(expectedWateredObject()).anyMatch(id -> id == gameObject.getId()) || isStage1() || isStage2();
- }
-
- public boolean isValidToHarvest() {
- return gameObject.getId() == expectedHarvestObject();
- }
-
- public boolean isStage1() {
- return getGameObject().getId() == ObjectID.LOGAVANO_PLANT
- || getGameObject().getId() == ObjectID.GOLOVANOVA_PLANT
- || getGameObject().getId() == ObjectID.BOLOGANO_PLANT;
- }
-
- public boolean isStage2() {
- return getGameObject().getId() == ObjectID.LOGAVANO_PLANT_27412
- || getGameObject().getId() == ObjectID.BOLOGANO_PLANT_27401
- || getGameObject().getId() == ObjectID.GOLOVANOVA_PLANT_27390;
- }
-
- public double getPlantTimeRelative() {
- Duration duration = Duration.between(planted, Instant.now());
- return duration.compareTo(PLANT_TIME) < 0 ? (double) duration.toMillis() / PLANT_TIME.toMillis() : 2;
- }
-}
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/bank/Rs2Bank.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/bank/Rs2Bank.java
index 6ad905b773b..d6482ceaf06 100644
--- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/bank/Rs2Bank.java
+++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/bank/Rs2Bank.java
@@ -74,10 +74,6 @@ public class Rs2Bank {
public static final int BANK_ITEM_HEIGHT = 32;
public static final int BANK_ITEM_Y_PADDING = 4;
public static final int BANK_ITEMS_PER_ROW = 8;
- private static final int X_AMOUNT_VARBIT = VarbitID.BANK_REQUESTEDQUANTITY;
- private static final int SELECTED_OPTION_VARBIT = VarbitID.BANK_QUANTITY_TYPE;
-
- private static final int WITHDRAW_AS_NOTE_VARBIT = 3958;
// Bank data caching system
private static final String CONFIG_GROUP = "microbot";
@@ -517,36 +513,22 @@ private static boolean handleAmount(Rs2ItemModel rs2Item, int amount, boolean sa
boolean hasX = configuredX > 0;
boolean isInventory = (container == BANK_INVENTORY_ITEM_CONTAINER);
int xSetOffset = -1;
- int xPromptOffset = -1;
+ int xPromptOffset = isInventory ? 7 : 6;
+
if (hasX) {
switch (selected) {
case 0:
case 1:
case 2:
- xSetOffset = isInventory ? 6 : 4;
- xPromptOffset = isInventory ? 7 : 5;
+ case 4:
+ xSetOffset = isInventory ? 6 : 5;
break;
case 3:
- xSetOffset = isInventory ? 2 : 1;
- xPromptOffset = isInventory ? 7 : 5;
- break;
- case 4:
- xSetOffset = isInventory ? 6 : 5;
- xPromptOffset = isInventory ? 7 : 6;
+ xSetOffset = isInventory ? 2 : 1;
break;
default:
throw new IllegalStateException("Unknown BANK_QUANTITY_TYPE: " + selected);
}
- } else {
- switch (selected) {
- case 0:
- case 1:
- case 2:
- xPromptOffset = isInventory ? 7 : 4;
- break;
- default:
- xPromptOffset = isInventory ? 7 : 5;
- }
}
if (hasX && configuredX == amount) {
@@ -1022,7 +1004,7 @@ private static boolean withdrawAll(Rs2ItemModel rs2Item) {
if (Microbot.getVarbitValue(VarbitID.BANK_QUANTITY_TYPE) == 4) {
invokeMenu(1, rs2Item);
} else {
- invokeMenu(6, rs2Item);
+ invokeMenu(7, rs2Item);
}
return true;
}
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/gameobject/Rs2BankID.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/gameobject/Rs2BankID.java
index 01c5d8311e5..9b025bb9ed7 100644
--- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/gameobject/Rs2BankID.java
+++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/gameobject/Rs2BankID.java
@@ -9,9 +9,9 @@ public class Rs2BankID {
4125, 4126, 4127, 4128, 4129, 4130, 4131, 4167, 4168, 4170, 4252, 4253, 4483, 5108, 5109, 5162, 5163,
6081, 6082, 6083, 6084, 6420, 6448, 6646, 6647, 6910, 7192, 7350, 7351, 8139, 8140, 8141, 8142,
8797, 8798, 8800, 9753, 9754, 9755, 9756, 9757, 9758, 9759, 9760, 9761, 9762, 10083, 10355, 10357,
- 10517, 10518, 10527, 10528, 10529, 10530, 10562, 10583, 10584, 10586, 10607, 10608, 10609, 10610, 10611, 10612, 10613,
- 10614, 10615, 10616, 10617, 10618, 10619, 10620, 10621, 10622, 10623, 10624, 10625, 10661, 10768, 11231, 11232, 11323, 11338,
- 11339, 11341, 11735, 11736, 11737, 11738, 11739, 11740, 11741, 11742, 12120, 12121, 12308, 12309, 12451, 12452, 12735, 12736,
+ 10517, 10518, 10527, 10528, 10529, 10530, 10562, 10583, 10584, 10586, 10607, 10608, 10609, 10610, 10611, 10612, 10613, 10614,
+ 10615, 10616, 10617, 10618, 10619, 10620, 10621, 10622, 10623, 10624, 10625, 10661, 10768, 11231, 11232, 11323, 11338, 11339,
+ 11341, 11735, 11736, 11737, 11738, 11739, 11740, 11741, 11742, 12120, 12121, 12308, 12309, 12451, 12452, 12735, 12736, 12759,
12768, 12769, 12798, 12799, 12800, 12801, 13003, 13004, 13285, 13286, 13287, 13288, 13289, 13290, 13291, 13292, 13384, 13385,
13386, 13387, 13388, 13389, 14196, 14197, 14367, 14368, 14382, 14773, 14774, 14854, 14886, 14986, 14988, 15343, 15677, 15722,
15723, 15724, 15725, 15726, 16116, 16117, 16118, 16119, 16187, 16189, 16642, 16643, 16695, 16696, 16697, 16700, 16887, 16888,
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/slayer/Rs2Slayer.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/slayer/Rs2Slayer.java
index 693caaf6ad1..4002a4d536e 100644
--- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/slayer/Rs2Slayer.java
+++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/slayer/Rs2Slayer.java
@@ -65,7 +65,7 @@ public static String getSlayerTask() {
if (taskId == 0) {
return null;
}
- return Microbot.getEnum(EnumID.SLAYER_TASK_CREATURE)
+ return Microbot.getEnum(693)
.getStringValue(taskId);
}
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/zerozero/bluedragons/BlueDragonsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/zerozero/bluedragons/BlueDragonsPlugin.java
index a84beda4a73..85fd6ad0367 100644
--- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/zerozero/bluedragons/BlueDragonsPlugin.java
+++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/zerozero/bluedragons/BlueDragonsPlugin.java
@@ -7,6 +7,8 @@
import net.runelite.client.events.ConfigChanged;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
+import net.runelite.client.plugins.microbot.util.antiban.Rs2Antiban;
+import net.runelite.client.plugins.microbot.util.antiban.enums.Activity;
import net.runelite.client.ui.overlay.OverlayManager;
import javax.inject.Inject;
@@ -42,6 +44,14 @@ protected void startUp() {
overlay.setConfig(config);
overlayManager.add(overlay);
+
+ Rs2Antiban.activateAntiban();
+
+ Rs2Antiban.resetAntibanSettings();
+
+ Rs2Antiban.antibanSetupTemplates.applyCombatSetup();
+
+ Rs2Antiban.setActivity(Activity.KILLING_BLUE_DRAGONS);
if (config.startPlugin()) {
script.run(config);
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/zerozero/bluedragons/BlueDragonsScript.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/zerozero/bluedragons/BlueDragonsScript.java
index e79c5cff808..7fbb7840457 100644
--- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/zerozero/bluedragons/BlueDragonsScript.java
+++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/zerozero/bluedragons/BlueDragonsScript.java
@@ -396,11 +396,11 @@ private void handleLooting(BlueDragonsConfig config) {
if (!isInventoryFull()) {
lootedAnything |= lootItem("Scaly blue dragonhide");
}
+
if (config.lootMiscItems() && !isInventoryFull()) {
Rs2GroundItem.lootItemBasedOnValue(new LootingParameters(config.lootValueThreshold(), 100000, 8, 1, 1, false, true));
}
-
if (config.lootDragonhide() && !isInventoryFull()) {
lootedAnything |= lootItem("Blue dragonhide");
}
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/slayer/SlayerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/slayer/SlayerPlugin.java
index ec143b46461..28da6add0c6 100644
--- a/runelite-client/src/main/java/net/runelite/client/plugins/slayer/SlayerPlugin.java
+++ b/runelite-client/src/main/java/net/runelite/client/plugins/slayer/SlayerPlugin.java
@@ -50,14 +50,11 @@
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.ChatMessageType;
import net.runelite.api.Client;
-import net.runelite.api.EnumComposition;
-import net.runelite.api.EnumID;
import net.runelite.api.GameState;
import net.runelite.api.MenuAction;
import net.runelite.api.MessageNode;
import net.runelite.api.NPC;
import net.runelite.api.NPCComposition;
-import net.runelite.api.ParamID;
import net.runelite.api.events.ChatMessage;
import net.runelite.api.events.CommandExecuted;
import net.runelite.api.events.GameStateChanged;
@@ -66,6 +63,7 @@
import net.runelite.api.events.NpcDespawned;
import net.runelite.api.events.NpcSpawned;
import net.runelite.api.events.VarbitChanged;
+import net.runelite.api.gameval.DBTableID;
import net.runelite.api.gameval.ItemID;
import net.runelite.api.gameval.VarPlayerID;
import net.runelite.api.gameval.VarbitID;
@@ -91,7 +89,6 @@
import net.runelite.client.util.ColorUtil;
import net.runelite.client.util.Text;
import org.apache.commons.lang3.ArrayUtils;
-import org.apache.commons.lang3.StringUtils;
@PluginDescriptor(
name = "Slayer",
@@ -231,8 +228,10 @@ protected void startUp()
}
// !task requires off-thread access to slayer task locations
- EnumComposition e = client.getEnum(EnumID.SLAYER_TASK_LOCATION);
- taskLocations = e.getStringVals().clone();
+ taskLocations = client.getDBTableRows(DBTableID.SlayerArea.ID)
+ .stream()
+ .map(row -> (String) client.getDBTableField(row, DBTableID.SlayerArea.COL_AREA_NAME_IN_HELPER, 0)[0])
+ .toArray(String[]::new);
return true;
});
}
@@ -362,26 +361,45 @@ private void updateTask()
if (amount > 0)
{
int taskId = client.getVarpValue(VarPlayerID.SLAYER_TARGET);
- String taskName;
+
+ int taskDBRow;
if (taskId == 98 /* Bosses, from [proc,helper_slayer_current_assignment] */)
{
- int structId = client.getEnum(EnumID.SLAYER_TASK)
- .getIntValue(client.getVarbitValue(VarbitID.SLAYER_TARGET_BOSSID));
- taskName = client.getStructComposition(structId)
- .getStringValue(ParamID.SLAYER_TASK_NAME);
+ var bossRows = client.getDBRowsByValue(
+ DBTableID.SlayerTaskSublist.ID,
+ DBTableID.SlayerTaskSublist.COL_SUBTABLE_ID,
+ 0,
+ taskId);
+
+ if (bossRows.isEmpty())
+ {
+ return;
+ }
+ taskDBRow = (Integer) client.getDBTableField(bossRows.get(0), DBTableID.SlayerTaskSublist.COL_TASK, 0)[0];
}
else
{
- taskName = client.getEnum(EnumID.SLAYER_TASK_CREATURE)
- .getStringValue(taskId);
+ var taskRows = client.getDBRowsByValue(DBTableID.SlayerTask.ID, DBTableID.SlayerTask.COL_ID, 0, taskId);
+ if (taskRows.isEmpty())
+ {
+ return;
+ }
+ taskDBRow = taskRows.get(0);
}
+ var taskName = (String) client.getDBTableField(taskDBRow, DBTableID.SlayerTask.COL_NAME_UPPERCASE, 0)[0];
+
int areaId = client.getVarpValue(VarPlayerID.SLAYER_AREA);
String taskLocation = null;
if (areaId > 0)
{
- taskLocation = StringUtils.capitalize(client.getEnum(EnumID.SLAYER_TASK_LOCATION)
- .getStringValue(areaId));
+ var areaRows = client.getDBRowsByValue(DBTableID.SlayerArea.ID, DBTableID.SlayerArea.COL_AREA_ID, 0, areaId);
+ if (areaRows.isEmpty())
+ {
+ return;
+ }
+
+ taskLocation = (String) client.getDBTableField(areaRows.get(0), DBTableID.SlayerArea.COL_AREA_NAME_IN_HELPER, 0)[0];
}
int initialAmount = client.getVarpValue(VarPlayerID.SLAYER_COUNT_ORIGINAL);
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/DungeonLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/DungeonLocation.java
index d53a87e941b..cdf20c886d0 100644
--- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/DungeonLocation.java
+++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/DungeonLocation.java
@@ -237,7 +237,7 @@ enum DungeonLocation
UNDERGROUND_PASS_KANDARIN("Underground Pass", new WorldPoint(2312, 3215, 0)),
UNDERGROUND_PASS_TIRANNWN("Underground Pass", new WorldPoint(2433, 3315, 0)),
UNDERGROUND_PASS_TIRANNWN_PRIF("Underground Pass", new WorldPoint(3336, 5967, 0)),
- UNDERWATER("Underwater", new WorldPoint(3765, 3898, 0)),
+ UNDERWATER("Underwater", new WorldPoint(3760, 3899, 0)),
UZER("Ruins of Uzer basement", new WorldPoint(3492, 3090, 0)),
VARLAMORE_WOLF_DEN("Wolf Den", new WorldPoint(1496, 3132, 0)),
VARROCK_SEWERS("Varrock Sewers", new WorldPoint(3236, 3458, 0)),
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TransportationPointLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TransportationPointLocation.java
index e7aa3535e4a..153d96b6fce 100644
--- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TransportationPointLocation.java
+++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TransportationPointLocation.java
@@ -89,7 +89,7 @@ enum TransportationPointLocation
ROW_BOAT_CRABCLAW("Rowboat to Hosidius", new WorldPoint(1780, 3417, 0), new WorldPoint(1779, 3457, 0)),
ROW_BOAT_CUSTODIA_SOUTH("Rowboat to North Custodia Pass", new WorldPoint(1281, 3386, 0)),
ROW_BOAT_CUSTODIA_WEST("Rowboat to South Custodia Pass", new WorldPoint(1256, 3395, 0)),
- ROW_BOAT_DIVING_ISLAND("Rowboat to Barge/Camp/North of Island", new WorldPoint(3764, 3901, 0)),
+ ROW_BOAT_DIVING_ISLAND("Rowboat to Barge/Camp/North of Island", new WorldPoint(3759, 3902, 0)),
ROW_BOAT_FISHING_GUILD("Rowboat to Hemenster", new WorldPoint(2598, 3426, 0), new WorldPoint(2613, 3439, 0)),
ROW_BOAT_GNOME_STRONGHOLD("Rowboat to Fishing Colony", new WorldPoint(2368, 3487, 0), new WorldPoint(2356, 3641, 0)),
ROW_BOAT_FISHING_COLONY("Rowboat to Gnome Stronghold", new WorldPoint(2356, 3641, 0), new WorldPoint(2368, 3487, 0)),
diff --git a/runelite-client/src/main/resources/item_variations.json b/runelite-client/src/main/resources/item_variations.json
index b461ac421f1..ac9f15261f1 100644
--- a/runelite-client/src/main/resources/item_variations.json
+++ b/runelite-client/src/main/resources/item_variations.json
@@ -4833,8 +4833,7 @@
],
"agility jump": [
6514,
- 6518,
- 11793
+ 6518
],
"agility balance": [
6515,
@@ -11657,7 +11656,8 @@
],
"venator bow": [
27610,
- 27612
+ 27612,
+ 31133
],
"ancient sceptre": [
27624,
@@ -11954,6 +11954,10 @@
28676,
28677
],
+ "dinhs blazing bulwark": [
+ 28682,
+ 31132
+ ],
"blazing blowpipe": [
28687,
28688
@@ -12678,5 +12682,9 @@
"eye of ayak": [
31113,
31115
+ ],
+ "agility swing": [
+ 31134,
+ 31135
]
}
\ No newline at end of file
diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/slayer/SlayerPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/slayer/SlayerPluginTest.java
index c052df05538..1c0932d9348 100644
--- a/runelite-client/src/test/java/net/runelite/client/plugins/slayer/SlayerPluginTest.java
+++ b/runelite-client/src/test/java/net/runelite/client/plugins/slayer/SlayerPluginTest.java
@@ -28,6 +28,7 @@
import com.google.inject.testing.fieldbinder.Bind;
import com.google.inject.testing.fieldbinder.BoundFieldModule;
import java.io.IOException;
+import java.util.List;
import java.util.concurrent.ScheduledExecutorService;
import java.util.function.BooleanSupplier;
import javax.inject.Inject;
@@ -35,8 +36,6 @@
import net.runelite.api.ChatMessageType;
import static net.runelite.api.ChatMessageType.GAMEMESSAGE;
import net.runelite.api.Client;
-import net.runelite.api.EnumComposition;
-import net.runelite.api.EnumID;
import net.runelite.api.GameState;
import net.runelite.api.MessageNode;
import net.runelite.api.NPC;
@@ -45,6 +44,7 @@
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.events.GameTick;
import net.runelite.api.events.VarbitChanged;
+import net.runelite.api.gameval.DBTableID;
import net.runelite.api.gameval.VarPlayerID;
import net.runelite.client.Notifier;
import net.runelite.client.callback.ClientThread;
@@ -66,6 +66,7 @@
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
import org.mockito.Mock;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.lenient;
@@ -163,9 +164,8 @@ public void before()
return b.getAsBoolean();
}).when(clientThread).invoke(any(BooleanSupplier.class));
- EnumComposition e = mock(EnumComposition.class);
- when(e.getStringVals()).thenReturn(new String[]{"The Abyss"});
- when(client.getEnum(EnumID.SLAYER_TASK_LOCATION)).thenReturn(e);
+ when(client.getDBTableRows(DBTableID.SlayerArea.ID)).thenReturn(List.of(1234));
+ when(client.getDBTableField(1234, DBTableID.SlayerArea.COL_AREA_NAME_IN_HELPER, 0)).thenReturn(new String[]{"The Abyss"});
slayerPlugin.startUp();
}
@@ -248,13 +248,7 @@ public void infoboxNotAddedOnLogin()
when(client.getVarpValue(VarPlayerID.SLAYER_COUNT)).thenReturn(42);
when(client.getVarpValue(VarPlayerID.SLAYER_TARGET)).thenReturn(1);
- when(client.getEnum(EnumID.SLAYER_TASK_CREATURE))
- .thenAnswer(a ->
- {
- EnumComposition e = mock(EnumComposition.class);
- when(e.getStringValue(anyInt())).thenReturn("mocked npc");
- return e;
- });
+ mockDBTable(113, 0, 10, "mocked npc");
VarbitChanged varbitChanged = new VarbitChanged();
varbitChanged.setVarpId(VarPlayerID.SLAYER_COUNT);
@@ -309,13 +303,7 @@ public void testDisconnect()
{
when(client.getVarpValue(VarPlayerID.SLAYER_COUNT)).thenReturn(42);
when(client.getVarpValue(VarPlayerID.SLAYER_TARGET)).thenReturn(1);
- when(client.getEnum(EnumID.SLAYER_TASK_CREATURE))
- .thenAnswer(a ->
- {
- EnumComposition e = mock(EnumComposition.class);
- when(e.getStringValue(anyInt())).thenReturn("mocked npc");
- return e;
- });
+ mockDBTable(113, 0, 10, "mocked npc");
slayerPlugin.setTaskName("mocked npc");
slayerPlugin.setAmount(42);
@@ -363,4 +351,12 @@ public void testDisconnect()
assertEquals(42, slayerPlugin.getAmount());
assertEquals(99, slayerPlugin.getInitialAmount());
}
+
+ void mockDBTable(int table, int keycol, int valcol, String str)
+ {
+ int mockRow = (table << 8) | keycol;
+ when(client.getDBRowsByValue(eq(table), eq(keycol), eq(0), anyInt()))
+ .thenReturn(List.of(mockRow));
+ when(client.getDBTableField(mockRow, valcol, 0)).thenReturn(new String[]{str});
+ }
}
diff --git a/runelite-jshell/pom.xml b/runelite-jshell/pom.xml
index 253a8632285..63bfad3709b 100644
--- a/runelite-jshell/pom.xml
+++ b/runelite-jshell/pom.xml
@@ -30,7 +30,7 @@
net.runelite
runelite-parent
- 1.11.14-SNAPSHOT
+ 1.11.15-SNAPSHOT
jshell
diff --git a/runelite-maven-plugin/pom.xml b/runelite-maven-plugin/pom.xml
index a5a281ce06c..7efe5997f34 100644
--- a/runelite-maven-plugin/pom.xml
+++ b/runelite-maven-plugin/pom.xml
@@ -29,7 +29,7 @@
net.runelite
runelite-parent
- 1.11.14-SNAPSHOT
+ 1.11.15-SNAPSHOT
runelite-maven-plugin