Quote Originally Posted by shadowart View Post
This used to be stickied before the forum wipe, written by @Furpan.
lua code:

local Reset_Amount = 2 -- amounts of backpacks to open (must be sorted first to last to open, inside main backpack)
local Offline_Time = 1 -- increase this is it resets at random points meanwhile online

function Self.isOffline()
local s = os.clock()
wait(200)
getSelfID()
if ((os.clock() - s) > Offline_Time) then
return true
end
end

function OpenBackpacks(amount)
Cavebot.Stop()
Self.CloseContainers()
Self.OpenMainBackpack(true)
wait(500 + Self.Ping())
if #Container.GetAll() == 1 then
for slot, item in Container.GetFirst():iItems() do
if Item.isContainer(item.id) then
Container.GetFirst():UseItem(slot, false)
wait(500 + Self.Ping())
Container.GetLast():Minimize()
wait(100 + Self.Ping())
end
if #Container.GetAll() == amount then break end
end
end
if #Container.GetAll() ~= amount then
print('Backpack reset not complete, recursing.')
OpenBackpacks(amount)
end
Cavebot.Start()
end

Module.New('BP_RESET', function()
if Self.isOffline() then OpenBackpacks(Reset_Amount) end
end)
Is there a way to make this script without the reconect function and add the script to a label? So the bot opens all my backpacks if he reached the label ? would be damn awesome. My bot sometimes closes 1 or more bps idk how it happens :s