Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function delay(seconds)
- -- safe version of 'sleep' - will requeue dropped events
- local timer = os.startTimer(seconds)
- local q = {}
- while true do
- local data = {os.pullEvent()}
- if data[1] == "timer" and data[2] == timer then
- break
- else
- table.insert(q, data)
- end
- end
- for i,v in ipairs(q) do
- os.queueEvent(unpack(v))
- end
- end
- while true do
- redstone.setOutput("back", true)
- delay(0.5)
- redstone.setOutput("back", false)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement