Your browser does not support JavaScript or its disabled!
Please turn it on, or be aware that some features on this website will not work correctly.
1.5K
Drop extra pots #59
This was requested, only quickly tested let me know if any issues.
622b | 20 lines.
 --[[
  Script made by Lee (Discord: l33_) - www.trainorcreations.com
  If you want to support my work, feel free to donate at https://trainorcreations.com/donate
  PS. Stop ripping off my work and selling it as your own.
 ]]--
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)

05 Oct 2021
Ads