Advertisement
ecoMeco

AdmiOS - GOODBYE - TRPATCH

Jun 20th, 2014
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. --Centering Text
  2. local function center(text)
  3. local x,y = term.getSize()
  4. local x2,y2 = term.getCursorPos()
  5. term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
  6. write(text)
  7. end
  8.  
  9. local arg = { ... }
  10.  
  11. if arg[1] == "-s" then
  12. --Shutdown
  13. term.setBackgroundColor(colors.lightBlue)
  14. term.clear()
  15. center("Kapaniyor")
  16. sleep(1)
  17. os.shutdown()
  18. elseif arg[1] == "-r" then
  19. --Reboot
  20. term.setBackgroundColor(colors.lightBlue)
  21. term.clear()
  22. center("Yeniden baslatiliyor")
  23. sleep(1)
  24. os.reboot()
  25. elseif arg[1] == "-h" then
  26. --Help
  27. print("goodbye -s KAPAT")
  28. print("goodbye -r YENIDEN BASLAT")
  29.  
  30. else
  31. --No args
  32. error("\"goodbye -h\" yazip parametreleri goruntuleyin")
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement