Documentation › Modules
CaveBot
CaveBot walks a route of waypoints, one after another. It stops to fight, uses ladders, ropes and holes, lures and, on 100% AFK hunts, goes to the depot by itself, sells, buys supplies and comes back.
The three sub-tabs#
The waypoint list with the #, Type and Where columns. The current waypoint shows in green with >.
- Double-click a row to make the bot go to that waypoint
- Go to continues from the selected one, or from the nearest if nothing is selected
- Delete removes the selected one (or the last)
On the right are the Add at my position, Settings and Supplies (sell / refill) boxes.
The route drawn over the client's minimap:
- click the map to add a waypoint after the selected one
- drag a waypoint to move it
- drag the map to pan
- the mouse wheel zooms; Ctrl + wheel (or Shift + wheel) changes floor
- View, in the top right corner, switches between Surface (satellite) and Map (minimap colors). Below ground level the map is always shown in colors
Stairs, holes and ropes#
On the minimap, the yellow squares are where the floor changes. Hover over one: it gets a yellow frame and the name of what it is, such as LADDER · click: go up ▲ or HOLE · click: go down ▼.
Click it and the waypoint is added with the right type (ladder, stairs, hole, rope). On the map it shows the name next to the number. Then:
- hold Ctrl and turn the wheel to go to the other floor
- keep clicking the next waypoints
When the next waypoint is on another floor, the number gets ▲ or ▼. If the bot picks the wrong type (a ladder became stairs, for example), change it in the side panel.
The side panel edits the selected waypoint. Table and Map edit the same route.
The full cycle of a library hunt, in 8 phases: Hunt, Supply check, Leave, Depot, Sell, Bank, Refill and Travel. Each phase shows ✓ or ✗, and the Validate button tells you what is missing. The editable values of the hunt's scripts are here too, with Save and Save & load.
Library#
The ◂ / ▸ button shows the library on the left: your hunts in folders, in the cavebots/ folder next to bot.json. Click selects, double-click loads it into CaveBot. It takes DrenoxBot .json routes and ZeroBot .cb files.
Recording a route#
Stand on the route's first sqm, on the right floor.
Click Auto rec on the Table, or type /wp auto. The bot records a node every Node distance sqm while you walk.
Ladders, holes and floor changes become a stand on the last sqm before the change.
Change the stand ones to the right type: /wp type 12 ladder.
Click Stop rec (or /wp auto off) and run /wp check.
Waypoint types#
| Type | What it does |
|---|---|
node | Walks until within a few sqm of the spot (the usual one) |
stand | Steps onto the exact sqm |
door / use | Uses what is on the sqm and carries on |
ladder | Uses the sqm and waits for the floor change |
rope / shovel / pick | Uses the tool on the sqm; shovel and pick step into the hole afterwards |
machete | Cuts the jungle grass |
hole / stairs | Steps onto the sqm and waits for the floor change |
teleport | Steps on and waits to be moved |
hurup / hurdown | Stands on the sqm, faces the direction and says exani hur |
useitem | Uses an item by id on the sqm |
lure / endlure | Starts and ends a lure |
box | Walks to the sqm without fighting on the way and fights there; then waits like an endlure |
dynstart / dynend | Dynamic lure only between the two |
say | Says the text (NPC, spell) |
script | Runs Lua code and waits for it to finish |
wait | Pauses for a time in ms |
label / goto | Marks a spot and jumps to it |
refillcheck / sell / refill | Checks supplies, sells and buys |
The rope, shovel, machete and pick ids are on the Engine tab.
End lure and box#
At an endlure and at a box the bot stays until the fight is over. Three cases it settles by itself:
- A monster it does not attack is left (not on the target list or too far away, for example): it waits the Lure: wait for pack (s) time, 5 seconds by default, and carries on with the route. Monsters Targeting is ignoring are not counted at all
- The box sqm is taken, or the pack surrounded the character on the way: the fight starts where it stands, and it moves to the sqm when it can
- The lure safety trips on the way to the box (Lure: fight below HP% or Safety: near count): it fights where it stands, without walking on to the sqm
While it walks to the box, Shooter holds the attack spells and runes. The lure settings are on the Tools tab.
/wp commands#
/wp node node at your position
/wp ladder n ladder on the sqm to the north
/wp useitem 3003 e uses item 3003 on the sqm to the east
/wp hurup n exani hur up facing north
/wp say hi says "hi"
/wp wait 2000 waits 2 s
/wp label cave marks the spot
/wp goto cave goes back to it
/wp del deletes the last one
/wp list lists the routeAccepted directions are n ne e se s sw w nw and c (your own sqm).
Waypoint format#
The route lives in Cavebot.Waypoints in bot.json:
[
{ "Type": "label", "Label": "start" },
{ "Type": "node", "X": 32369, "Y": 32215, "Z": 7, "Tolerance": 3 },
{ "Type": "stand", "X": 32372, "Y": 32218, "Z": 7, "Tolerance": 0 },
{ "Type": "ladder", "X": 32373, "Y": 32218, "Z": 7 },
{ "Type": "lure" },
{ "Type": "node", "X": 32380, "Y": 32220, "Z": 8, "Tolerance": 3 },
{ "Type": "endlure" },
{ "Type": "goto", "Label": "start" }
]Other fields: ItemId (useitem), WaitMs (wait), Direction (hurup/hurdown).
Settings#
In the Table's Settings box:
- Loop route: back to the first waypoint after the last one (on by default)
- Stop in combat: stops walking while fighting (on by default). Off turns into a continuous lure
- Start from nearest: on start, begins at the waypoint closest to you
Lure, walk mode and special areas are on the Tools tab.
When it gets stuck#
The bot measures whether it is getting closer to the waypoint. After 8 seconds without progress it tries again; after 3 tries it skips to the next one. Those values are StuckTimeoutMs and MaxRetries in bot.json.
When there is no path to the waypoint, the bot tries again calmly, about every 1.5 seconds, instead of skipping several waypoints at once. If it skips two waypoints in a row and Start from nearest is on, it picks the route up from the nearest waypoint on your floor.
Pathfinding#
The path is computed over the map the client can see. The bot avoids special areas marked as no-walk and, with Disable player walkthrough on, treats other players as walls. With Walk through fields on (the default), it walks over fire, poison and energy fields when that is the way, and goes around when the detour is short. Both options are on the Tools tab. In path mode it sends the whole path; in step mode, one step at a time, like arrow keys.
Supplies#
In the Supplies box, add each item with a min and a max: at a refillcheck the bot goes shopping when it has less than the minimum, and buys up to the maximum. Refill below cap also sends it shopping when free cap drops. Ids to sell go in Sell item ids, comma separated.
Comments
to comment.