I have this, but no matter what I do I can;t seem to get it to work properly.. it looks correct to me, I don't see anything wrong in terms of misspellings and such.
PHP Code:
--Withdraw items
--Backpacks
local main = getuseroption('MainBP')
local rare = getuseroption('LootBP')
local supply = getuseroption('SupplyBP')
local itemdpnumberid = getuseroption('EquipBP')
local depot = "Depot Chest"
-- Withdraw ammo
local ammo = itemcount(bolttype, supply) + itemcount(bolttype, 'belt')
local ammo1 = itemcount(speartype, supply) + itemcount(speartype, 'belt')
local ammo2 = itemcount(arrowtype, supply) + itemcount(arrowtype, 'belt')
local usebolt = getuseroption('UseBolt')
local bolttype = getuseroption('BoltType')
local boltwith = getuseroption('BoltWith')
local usespear = getuseroption('UseSpear')
local speartype = getuseroption('SpearType')
local spearwith = getuseroption('SpearWith')
local usearrow = getuseroption('UseArrow')
local arrowtype = getuseroption('ArrowType')
local arrowwith = getuseroption('ArrowWith')
--Open backpacks
closewindows(rare)
wait(500,700)
resizewindows()
closewindows(depot)
wait(500,700)
resizewindows()
while windowcount(main) == 0 do
openitem(0, 'back')
wait(500,1000)
resizewindows(0, '0')
wait(500,1000)
end
while windowcount(supply) == 0 and itemcount(supply, main) > 0 do
openitem(supply, main, true)
wait(500, 1000)
resizewindows()
wait(300,500)
end
while windowcount("Depot Chest") == 0 do
opendepot(true)
wait(300)
openitem(3502)
wait(500)
openitem(22796 + itemdpnumberid)
wait(500)
end
while getuseroption('UseBolt') and itemcount(bolttype, ammo) < boltwith and itemcount(bolttype, itemname(22796+itemdpnumberid)) > 0 do
moveitems(bolttype, supply, itemname(22796+itemdpnumberid), boltwith - itemcount(bolttype, ammo))
wait(300,500)
end
while getuseroption('UseSpear') and itemcount(speartype, ammo1) < spearwith and itemcount(speartype, itemname(22796+itemdpnumberid)) > 0 do
moveitems(speartype, supply, itemname(22796+itemdpnumberid), spearwith - itemcount(speartype, ammo1))
wait(300,500)
end
while getuseroption('UseArrow') and itemcount(arrowtype, ammo2) < arrowwith and itemcount(arrowtype, itemname(22796+itemdpnumberid)) > 0 do
moveitems(arrowtype, supply, itemname(22796+itemdpnumberid), arrowwith - itemcount(arrowtype, ammo2))
wait(300,500)
end