execute_code - Cancellation now reaches inside the SDK via an AsyncLocalStorage scope: timeout, MCP cancel, or a newer call rejects pending waits and blocks further action packets, including those inside walkTo(). - One execution per bot: a new call supersedes the running one and starts once it has unwound; disconnect_bot does the same. - Cancelled user code parks on bot/sdk calls instead of throwing, so a catch-all loop can't spin and starve the server. - Console capture is routed per execution, so concurrent bots no longer clobber each other's output; leftover logs go to stderr. - Stale world state warns and still runs, so a stale client can be diagnosed. - Credentials are redacted from logs, results and launch messages. SDK - bot.mineRock() waits for ore plus Mining XP; interactLoc docs note that success can mean the action only started. - walkTo() takes options.timeout (default 120s), refuses stale state, and reports the real last position. - runScript uses the same cancellation scope for timeouts and signals. Docs trimmed of duplicated or stale execute_code text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3.5 KiB
Smithing
Smelting Bronze Bars
Bronze bars require 1 copper ore + 1 tin ore smelted at a furnace.
How to Smelt
Some furnace spots pair the real furnace with an inert, option-less decoy loc
one tile away — a bare name match can pick the decoy and smelt nothing, with no
error. Use {withOption} to get the real one. Using ore on the furnace is the
portable low-level fallback:
const state = sdk.getState();
if (!state) throw new Error("No world state");
const copper = state.inventory.find((i) => /copper ore/i.test(i.name));
const furnace = sdk.findNearbyLoc(/furnace/i, { withOption: /smelt/i });
if (!copper || !furnace)
throw new Error("Copper ore and a usable nearby furnace are required");
await sdk.sendUseItemOnLoc(copper.slot, furnace.x, furnace.z, furnace.id);
await sdk.waitForCondition(
(next) => next.inventory.some((item) => /bronze bar/i.test(item.name)),
10_000,
);
- Use copper on furnace — it auto-consumes 1 tin from inventory
- Low-level calls do not dismiss level-up dialogs; use
bot.dismissBlockingUI()when a modal interrupts a batch - Each bronze bar gives 155 xp (at level 1-14 range, leveled from 1→14 with 10 bars = 1550 xp total, so ~155 xp per smelt)
Furnace Locations
| Location | Coordinates | Furnace IDs | Notes |
|---|---|---|---|
| Lumbridge furnace | (3225, 3256) | 2785, 2781 | Right next to spawn, reliable. 2781 has Smelt; 2785 is a decoy. |
| Al Kharid furnace | (3273, 3184) | 2785, 2781 | Needs 10gp toll gate. 2781 has Smelt; 2785 is a decoy. |
Anvil Locations
| Location | Coordinates | Anvil ID | Notes |
|---|---|---|---|
| Varrock (west) | (3188, 3421) | 2783 | Multiple anvils in smithy, near west bank |
Also anvils at (3188, 3424) and (3188, 3426) — same building, same id 2783.
How to Smith at Anvil
Prefer the high-level helper, which opens the interface and observes Smithing XP:
const result = await bot.smithAtAnvil("dagger", {
barPattern: /bronze bar/i,
timeout: 10_000,
});
if (!result.success) console.warn(result.reason, result.message);
Requires hammer in inventory (buy from Lumbridge General Store for 1gp).
XP Rates
- Smelting bronze bar: ~155 xp per bar (includes level-up bonuses)
- Smithing bronze dagger: ~312 xp per dagger at level 14-26 range
- 10 bars smelted: 1→14 Smithing
- 10 daggers smithed: 14→26 Smithing
Workflow
- Mine equal copper (rock ids 2090/2091) and tin (rock ids 2094/2095) at SE Varrock mine (3285, 3365)
- Walk to Lumbridge furnace (3225, 3256) → smelt into bronze bars
- Walk to Varrock anvil (3188, 3421) → smith into items (requires hammer)
Key Locations for Full Loop
| Step | Location | Coordinates |
|---|---|---|
| Mine | SE Varrock mine | (3285, 3365) |
| Smelt | Lumbridge furnace | (3225, 3256) |
| Smith | Varrock anvil | (3188, 3421) |
| Buy hammer | Lumbridge General Store | (3210, 3244) |
Route: Mine → Furnace → Anvil
This is a long loop. Consider using Varrock West Bank (nearby anvils) to store bars between trips.
Use sdk/API.md for the current smithAtAnvil product and option signature
rather than hard-coded interface component IDs.