Kashub's Code Barn - "jOKER"

podświetlone jako div (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)
| Katalog Sklepów internetowych | | Sklep z oponami | | Opony letnie | | Opony specjalne | | karma dla psa - sklep | | Blogi za darmo | | Przenieś bloga z onetu | | Smutne Opisy | | Opisy GG |