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.
3.1K
Drop items multiple locations #62

This allows you to specify multiple locations to drop items.
If your char is within "dropDistance" it will drop the items to that location.

940b | 28 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 itemToDrop = { 3031, 3372, 3377, 3358, 3357, 3359, 3362, 3558 }
local dropDistance = 3
local dPos = {
    { x = 889, y = 974, z = 6 },
    { x = 893, y = 970, z = 6 },
    { x = 897, y = 974, z = 6 },
}
dropTrash = macro(1000, "DropTrash", function(m)
    local dropPos = nil
    if dropTrash:isOn() then
        local pos = player:getPosition()
        for i = 1, #dPos do
            if getDistanceBetween(player:getPosition(), dPos[i]) <= dropDistance then
                dropPos = dPos[i]
                break
            end
        end
        if dropPos then
            for _, container in pairs(g_game.getContainers()) do
                for __, item in ipairs(container:getItems()) do
                    if table.find(itemToDrop, item:getId()) then
                        return g_game.move(item, dropPos, 1)
                    end
                end
            end
        end
    end
end)

10 Oct 2021
Ads