Alrighty this should keep you going atleast
a few ways it can be used, 1 is to literally check if you have no free space at all in your bags, this would require checking every slot in your bags, very time consuming.
You can however assume that the bag fills from slot 1 and continues in order.
So if you have 2 bags then you can set the check for just the last 5 slots of bag 2 with this
checkbagspace(56,60)
usage would be in your WP
Code: Select all
if 1 >= checkbagspace(56,60) then
-- what ever code you want if bags r full
end
It's a userfunction so add it to the user function folder.
Code: Select all
function checkbagspace(_start,_finish)
_space = _finish - _start + 1
for i = _start, _finish do
local check = "GetBagItemInfo("..i..")"
local inventoryIndex, icon, name, itemCount, locked, invalid = sendMacro(check)
if itemCount ~= 0 then _space = _space - 1 end
end
return _space
end
Of course if you get items in those last 5 slots that you don't want sold by autosell then they stay there and bot will always return those bags being full. But checking 5 slots and if just 1 is empty is farely safe, if not then check 10.
This code is tested and works well.
You can check item slot numbers at the bottom of this page, there are pix
http://www.theromwiki.com/API:GetBagItemInfo