Files
Max BittkerandClaude Opus 5 e5fb1e9d07 Make the agent API self-describing and add regression CI (#43)
* Improve agent API docs and validation

* Drop the wiki search tool

Removes wiki/search.ts and its test. The index only covered names, aliases,
summaries and Sources lines, so it had worse recall than grep on body text
(e.g. "cow hide" missed skills/crafting.md), and normalize() stripped
underscores so map-square queries matched every neighbouring square
(m50_50 returned m50_53 NPCs). The computed mapSquareBounds were only
indexed as text, so coordinate lookups — the one thing grep can't do —
never worked.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Regenerate the wiki from server/content

Adds the coordinate-samples column to NPC location tables and picks up
content drift the checked-in pages had missed (807 NPC, 117 shop, 1573 item
pages; 335 of them new). Examples: Aubury now stocks 1000 chaos/death runes
rather than 500, and shop rows point at "Vial of water"/"Bolts" instead of
the stale "Vial"/"Bolt" names.

Also stops all three generators from crashing on their final step. Each one
read wiki/README.md unconditionally, but that file has never existed, so the
index update threw ENOENT on every run. Skip it when absent.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-07-24 17:52:51 -04:00

4.7 KiB

Walking & Navigation

Successful patterns for movement and pathfinding.

Basic Walking

bot.walkTo() performs pathfinding for both short and long routes:

const result = await bot.walkTo(3222, 3218);  // Walk to Lumbridge
if (!result.success) console.warn(result.reason, result.message);

Long Distance Walking

walkTo() supports long routes. Use waypoints when you intentionally need a safer route, want progress checkpoints, or need to avoid a dangerous area:

const WAYPOINTS_TO_BANK = [
    { x: 3270, z: 3380 },  // Step 1
    { x: 3250, z: 3395 },  // Step 2
    { x: 3230, z: 3410 },  // Step 3
    { x: 3210, z: 3425 },  // Step 4
    { x: 3185, z: 3436 },  // Final destination
];

async function walkWaypoints(waypoints) {
    for (const wp of waypoints) {
        // Try up to 3 times per waypoint
        for (let attempt = 0; attempt < 3; attempt++) {
            await bot.walkTo(wp.x, wp.z);
            await new Promise(r => setTimeout(r, 500));

            const player = sdk.getState()?.player;
            const dist = Math.sqrt(
                Math.pow(player.worldX - wp.x, 2) +
                Math.pow(player.worldZ - wp.z, 2)
            );

            if (dist <= 5) break;  // Close enough
        }
    }
}

Verifying Arrival

Always check if you actually arrived:

const result = await bot.walkTo(targetX, targetZ);

const player = sdk.getState()?.player;
const dist = Math.sqrt(
    Math.pow(player.worldX - targetX, 2) +
    Math.pow(player.worldZ - targetZ, 2)
);

if (dist > 5) {
    console.warn(`Walk failed: still ${dist.toFixed(0)} tiles away`);
}

Known Routes

Varrock Mine to Varrock West Bank (~100 tiles)

const MINE_TO_BANK = [
    { x: 3270, z: 3380 },
    { x: 3250, z: 3395 },
    { x: 3230, z: 3410 },
    { x: 3210, z: 3425 },
    { x: 3185, z: 3436 },
];

const BANK_TO_MINE = [
    { x: 3210, z: 3425 },
    { x: 3230, z: 3410 },
    { x: 3250, z: 3395 },
    { x: 3270, z: 3380 },
    { x: 3285, z: 3365 },
];

Opening Obstacles

bot.walkTo() attempts to open doors and gates on its route. If a route fails, inspect nearby objects and open the specific obstacle before retrying:

let result = await bot.walkTo(3250, 3260);
if (!result.success) {
    const gate = sdk.findNearbyLoc(/^gate$/i);
    if (gate?.optionsWithIndex.some(option => /^open$/i.test(option.text))) {
        await bot.openDoor(gate);
        result = await bot.walkTo(3250, 3260);
    }
}

Cow Field to Draynor Bank

Draynor Bank (3092, 3243) is the closest bank to Lumbridge cow field.

DANGER: Dark Wizards

AVOID the area around (3220, 3220) - aggressive Dark Wizards here will attack and likely kill characters under combat level 20.

Safe Route Strategy

Stay north of z=3240 when walking west from cow field to Draynor. Use walkTo with intermediate points that curve north around the danger zone rather than walking in a straight line.

// Safe: curve north around Dark Wizards
await bot.walkTo(3230, 3270);  // Go west, stay north
await bot.walkTo(3150, 3250);  // Continue west
await bot.walkTo(3092, 3243);  // Draynor Bank

// DANGEROUS: straight line cuts through wizard area!
await bot.walkTo(3092, 3243);  // May path through (3220, 3220)

Key Coordinates

Location Coordinates
Lumbridge spawn (3222, 3218)
Lumbridge cows (field center) (3253, 3290)
Cow field south gate (3253, 3266)
Draynor fishing (3087, 3230)
Varrock West bank (3185, 3436)
SE Varrock mine (3285, 3365)
Lumbridge general store (3212, 3247)
Lumbridge castle (thieving) (3222, 3218)
Falador center (2951, 3380)
Falador north gate (to Taverley and wester side of map) ~(2935, 3460)
Taverley (stone circle) (2935, 3479)

Al Kharid Coordinates

Location Coordinates Notes
Toll gate (Lumbridge side) (3268, 3228) Pay 10gp to enter
Toll gate (Al Kharid side) (3277, 3227) Walk here after paying
Al Kharid bank (3269, 3167) x=3269 is 1 tile west of typical "in Al Kharid" check
Kebab seller (3273, 3180) Dialog-based shop, 1gp per kebab.
Scimitar shop (Zeke) (3287, 3186) Bronze to Mithril scimitars
Al-Kharid warriors (palace) ~(3293, 3170) Good thieving/combat training.
Fishing spots (3267, 3148) Safe shrimp fishing (there is a lvl 14 scorpion)

Al Kharid Detection

// Simple check: x >= 3270 means inside Al Kharid
// BUT note the bank is at x=3269, so use x >= 3267 for safety
function isInAlKharid() {
    const player = sdk.getState()?.player;
    if (!player) return false;
    return player.worldX >= 3267 && player.worldZ < 3220;
}