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.

CaveBot tab with the hunt library and the waypoint table

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.

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#

1
Go to the start of the hunt

Stand on the route's first sqm, on the right floor.

2
Turn on Auto rec

Click Auto rec on the Table, or type /wp auto. The bot records a node every Node distance sqm while you walk.

3
Walk the whole route

Ladders, holes and floor changes become a stand on the last sqm before the change.

4
Fix the types

Change the stand ones to the right type: /wp type 12 ladder.

5
Stop and check

Click Stop rec (or /wp auto off) and run /wp check.

Waypoint types#

TypeWhat it does
nodeWalks until within a few sqm of the spot (the usual one)
standSteps onto the exact sqm
door / useUses what is on the sqm and carries on
ladderUses the sqm and waits for the floor change
rope / shovel / pickUses the tool on the sqm; shovel and pick step into the hole afterwards
macheteCuts the jungle grass
hole / stairsSteps onto the sqm and waits for the floor change
teleportSteps on and waits to be moved
hurup / hurdownStands on the sqm, faces the direction and says exani hur
useitemUses an item by id on the sqm
lure / endlureStarts and ends a lure
boxWalks to the sqm without fighting on the way and fights there; then waits like an endlure
dynstart / dynendDynamic lure only between the two
saySays the text (NPC, spell)
scriptRuns Lua code and waits for it to finish
waitPauses for a time in ms
label / gotoMarks a spot and jumps to it
refillcheck / sell / refillChecks 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#

text
/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 route

Accepted 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:

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.