Code:
/run local c=floor(GetContainerNumSlots(4)-GetInventoryItemCount("player",0)/200);function buy (n,q) for i=1,100 do if n==GetMerchantItemInfo(i) then BuyMerchantItem(i,q) end end end if (c>0) then buy("Doomshot", c); end;
How is work? Come to vendor with "Doomshot" arrows, right click to vendor, use macro. Macro automatically fill empty slots in quiver.
If my quiver 1st from left:
Code:
local c=floor(GetContainerNumSlots(4)-GetInventoryItemCount("player",0)/200)
200 -- default quantity of ammo per stack
GetContainerNumSlots(4) -- 0 for the backpack, 1 to 4 for the bags on the character (numbered right to left)
GetInventoryItemCount("player",0) -- "player" for toon, 0 for ammo slot
If i want buy Doomshot arrows:
Code:
buy("Doomshot", c)