Kashub's Code Barn - "jOKER"

podświetlone jako autoit (dodał(a) ESSA @ 2022-02-09 16:16:12)

Twoja wyszukiwarka
Podświetl ten kod w:
Ostatnio dodane:
Losowe wpisy:
if not storage.doorIds then
    storage.doorIds = { 5129, 5102, 5111, 5120, 1644, 1648, 1646, 6262}
end
 
local moveTime = 2000     -- Wait time between Move, 2000 milliseconds = 2 seconds
local moveDist = 1        -- How far to Walk
local useTime = 2000     -- Wait time between Use, 2000 milliseconds = 2 seconds
local useDistance = 1     -- How far to Use
 
local function properTable(t)
    local r = {}
    for _, entry in pairs(t) do
        table.insert(r, entry.id)
    end
    return r
end
 
UI.Label("Door IDs")
 
local doorContainer = UI.Container(function(widget, items)
    storage.doorIds = items
    doorId = properTable(storage.doorIds)
end, true)
 
doorContainer:setHeight(35)
doorContainer:setItems(storage.doorIds)
doorId = properTable(storage.doorIds)
 
clickDoor = macro(1000, "Use Doors", function()
    for i, tile in ipairs(g_map.getTiles(posz())) do
        local item = tile:getTopUseThing()
        if item and table.find(doorId, item:getId()) then
            local tPos = tile:getPosition()
            local distance = getDistanceBetween(pos(), tPos)
            if (distance <= useDistance) then
                use(item)
                return delay(useTime)
            end
 
            if (distance <= moveDist and distance > useDistance) then
                if findPath(pos(), tPos, moveDist, { ignoreNonPathable = true, precision = 1 }) then
                    autoWalk(tPos, moveTime, { ignoreNonPathable = true, precision = 1 })
                    return delay(waitTime)
                end
            end
        end
    end
end)
| Opony letnie | | Opony zimowe | | Sklep z artykułami dla zwierząt | | Skróć link | | Blogi za darmo | | Przenieś bloga z onetu | | Załóż za darmo bloga | | Kody programów | | Smutne Opisy |