It give me error and don't anything from withdraw. :/
Someone can fix this?
PHP Code:
-- Item Withdrawer
mainbp = getlootingdestination('mainbp')
suppbp = getlootingdestination('suppbp')
suppbp2 = getlootingdestination('suppbp2')
extraitembp = getlootingdestination('extraitembackpack')
local Withdraw = {
{Name = "great mana potion", Amount = tonumber(getuseroption("MpToBuy")), Check = getuseroption("potions"), Destination = suppbp},
{Name = "great fireball rune", Amount = tonumber(getuseroption("GfbToBuy")), Check = getuseroption("runes"), Destination = suppbp},
{Name = "thunderstorm rune", Amount = tonumber(getuseroption("TsrToBuy")), Check = getuseroption("runes"), Destination = suppbp},
{Name = "flask of rust remover", Amount = 50, Check = getuseroption("flasks"), Destination = mainbp},
{Name = getuseroption("ringsname"), Amount = tonumber(getuseroption("ringsamount")), Check = getuseroption("rings"), Destination = suppbp2},
{Name = getuseroption("amuletsname"), Amount = tonumber(getuseroption("amuletsamount")), Check = getuseroption("amulets"), Destination = suppbp2},
}
if getuseroption("potions") or getuseroption("runes") or getuseroption("rings") or getuseroption("amulets") or getuseroption("flasks") then
setsetting('Looting/OpenNextBP', 'no')
closewindows()
wait(1000)
while windowcount(mainbp) < 1 do
if windowcount(mainbp) < 1 then
closewindows()
wait(1000)
end
openitem(0, 'back')
wait(500,1000)
resizewindows(0, '0')
wait(500,1000)
end
while windowcount("Depot Chest") == 0 do
opendepot()
wait(300)
end
while windowcount(extraitembp) == 0 do
openitem(extraitembp, "Depot Chest", false)
wait(1000)
end
resizewindows(100, extraitembp)
wait(700)
while true do
local More = false
for _, DP in ipairs(Withdraw) do
if DP.Check then
while windowcount(DP.Destination) == 0 do
openitem(DP.Destination, mainbp, true)
wait(1000)
resizewindows(0, DP.Destination)
wait(500,1000)
end
Amount = DP.Amount - itemcount(DP.Name, DP.Destination)
DepoAmount = itemcount(DP.Name, extraitembp)
while itemcount(DP.Name, extraitembp) > 0 and Amount > 0 do
moveitems(DP.Name, DP.Destination, extraitembp, Amount)
wait(300, 400)
Amount = DP.Amount - itemcount(DP.Name, DP.Destination)
end
if Amount > 0 then
More = true
end
end
end
end