Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down