Kashub's Code Barn - "jOKER"

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

Twoja wyszukiwarka
Parcel ABC
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)
| Sklep z oponami | | Sklep z artykułami RTV/AGD | | Dyskretny sexshop internetowy | | karma dla psa - sklep | | Programista Trójmiasto | | Skracacz linków | | Blogi za darmo | | Załóż za darmo bloga | | Opisy na Facebooka |