I would like some help, I'm making a cavebot, and in a certain action with location, it will pause a persistents action, can we do it?
And after a certain time in another cavebot action it will reactivate it again.
I would also like to add an action to the script below, I want it so that when it locates this particular item on the screen, it uses item id 3429 in these list items.
And after a certain time in another cavebot action it will reactivate it again.
I would also like to add an action to the script below, I want it so that when it locates this particular item on the screen, it uses item id 3429 in these list items.
local ITEMS = { 1234, 4321 }
if dist == nil then
function dist(x, y)
local xDist = math.abs(posx() - x);
local yDist = math.abs(posy() - y);
if xDist >= yDist then
return xDist
end
return yDist
end
end
if connected() then
local player_x = posx()
local player_y = posy()
local player_z = posz()
for x = -7, 7, 1 do
for y = -5, 5, 1 do
local flag = false
local item = topitem(player_x + x, player_y + y, player_z, false)
while table.find(ITEMS, item.id) ~= nil and tilereachable(player_x + x, player_y + y, player_z) do
if dist(player_x + x, player_y + y) > 1 and not reachlocation(player_x + x, player_y + y, player_z, false, true) then
break
end
useitem(item.id, ground(player_x + x, player_y + y, player_z))
wait(300, 500)
item = topitem(player_x + x, player_y + y, player_z, false)
flag = true
end
if flag then
return
end
end
end
end