Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function pie()
- local x = 20
- local y = 10
- term.setCursorPos(x, y)
- term.setTextColor(2^math.random(1,14))
- textutils.slowPrint("Sleeping...")
- term.setTextColor(1)
- end
- function waitforclick()
- term.clear()
- term.setCursorPos(1,1)
- while true do
- os.startTimer(0.5)
- local event = os.pullEvent()
- if event == "mouse_click" then
- term.clear()
- term.setCursorPos(19,10)
- term.setTextColor(2^math.random(1,14))
- print("Waking up....")
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(1)
- break
- elseif event == "timer" then
- pie()
- end
- end
- end
- waitforclick()
Advertisement
Add Comment
Please, Sign In to add comment