draadloos
12-06-2015, 01:11 AM
Hello,
so i got this inbox withdrawer,
only problem is that it is only withdrawng 1 item and then continouing.
Ive spend several ourhs trying to fix it, but coudlnt find the problem.
local container = 'backpack' -- where deposit items
function withdraw()
local contfrom = Container.New('Your Inbox')
local contto = Container.New(container)
while not contfrom:isOpen() do
contfrom = 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 contfrom:isOpen() and contto:isOpen() then
for slot, items in contfrom:iItems() do
while Self.Cap() - Item.GetWeight(items.id) >= 1 do
if not contto:isFull() then
contfrom:MoveItemToContainer(slot, contto:Index(), 19, 100)
wait(300, 1200)
break
else
for spot, item in contto:iItems() do
if item.id == Item.GetID(container) then
contto:UseItem(spot, true)
wait(500, 1600)
end
end
end
if Self.Cap() - Item.GetWeight(items.id) < 1 then
error('You need '..math.floor((Item.GetWeight(items.id)+1)-Self.Cap())..' capity to pickup item.')
break
end
end
end
end
end
function checking(label)
if label == 'mail' then
Self.CloseContainers()
wait(300, 700)
Self.OpenMainBackpack()
wait(500, 900)
Self.OpenLocker()
wait(300, 1200)
withdraw()
end
end
registerEventListener(WALKER_SELECTLABEL, 'checking')
Thanks in advance.
so i got this inbox withdrawer,
only problem is that it is only withdrawng 1 item and then continouing.
Ive spend several ourhs trying to fix it, but coudlnt find the problem.
local container = 'backpack' -- where deposit items
function withdraw()
local contfrom = Container.New('Your Inbox')
local contto = Container.New(container)
while not contfrom:isOpen() do
contfrom = 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 contfrom:isOpen() and contto:isOpen() then
for slot, items in contfrom:iItems() do
while Self.Cap() - Item.GetWeight(items.id) >= 1 do
if not contto:isFull() then
contfrom:MoveItemToContainer(slot, contto:Index(), 19, 100)
wait(300, 1200)
break
else
for spot, item in contto:iItems() do
if item.id == Item.GetID(container) then
contto:UseItem(spot, true)
wait(500, 1600)
end
end
end
if Self.Cap() - Item.GetWeight(items.id) < 1 then
error('You need '..math.floor((Item.GetWeight(items.id)+1)-Self.Cap())..' capity to pickup item.')
break
end
end
end
end
end
function checking(label)
if label == 'mail' then
Self.CloseContainers()
wait(300, 700)
Self.OpenMainBackpack()
wait(500, 900)
Self.OpenLocker()
wait(300, 1200)
withdraw()
end
end
registerEventListener(WALKER_SELECTLABEL, 'checking')
Thanks in advance.