MudkipTheEpic

Sleep 1.0

Dec 27th, 2012
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. function pie()
  2. local x = 20
  3. local y = 10
  4. term.setCursorPos(x, y)
  5. term.setTextColor(2^math.random(1,14))
  6. textutils.slowPrint("Sleeping...")
  7. term.setTextColor(1)
  8. end
  9. function waitforclick()
  10. term.clear()
  11. term.setCursorPos(1,1)
  12. while true do
  13. os.startTimer(0.5)
  14. local event = os.pullEvent()
  15. if event == "mouse_click" then
  16. term.clear()
  17. term.setCursorPos(19,10)
  18. term.setTextColor(2^math.random(1,14))
  19. print("Waking up....")
  20. sleep(1)
  21. term.clear()
  22. term.setCursorPos(1,1)
  23. term.setTextColor(1)
  24. break
  25. elseif event == "timer" then
  26. pie()
  27. end
  28. end
  29. end
  30.  
  31. waitforclick()
Advertisement
Add Comment
Please, Sign In to add comment