Log in

View Full Version : Inbox withdrawer



LakiLu
06-28-2016, 05:43 AM
Hi,
I was looking for script which take all items from my inbox and put them to backpack but everything what i've found wasn't working as i wanted. So could somebody write script with these features:
-reach depot and open inbox
-take items from inbox and put them to backpack
-when backpack is full open next
-stop when left less than 100 cap
Thanks in advance :D.

Trykon
06-28-2016, 09:40 AM
local container = 'backpack' --write your main bp's name
local InboxFull = true -- don't touch
local BpsCount = 6 -- amount of your stacked bps, these have to be stacked properly and without any items inside
local CurItems = 0 -- don't touch
local BpFull = false -- don't touch
function withdraw()
local cfrom = Container.New('Your Inbox')
local cto = Container.New(container)
while not cfrom:isOpen() do
cfrom = Container.New('Your Inbox')
local dp = Container.New('Locker')
for mailspot, touse in dp:iItems() do
if touse.id == 12902 then
dp:UseItem(mailspot, true)
wait(500, 1700)
end
end
end
if cfrom:isOpen() and cto:isOpen() then
while (cfrom:ItemCount() >= 0) do
local slot = 0
if(cfrom:ItemCount() == 0) then
InboxFull = false
break
else
InboxFull = true
end
local items = cfrom:GetItemData(slot)
if Self.Cap() - Item.GetWeight(items.id) < 1 then
error('You need '..math.floor((Item.GetWeight(items.id)+1)-Self.Cap())..' cap to pick this item.')
break
end
while Self.Cap() - Item.GetWeight(items.id) >= 1 do
if not cto:isFull() then
if (CurItems < (BpsCount * 19)) then
cfrom:MoveItemToContainer(slot, cto:Index(), 19, 100)
wait(300, 1200)
CurItems = CurItems + 1
break
else
BpFull = true
break
end
else
for spot, item in cto:iItems() do
if Item.isContainer(item.id) then
cto:UseItem(spot, true)
wait(500, 1600)
end
end
end
end
if (BpFull == true) then
error('Your bp is full.')
break
end
end
end
end

LakiLu
06-28-2016, 09:56 AM
Something is wrong or i'm doing it wrong because when i execute script xenobot automatically kill it without any error or something. Please help.

Trykon
06-28-2016, 10:09 AM
this is only function inside script :) to have this executable, you need to let's see
Stand in front of dp, you can use in built function in walker Reach Depot


Self.OpenLocker()
withdraw()

and then the function implemented :)
copy this bit in front of what I posted earlier

LakiLu
06-28-2016, 10:44 AM
Thanks man i made this work finally.