-
-
Notifications
You must be signed in to change notification settings - Fork 497
Add fortis gem stall #1472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add fortis gem stall #1472
Changes from all commits
e75d1a7
5b4e818
9b1bf1c
c3d1adf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -15,6 +15,8 @@ public enum Jewelry { | |||||||||
| GOLD_NECKLACE("gold necklace", ItemID.GOLD_NECKLACE, Gem.NONE, ItemID.NECKLACE_MOULD, JewelryType.GOLD, null, 6), | ||||||||||
| GOLD_BRACELET("gold bracelet", ItemID.GOLD_BRACELET, Gem.NONE, ItemID.BRACELET_MOULD, JewelryType.GOLD, null, 7), | ||||||||||
| GOLD_AMULET("gold amulet", ItemID.GOLD_AMULET_U, Gem.NONE, ItemID.AMULET_MOULD, JewelryType.GOLD, null, 8), | ||||||||||
| TIARA("tiara", ItemID.TIARA, Gem.NONE, ItemID.TIARA_MOULD, JewelryType.SILVER, null, 23), | ||||||||||
| UNSTRUNG_SYMBOL("holy symbol", ItemID.UNSTRUNG_SYMBOL, Gem.NONE, ItemID.HOLY_MOULD, JewelryType.SILVER, null, 16), | ||||||||||
|
Comment on lines
+18
to
+19
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Widget label mismatch: use “unstrung symbol” for crafting UI. The furnace widget lists “Unstrung symbol”. Using “holy symbol” will likely fail Apply: - UNSTRUNG_SYMBOL("holy symbol", ItemID.UNSTRUNG_SYMBOL, Gem.NONE, ItemID.HOLY_MOULD, JewelryType.SILVER, null, 16),
+ UNSTRUNG_SYMBOL("unstrung symbol", ItemID.UNSTRUNG_SYMBOL, Gem.NONE, ItemID.HOLY_MOULD, JewelryType.SILVER, null, 16),📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| OPAL_RING("opal ring", ItemID.OPAL_RING, Gem.OPAL, ItemID.RING_MOULD, JewelryType.SILVER, EnchantSpell.LEVEL_1, 1), | ||||||||||
| OPAL_NECKLACE("opal necklace", ItemID.OPAL_NECKLACE, Gem.OPAL, ItemID.NECKLACE_MOULD, JewelryType.SILVER, EnchantSpell.LEVEL_1, 16), | ||||||||||
| OPAL_BRACELET("opal bracelet", ItemID.OPAL_BRACELET, Gem.OPAL, ItemID.BRACELET_MOULD, JewelryType.SILVER, EnchantSpell.LEVEL_1, 22), | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -60,16 +60,19 @@ AIOMagicConfig provideConfig(ConfigManager configManager) { | |||||||||||||
| private SuperHeatScript superHeatScript; | ||||||||||||||
|
|
||||||||||||||
| @Inject | ||||||||||||||
| private TeleportScript teleportScript; | ||||||||||||||
| private TeleportScript teleportScript; | ||||||||||||||
|
|
||||||||||||||
| @Inject | ||||||||||||||
| private TeleAlchScript teleAlchScript; | ||||||||||||||
| private TeleAlchScript teleAlchScript; | ||||||||||||||
|
|
||||||||||||||
| @Inject | ||||||||||||||
| private StunAlchScript stunAlchScript; | ||||||||||||||
| private StunAlchScript stunAlchScript; | ||||||||||||||
|
|
||||||||||||||
| @Inject | ||||||||||||||
| private StunTeleAlchScript stunTeleAlchScript; // NEW | ||||||||||||||
| private StunTeleAlchScript stunTeleAlchScript; // NEW | ||||||||||||||
|
|
||||||||||||||
| @Inject | ||||||||||||||
| private SpinFlaxScript spinFlaxScript; | ||||||||||||||
|
|
||||||||||||||
| public static String version = "1.2.0"; // bumped | ||||||||||||||
|
|
||||||||||||||
|
|
@@ -108,41 +111,45 @@ protected void startUp() throws AWTException { | |||||||||||||
| overlayManager.add(aioMagicOverlay); | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| switch (config.magicActivity()) { | ||||||||||||||
| case SPLASHING: | ||||||||||||||
| splashScript.run(); | ||||||||||||||
| break; | ||||||||||||||
| case ALCHING: | ||||||||||||||
| alchScript.run(); | ||||||||||||||
| break; | ||||||||||||||
| case SUPERHEAT: | ||||||||||||||
| superHeatScript.run(); | ||||||||||||||
| break; | ||||||||||||||
| case TELEPORT: | ||||||||||||||
| teleportScript.run(); | ||||||||||||||
| break; | ||||||||||||||
| case TELEALCH: | ||||||||||||||
| teleAlchScript.run(); | ||||||||||||||
| break; | ||||||||||||||
| case STUNALCH: | ||||||||||||||
| stunAlchScript.run(); | ||||||||||||||
| break; | ||||||||||||||
| case STUNTELEALCH: // NEW | ||||||||||||||
| stunTeleAlchScript.run(); | ||||||||||||||
| break; | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| protected void shutDown() { | ||||||||||||||
| splashScript.shutdown(); | ||||||||||||||
| alchScript.shutdown(); | ||||||||||||||
| superHeatScript.shutdown(); | ||||||||||||||
| teleportScript.shutdown(); | ||||||||||||||
| teleAlchScript.shutdown(); | ||||||||||||||
| stunAlchScript.shutdown(); | ||||||||||||||
| if (stunTeleAlchScript != null) stunTeleAlchScript.shutdown(); // NEW | ||||||||||||||
| overlayManager.remove(aioMagicOverlay); | ||||||||||||||
| } | ||||||||||||||
| switch (config.magicActivity()) { | ||||||||||||||
| case SPLASHING: | ||||||||||||||
| splashScript.run(); | ||||||||||||||
| break; | ||||||||||||||
| case ALCHING: | ||||||||||||||
| alchScript.run(); | ||||||||||||||
| break; | ||||||||||||||
| case SUPERHEAT: | ||||||||||||||
| superHeatScript.run(); | ||||||||||||||
| break; | ||||||||||||||
| case TELEPORT: | ||||||||||||||
| teleportScript.run(); | ||||||||||||||
| break; | ||||||||||||||
| case TELEALCH: | ||||||||||||||
| teleAlchScript.run(); | ||||||||||||||
| break; | ||||||||||||||
| case STUNALCH: | ||||||||||||||
| stunAlchScript.run(); | ||||||||||||||
| break; | ||||||||||||||
| case STUNTELEALCH: // NEW | ||||||||||||||
| stunTeleAlchScript.run(); | ||||||||||||||
| break; | ||||||||||||||
| case SPINFLAX: | ||||||||||||||
| spinFlaxScript.run(); | ||||||||||||||
| break; | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| protected void shutDown() { | ||||||||||||||
| splashScript.shutdown(); | ||||||||||||||
| alchScript.shutdown(); | ||||||||||||||
| superHeatScript.shutdown(); | ||||||||||||||
| teleportScript.shutdown(); | ||||||||||||||
| teleAlchScript.shutdown(); | ||||||||||||||
| stunAlchScript.shutdown(); | ||||||||||||||
| if (stunTeleAlchScript != null) stunTeleAlchScript.shutdown(); // NEW | ||||||||||||||
| if (spinFlaxScript != null) spinFlaxScript.shutdown(); | ||||||||||||||
| overlayManager.remove(aioMagicOverlay); | ||||||||||||||
| } | ||||||||||||||
|
Comment on lines
+151
to
+152
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid NPE on shutdown when OverlayManager is null Null-check before removal to prevent a shutdown crash. Apply this diff: - overlayManager.remove(aioMagicOverlay);
+ if (overlayManager != null) {
+ overlayManager.remove(aioMagicOverlay);
+ }📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
|
|
||||||||||||||
| @Subscribe | ||||||||||||||
| public void onConfigChanged(ConfigChanged event) { | ||||||||||||||
|
|
||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,4 +8,5 @@ public enum MagicActivity { | |
| TELEALCH, | ||
| STUNALCH, | ||
| STUNTELEALCH, // NEW | ||
| SPINFLAX, | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,142 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||
| package net.runelite.client.plugins.microbot.magic.aiomagic.scripts; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| import net.runelite.api.Skill; | ||||||||||||||||||||||||||||||||||||||||||||||||
| import net.runelite.api.gameval.ItemID; | ||||||||||||||||||||||||||||||||||||||||||||||||
| import net.runelite.client.plugins.microbot.Microbot; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+5
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix incorrect ItemID import (compile error) The package should be net.runelite.api.ItemID. -import net.runelite.api.gameval.ItemID;
+import net.runelite.api.ItemID;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||
| import net.runelite.client.plugins.microbot.Script; | ||||||||||||||||||||||||||||||||||||||||||||||||
| import net.runelite.client.plugins.microbot.magic.aiomagic.AIOMagicPlugin; | ||||||||||||||||||||||||||||||||||||||||||||||||
| import net.runelite.client.plugins.microbot.magic.aiomagic.enums.MagicState; | ||||||||||||||||||||||||||||||||||||||||||||||||
| 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.bank.Rs2Bank; | ||||||||||||||||||||||||||||||||||||||||||||||||
| import net.runelite.client.plugins.microbot.util.inventory.Rs2Inventory; | ||||||||||||||||||||||||||||||||||||||||||||||||
| import net.runelite.client.plugins.microbot.util.magic.Rs2Magic; | ||||||||||||||||||||||||||||||||||||||||||||||||
| import net.runelite.client.plugins.microbot.util.magic.Rs2Spells; | ||||||||||||||||||||||||||||||||||||||||||||||||
| import net.runelite.client.plugins.microbot.util.magic.Runes; | ||||||||||||||||||||||||||||||||||||||||||||||||
| import net.runelite.client.plugins.microbot.util.player.Rs2Player; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| import javax.inject.Inject; | ||||||||||||||||||||||||||||||||||||||||||||||||
| import java.util.concurrent.TimeUnit; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| public class SpinFlaxScript extends Script { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| private MagicState state; | ||||||||||||||||||||||||||||||||||||||||||||||||
| private int castsDone; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| private final AIOMagicPlugin plugin; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| @Inject | ||||||||||||||||||||||||||||||||||||||||||||||||
| public SpinFlaxScript(AIOMagicPlugin plugin) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| this.plugin = plugin; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| public boolean run() { | ||||||||||||||||||||||||||||||||||||||||||||||||
| Microbot.enableAutoRunOn = false; | ||||||||||||||||||||||||||||||||||||||||||||||||
| Rs2Antiban.resetAntibanSettings(); | ||||||||||||||||||||||||||||||||||||||||||||||||
| Rs2Antiban.antibanSetupTemplates.applyGeneralBasicSetup(); | ||||||||||||||||||||||||||||||||||||||||||||||||
| Rs2AntibanSettings.simulateAttentionSpan = true; | ||||||||||||||||||||||||||||||||||||||||||||||||
| Rs2AntibanSettings.nonLinearIntervals = true; | ||||||||||||||||||||||||||||||||||||||||||||||||
| Rs2AntibanSettings.contextualVariability = true; | ||||||||||||||||||||||||||||||||||||||||||||||||
| Rs2AntibanSettings.usePlayStyle = true; | ||||||||||||||||||||||||||||||||||||||||||||||||
| Rs2Antiban.setActivity(Activity.CASTING_SPIN_FLAX); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| mainScheduledFuture = scheduledExecutorService.scheduleWithFixedDelay(() -> { | ||||||||||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||||||||||
| if (!Microbot.isLoggedIn()) return; | ||||||||||||||||||||||||||||||||||||||||||||||||
| if (!super.run()) return; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| if (!Rs2Player.getSkillRequirement(Skill.MAGIC, 76)) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| Microbot.showMessage("Spin Flax requires 76 Magic."); | ||||||||||||||||||||||||||||||||||||||||||||||||
| shutdown(); | ||||||||||||||||||||||||||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| if (state == null) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| state = MagicState.BANKING; | ||||||||||||||||||||||||||||||||||||||||||||||||
| castsDone = 0; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| switch (state) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| case BANKING: | ||||||||||||||||||||||||||||||||||||||||||||||||
| Microbot.status = "Banking: prepare 25 flax"; | ||||||||||||||||||||||||||||||||||||||||||||||||
| boolean isBankOpen = Rs2Bank.isNearBank(15) ? Rs2Bank.useBank() : Rs2Bank.walkToBankAndUseBank(); | ||||||||||||||||||||||||||||||||||||||||||||||||
| if (!isBankOpen || !Rs2Bank.isOpen()) return; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Rs2Bank.depositAll(ItemID.BOW_STRING); | ||||||||||||||||||||||||||||||||||||||||||||||||
| Rs2Inventory.waitForInventoryChanges(1200); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| boolean hasAstralInv = Rs2Inventory.hasItem(Runes.ASTRAL.getItemId()); | ||||||||||||||||||||||||||||||||||||||||||||||||
| boolean hasNatureInv = Rs2Inventory.hasItem(Runes.NATURE.getItemId()); | ||||||||||||||||||||||||||||||||||||||||||||||||
| boolean hasAirInv = Rs2Inventory.hasItem(Runes.AIR.getItemId()); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| boolean hasAstralBank = Rs2Bank.hasItem(Runes.ASTRAL.getItemId()); | ||||||||||||||||||||||||||||||||||||||||||||||||
| boolean hasNatureBank = Rs2Bank.hasItem(Runes.NATURE.getItemId()); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+66
to
+74
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Banking loop can soft-lock when carrying flax If a cast fails and you return to bank with flax in inventory, the empty-slot check will never pass. Deposit flax before the slot check. Rs2Bank.depositAll(ItemID.BOW_STRING);
Rs2Inventory.waitForInventoryChanges(1200);
+ // Ensure we don't get stuck with flax in inventory
+ if (Rs2Inventory.hasItem(ItemID.FLAX)) {
+ Rs2Bank.depositAll(ItemID.FLAX);
+ Rs2Inventory.waitForInventoryChanges(1200);
+ }📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||
| boolean hasAirBank = Rs2Bank.hasItem(Runes.AIR.getItemId()); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| if (!hasAstralBank && !hasAstralInv) { Microbot.showMessage("Astral runes not found in bank."); shutdown(); return; } | ||||||||||||||||||||||||||||||||||||||||||||||||
| if (!hasNatureBank && !hasNatureInv) { Microbot.showMessage("Nature runes not found in bank."); shutdown(); return; } | ||||||||||||||||||||||||||||||||||||||||||||||||
| if (!hasAirBank && !hasAirInv) { Microbot.showMessage("Air runes not found in bank."); shutdown(); return; } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| if (hasAstralBank) { if (!Rs2Bank.withdrawAll(Runes.ASTRAL.getItemId())) return; Rs2Inventory.waitForInventoryChanges(1200); } | ||||||||||||||||||||||||||||||||||||||||||||||||
| if (hasNatureBank) { if (!Rs2Bank.withdrawAll(Runes.NATURE.getItemId())) return; Rs2Inventory.waitForInventoryChanges(1200); } | ||||||||||||||||||||||||||||||||||||||||||||||||
| if (hasAirBank) { if (!Rs2Bank.withdrawAll(Runes.AIR.getItemId())) return; Rs2Inventory.waitForInventoryChanges(1200); } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| if (!Rs2Bank.hasBankItem(ItemID.FLAX, 1)) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| Microbot.showMessage("No flax in bank."); | ||||||||||||||||||||||||||||||||||||||||||||||||
| shutdown(); | ||||||||||||||||||||||||||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| int empty = Rs2Inventory.emptySlotCount(); | ||||||||||||||||||||||||||||||||||||||||||||||||
| if (empty < 25) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| Rs2Bank.depositAll(ItemID.BOW_STRING); | ||||||||||||||||||||||||||||||||||||||||||||||||
| Rs2Inventory.waitForInventoryChanges(1200); | ||||||||||||||||||||||||||||||||||||||||||||||||
| empty = Rs2Inventory.emptySlotCount(); | ||||||||||||||||||||||||||||||||||||||||||||||||
| if (empty < 25) return; // wait next tick | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| if (!Rs2Bank.withdrawX(ItemID.FLAX, 25)) return; | ||||||||||||||||||||||||||||||||||||||||||||||||
| Rs2Inventory.waitForInventoryChanges(1200); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Rs2Bank.closeBank(); | ||||||||||||||||||||||||||||||||||||||||||||||||
| castsDone = 0; | ||||||||||||||||||||||||||||||||||||||||||||||||
| state = MagicState.CASTING; | ||||||||||||||||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| case CASTING: | ||||||||||||||||||||||||||||||||||||||||||||||||
| Microbot.status = "Casting: Spin Flax (" + castsDone + "/5)"; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| if (!Rs2Inventory.hasItem(ItemID.FLAX) || !Rs2Magic.hasRequiredRunes(Rs2Spells.SPIN_FLAX)) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| state = MagicState.BANKING; | ||||||||||||||||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| if (castsDone >= 5) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| state = MagicState.BANKING; | ||||||||||||||||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| if (!Rs2Magic.cast(Rs2Spells.SPIN_FLAX)) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| Microbot.log("Unable to cast Spin Flax"); | ||||||||||||||||||||||||||||||||||||||||||||||||
| state = MagicState.BANKING; | ||||||||||||||||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
| Rs2Player.waitForXpDrop(Skill.MAGIC, 10000, false); | ||||||||||||||||||||||||||||||||||||||||||||||||
| castsDone++; | ||||||||||||||||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| } catch (Exception ex) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| System.out.println(ex.getMessage()); | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
| }, 0, 1000, TimeUnit.MILLISECONDS); | ||||||||||||||||||||||||||||||||||||||||||||||||
| return true; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| @Override | ||||||||||||||||||||||||||||||||||||||||||||||||
| public void shutdown() { | ||||||||||||||||||||||||||||||||||||||||||||||||
| Rs2Antiban.resetAntibanSettings(); | ||||||||||||||||||||||||||||||||||||||||||||||||
| super.shutdown(); | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Guard Humidify cast failures to avoid crashes or stalls.
Two risks:
Wrap the cast with try/catch and add a fallback to drop empties when casting fails.
Apply this diff:
📝 Committable suggestion
🤖 Prompt for AI Agents