Everyone who has never used our Bots before, can test each one for 2 days without any limitation.
The trial is given automatically when you login on the Bot, but in some cases it wouldn't work (security reasons).
If this happens, send me a private message and i will be checking the failed trials manually and adding it for those who didn't get it.
We are looking for resellers who may accept payment methods different from ours, including classictibia's cash, realesta's cash, mastercores' cash, etc. Interested? Click here at anytime.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i need help on Lua Script
i want to know if is posible to Run from the cave if someone attacks me, and run to DP if possible i would appreciate!


That's not hard, but you need to use a script that checks if you are being attacked and if you are on hunt spot. Otherwise it would be stuck trying to leaving hunt spot even after you already left.

This script will check if you are being attacked by a player and if Cavebot is currently running a waypoint between Wpt #000 and Wpt #010 then go to label 'Leave_Hunt' and set global "BEING_ATTACKED" which can be used on an Action to check .
if isattackingme(2000, 'p') > 0 then
    local wpt = waypoint()
    if wpt.id >= 0 and wpt.id <= 10 then
         setglobal('BEING_ATTACKED', true)

So the script above would work fine with the wpt organization like this.
000 Node
001 Node
002 Node
003 Node
004 Node
005 Node
006 Node
007 Node
008 Node
009 Node
010 Node
011 Action (check cap)
012 Stand (Leave_Hunt)

If you have more waypoints, less waypoints or even waypoints using different ranges then you just need to adjust it.


This script doesnt work for me and im not sure what im doing wrong. I tried to use the script in "edit action" and a persistent script.

Do i need to change anything in this?

if attackingme(2000, 'p') > 0 then
    local wpt = waypoint()
    if wpt.id >= 0 and wpt.id <= 4 then
        setglobal('BEING_ATTACKED', true)

I have 4 waypoint 000 to 004.

The script can be used anywhere, but you must understand that each place you run LUA scripts works differently.
Cavebot Actions only runs the script when you go to that waypoint.
Persistents runs it from time to time.

The script will go to wpt Leave_Hunt if a player attacked you in last 2 seconds AND Cavebot current waypoint is between wpt #000 and #004.

Forum Jump:

Forum software by © MyBB Theme © iAndrew 2016