Mony
03-04-2016, 03:37 PM
Hey all,
I was wondering if I could ask for a little scripting help. I am trying to withdraw items from the Depot Box I to my backpack until i hit 100 cap and then i would like it to start walking again. I've mashed the following together from quite a few scripts others work. I've forgotten the names but would like to say right now thanks and I'm not trying to claim your work as my own :).
I have three issues, in bold, it opens up the depot on screen and you get to locker, it then opens depot chest but not the depot box I. This works and then doesnt, works and then doesnt.
The MinCap doesnt seem to be working. (FIXED)
When it does actually start to withdraw items, it stops half way for no reason like i have 900 cap left.
This has worked once and then just stopped again for no reason, I have no clue how or why that happened as i noted down all changes before and after.
function withdraw()
Walker.Stop()
Self.CloseContainers()
wait(300, 1200)
Self.OpenMainBackpack(true):OpenChildren({"Golden Backpack", true})
wait(300, 1200)
Container.GetFirst():Minimize()
wait(300, 1200)
Self.OpenLocker()
wait(300, 1200)
local contfrom = Container.New('Depot Box I')
local contto = Container.New(container)
while not contfrom:isOpen() do
contfrom = Container.New('Depot Box I')
local dp = Container.New('Locker')
for mailspot, touse in dp:iItems() do
if touse.id == 3502 then
dp:UseItem(mailspot, true)
wait(100, 150)
end
end
end
print("do sprawdzenia".. contfrom:ItemCount())
local DestinationBp = Container.GetByName("Golden Backpack")
for spot = 0, contfrom:ItemCount() do
local item = contfrom:GetItemData(spot)
if Self.Cap() < MinCap then
Walker.Start()
break
end
if(DestinationBp:ItemCount() == DestinationBp:ItemCapacity()) then --opens the next container
local openAt = DestinationBp:ItemCount() - 1
if (Item.isContainer(DestinationBp:GetItemData(openAt ).id)) then
DestinationBp:UseItem(openAt, true)
wait(500)
else
Walker.Start()
break
end
end
print("Dodany: "..spot.. " "..DestinationBp:Index().. " ".. DestinationBp:ItemCapacity() -1)
wait(250,400)
contfrom:MoveItemToContainer(spot, DestinationBp:Index(), DestinationBp:ItemCapacity() - 1)
wait(500,550)
end
Walker.Start()
end
Thanks a lot.
I was wondering if I could ask for a little scripting help. I am trying to withdraw items from the Depot Box I to my backpack until i hit 100 cap and then i would like it to start walking again. I've mashed the following together from quite a few scripts others work. I've forgotten the names but would like to say right now thanks and I'm not trying to claim your work as my own :).
I have three issues, in bold, it opens up the depot on screen and you get to locker, it then opens depot chest but not the depot box I. This works and then doesnt, works and then doesnt.
The MinCap doesnt seem to be working. (FIXED)
When it does actually start to withdraw items, it stops half way for no reason like i have 900 cap left.
This has worked once and then just stopped again for no reason, I have no clue how or why that happened as i noted down all changes before and after.
function withdraw()
Walker.Stop()
Self.CloseContainers()
wait(300, 1200)
Self.OpenMainBackpack(true):OpenChildren({"Golden Backpack", true})
wait(300, 1200)
Container.GetFirst():Minimize()
wait(300, 1200)
Self.OpenLocker()
wait(300, 1200)
local contfrom = Container.New('Depot Box I')
local contto = Container.New(container)
while not contfrom:isOpen() do
contfrom = Container.New('Depot Box I')
local dp = Container.New('Locker')
for mailspot, touse in dp:iItems() do
if touse.id == 3502 then
dp:UseItem(mailspot, true)
wait(100, 150)
end
end
end
print("do sprawdzenia".. contfrom:ItemCount())
local DestinationBp = Container.GetByName("Golden Backpack")
for spot = 0, contfrom:ItemCount() do
local item = contfrom:GetItemData(spot)
if Self.Cap() < MinCap then
Walker.Start()
break
end
if(DestinationBp:ItemCount() == DestinationBp:ItemCapacity()) then --opens the next container
local openAt = DestinationBp:ItemCount() - 1
if (Item.isContainer(DestinationBp:GetItemData(openAt ).id)) then
DestinationBp:UseItem(openAt, true)
wait(500)
else
Walker.Start()
break
end
end
print("Dodany: "..spot.. " "..DestinationBp:Index().. " ".. DestinationBp:ItemCapacity() -1)
wait(250,400)
contfrom:MoveItemToContainer(spot, DestinationBp:Index(), DestinationBp:ItemCapacity() - 1)
wait(500,550)
end
Walker.Start()
end
Thanks a lot.