diff --git a/src/main/java/net/runelite/client/plugins/microbot/crafting/jewelry/JewelryPlugin.java b/src/main/java/net/runelite/client/plugins/microbot/crafting/jewelry/JewelryPlugin.java index 40772276a7..799761cfa3 100644 --- a/src/main/java/net/runelite/client/plugins/microbot/crafting/jewelry/JewelryPlugin.java +++ b/src/main/java/net/runelite/client/plugins/microbot/crafting/jewelry/JewelryPlugin.java @@ -17,10 +17,14 @@ name = PluginDescriptor.GMason + "Jewelry Crafter", description = "All in one jewelry crafter", tags = {"crafting", "magic", "microbot", "skilling"}, + version = JewelryPlugin.version, enabledByDefault = false ) public class JewelryPlugin extends Plugin { - + + static final String version = "1.0.1"; + + @Inject private JewelryConfig config; @Inject diff --git a/src/main/java/net/runelite/client/plugins/microbot/crafting/jewelry/JewelryScript.java b/src/main/java/net/runelite/client/plugins/microbot/crafting/jewelry/JewelryScript.java index 338402bf14..871681e944 100644 --- a/src/main/java/net/runelite/client/plugins/microbot/crafting/jewelry/JewelryScript.java +++ b/src/main/java/net/runelite/client/plugins/microbot/crafting/jewelry/JewelryScript.java @@ -311,10 +311,16 @@ public boolean run() { case CRAFTING: WorldPoint furnaceLocation = plugin.getCraftingLocation().getFurnaceLocation(); WorldPoint anchor = furnaceLocation != null ? furnaceLocation : Rs2Player.getWorldLocation(); + // Resolve the whole lookup in ONE client-thread invoke. withName()/where() + // call getName()/getObjectComposition(), each of which round-trips through + // ClientThread.invoke per object; over a full scene cache that serially stalls + // this script thread for 2+ minutes. nearestOnClientThread() runs the entire + // query on the client thread, so every getName() resolves in-place — one + // round-trip total. (Same pattern AutoSmeltingScript uses for its furnace.) Rs2TileObjectModel furnaceObject = Microbot.getRs2TileObjectCache().query() .withName("Furnace") .where(o -> Rs2GameObject.hasAction(o, "Smelt")) - .nearest(anchor, 20); + .nearestOnClientThread(anchor, 20); if (furnaceObject == null) { if (furnaceLocation != null) { @@ -329,8 +335,26 @@ public boolean run() { } furnaceObject.click("smelt"); - sleepUntilTrue(() -> Rs2Widget.isGoldCraftingWidgetOpen() || Rs2Widget.isSilverCraftingWidgetOpen(), 500, 20000); - Rs2Widget.clickWidget(plugin.getJewelry().getItemName()); + // Wait for the make interface to open, then click our item. Two fixes here: + // 1) Include isProductionWidgetOpen() (SKILLMULTI, group 270). Tiaras — and + // many items — use that "make" interface, NOT the 446/6 jewellery selectors, + // so the old check never matched and burned the full 20s timeout every craft. + // 2) Scope the click to the open interface's option container (270,13) so it + // targets the make button, not the same item sitting in the inventory. An + // unscoped name search matches the inventory item (visible, same name) and + // "clicks the tiara" without ever crafting. + boolean craftingInterfaceOpen = sleepUntilTrue(() -> + Rs2Widget.isProductionWidgetOpen() + || Rs2Widget.isGoldCraftingWidgetOpen() + || Rs2Widget.isSilverCraftingWidgetOpen(), 300, 20000); + if (!craftingInterfaceOpen) { + return; // still walking to the furnace / interface not up yet — retry next loop + } + if (Rs2Widget.isProductionWidgetOpen()) { + Rs2Widget.clickWidget(plugin.getJewelry().getItemName(), Optional.of(270), 13, false); + } else { + Rs2Widget.clickWidget(plugin.getJewelry().getItemName()); + } Rs2Antiban.actionCooldown(); Rs2Antiban.takeMicroBreakByChance(); break; diff --git a/src/main/java/net/runelite/client/plugins/microbot/crafting/jewelry/enums/Jewelry.java b/src/main/java/net/runelite/client/plugins/microbot/crafting/jewelry/enums/Jewelry.java index ba42e8acc3..0aa083ede8 100644 --- a/src/main/java/net/runelite/client/plugins/microbot/crafting/jewelry/enums/Jewelry.java +++ b/src/main/java/net/runelite/client/plugins/microbot/crafting/jewelry/enums/Jewelry.java @@ -15,7 +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), + GOLD_TIARA("gold tiara", ItemID.GOLD_TIARA, Gem.NONE, ItemID.TIARA_MOULD, JewelryType.GOLD, null, 42), + SILVER_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), 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),