Advertisement
gravitowl

Router Installer

Mar 10th, 2021
415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. local w, h = term.getSize()
  2.  
  3. function printCentered(text, y)
  4. term.setCursorPos(w/2 - #text/2, y)
  5. term.write(text)
  6. end
  7.  
  8. term.clear()
  9.  
  10. term.setCursorPos(1,1)
  11. print(string.rep("-", w))
  12. printCentered("Welcome to the GraviNet Router wizard.", 2)
  13. printCentered("This will lead you through", 3)
  14. printCentered("installing a new Router.", 4)
  15. print(string.rep("-", w))
  16. os.sleep(0.5)
  17. print("\n")
  18. print("Which side is your modem on?")
  19. print("[top, bottom, back, front, left, right]")
  20. local side = read()
  21. print("Modem at side: "..side)
  22. os.sleep(0.5)
  23. print("Creating preference file...")
  24. os.sleep(0.2)
  25. file = fs.open("gravinet/router/pref", "w")
  26. file.write(textutils.serialise({side=side}))
  27. file.close()
  28. print("Preference file created in gravinet/router/pref. Do not delete this file!")
  29. os.sleep(0.5)
  30. print("Removing old startup file...")
  31. if fs.exists("startup") then
  32. fs.delete("startup")
  33. end
  34. print("Downloading Master server files...")
  35. shell.run("pastebin","get","https://pastebin.com/5PF0kuEa","startup")
  36. os.sleep(0.5)
  37. print("Rebooting...")
  38. os.sleep(0.5)
  39. os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement