macro(10000, "Anti Kick", function()
local oldDir = direction()
turn((oldDir + 1) % 4)
schedule(1000, function() -- Schedule a function after 1000 milliseconds.
turn(oldDir)
end)
end)
macro(100, "Hide Useless Tiles", "Ctrl+H", function()
for i, tile in ipairs(g_map.getTiles(posz())) do
if not tile:isWalkable(true) then
tile:setFill('black')
end
end
end)
UI.Separator()
UI.Label("Items to drop:")
if type(storage.dropItems) ~= "table" then
storage.dropItems = {283, 284, 285}
end
local dropItemsContainer = UI.Container(function(widget, items)
storage.dropItems = items
end, true)
dropItemsContainer:setHeight(35)
dropItemsContainer:setItems(storage.dropItems)
macro(1000, "Drop items", function()
if not storage.dropItems[1] then return end
-- search for items in containers
for _, container in pairs(g_game.getContainers()) do
for __, item in ipairs(container:getItems()) do
for i, dropItem in ipairs(storage.dropItems) do
if item:getId() == dropItem.id and item:getCount() >= dropItem.count then
return g_game.move(item, pos(), dropItem.count)
end
end
end
end
end)