Kashub's Code Barn - "jOKER"

podświetlone jako div (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)
| Sklepy internetowe | | Wózki dla dzieci | | Opony całoroczne | | Sklep z artykułami RTV/AGD | | Dyskretny sexshop internetowy | | Sklep z artykułami dla zwierząt | | karma dla psa - sklep | | Skróć link | | Darmowe Blogi | | Przenieś bloga z onetu |