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
FORCE REFILL
#1
Hello Im trying to force my cavebot to go to X waypoint and DROP loot, if I have less than X cap.

1. Create an 2 Actions in Cavebot:

#1 Waypoint.
status = 'no drop'

#X waypoint since this waypoint is just before all I want to do and labeled "DROP"
status = 'drop'


2. Create a LUA script on Cavebot:
captodrop = 40

if cap() <= captodrop and status == 'no drop' then
  gotolabel('DROP')
end


So the cavebot doesnt go to the label called '"DROP" not sure what im doing wrong.

Also I tried this:

if cap() <= 30 and status == 'no drop' then
  gotolabel('DROP')
end
Reply

#2
Hello.

I could not understand what you mean here "2. Create a LUA script on Cavebot:". Are you using an Action waypoint or what?
If you are using Cavebot -> "LUA Setup" to run that LUA script then it's not going to work. Well, it does works, but it just runs a single time after you edit it, because it's supposed to setup variables that you would use on other waypoints.
Example:
Use this code on LUA Setup, so when you close script window then Bot will run this.
captodrop = 40
Then use code below in an Action wpt. So it will read "captodrop".
if cap() <= captodrop and status == 'no drop' then
  gotolabel('DROP')
end
If you are using code ABOVE on LUA Setup then it's NOT going to work, because it runs only ONCE when you close the script window. It's designed to create global variables to be used on Action waypoints, etc.

Did you tried to print "status" variable to check its value?
print('status:', status)
print('cap:', cap())
Reply

#3
|Only Registered members can see download links. | Click here to buy subscription or here to register.

Yeah Im trying to run a script on "Cavebot -> "LUA Setup" but as you said it runs only once, so it wont work, OK.
So I changed to persistent and still doesnt work.

But what i want is that doesnt matter in which waypoint in the CAVE it is the bot, it will force to go to X waypoint and then continue after that waypoint.
I mean if im in waypoint 100 and the waypoint i want to force is 200, the bot will force to go that waypoint, obviously the waypoint 200 is an action that unables the script in persistent by changing the variable "status" so it stop forcing to go wpt 200.

I tried print on console and doesnt read the "status" in action on cavebot, maybe thats why...
Reply

#4
Hello.

The script that runs on Cavebot -> LUA Setup is also ran on Persistents, once only as well. However, if you plan to use Persistents then you must check what's your current waypoint as well, otherwise you could get stuck in a loop like: if cap is lower than 400 go to label X. Great. But whenever you go to the next waypoint, it would back to label X, because you still have cap lower than 400. Got it?
Let's say that you have 10 waypoints that runs around the hunt spot, so you just need to check supplies while walking on those waypoints, right?
So use something like code below to make sure your current waypoint is between waypoint #000 and waypoint #009
local currWaypoint = waypoint()
if cap() <= captodrop and status == 'no drop' and currWaypoint.id >= 0 and currWaypoint.id <= 9 then
  gotolabel('DROP')
end

It's also worth to mention that global variables are not shared with other LUA instances, unless you use setglobal/getglobal. That means if you use status = 'no drop' on Persistent, that variable will not be updated on Cavebot and vice versa. If you do wanna set a variable on both then use setglobal/getglobal.
Reply

#5
ohhh now i see, Thanks alot thats what i need it.
Thanks
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016