Advertisement
TrueVirusTV

cc-tweaked_restart

Oct 16th, 2022 (edited)
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. -- # Reboot Program for CC:Tweaked # --
  2. -- # IMPORTANT: Name this program restart
  3.  
  4. local mon = peripheral.find("monitor")
  5. local monX, monY = mon.getSize()
  6. local termX, termY = term.getSize()
  7. mon.setTextScale(1)
  8.  
  9. local title = "Restart"
  10. local len = string.len(title)
  11.  
  12. mon.setBackgroundColor(colors.blue)
  13. term.setBackgroundColor(colors.blue)
  14. term.clear()
  15. mon.clear()
  16.  
  17. mon.setCursorPos((monX - len+1) / 2, monY/2)
  18. term.setCursorPos((termX - len+1) / 2, monY/2)
  19.  
  20. mon.write(title)
  21. term.write(title)
  22.  
  23. os.sleep(1)
  24.  
  25. mon.write(".")
  26. term.write(".")
  27.  
  28. os.sleep(1)
  29.  
  30. mon.write(".")
  31. term.write(".")
  32.  
  33. os.sleep(1)
  34.  
  35. mon.write(".")
  36. term.write(".")
  37.  
  38. os.sleep(1)
  39.  
  40. mon.setBackgroundColor(colors.black)
  41. mon.clear()
  42.  
  43. os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement