Drop extra pots
#59
This was requested, only quickly tested let me know if any issues.
local totalPots = 400
local potId = 237
macro(1000, "Drop extra pots", function()
local pots = player:getItemsCount(potId)
if pots > totalPots then
local toDrop = pots - totalPots
for _, container in pairs(g_game.getContainers()) do
for __, item in ipairs(container:getItems()) do
if item:getId() == potId then
if toDrop > item:getCount() then
toDrop = toDrop - item:getCount()
g_game.move(item, player:getPosition(), item:getCount())
else
return g_game.move(item, player:getPosition(), toDrop)
end
end
end
end
end
end)
- remove | + add
05 Oct 2021