Advertisement
RobotBubble

ComputerTurtleMenu2

Oct 30th, 2017
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. rednet.open("back")
  2. term.clear()
  3. term.setCursorPos(1, 1)
  4. term.setTextColor(colors.lightGray)
  5. print("--------------------------")
  6. print("---")
  7. term.setTextColor(colors.lightBlue)
  8. term.setCursorPos(4, 2)
  9. print("Bubble Bot Computers")
  10. term.setTextColor(colors.lightGray)
  11. term.setCursorPos(24, 2)
  12. print("---")
  13. print("--------------------------")
  14. term.setCursorPos(1, 5)
  15. term.setTextColor(colors.white)
  16. term.setCursorPos(1, 5)
  17. print("[M] Menu")
  18. term.setCursorPos(1, 7)
  19. print("[1] Remote")
  20. term.setCursorPos(1, 9)
  21. print("[2] Rename")
  22. term.setCursorPos(1, 11)
  23. print("[3] Refuel")
  24. term.setCursorPos(1, 13)
  25. print("[4] AutoFuel")
  26. term.setCursorPos(1, 15)
  27. print("[5] Restart Turtle")
  28. term.setCursorPos(1, 17)
  29. print("[6] Sleep Turtle")
  30. function RCmaster()
  31. while true do
  32. local sEvent, param = os.pullEvent("key")
  33. if(sEvent == "key" ) then
  34. if (param == 2) then
  35. rednet.broadcast("TurtleRemote")
  36. sleep(.1)
  37. term.clear()
  38. term.setCursorPos(1, 1)
  39. shell.run("remote")
  40. elseif (param == 3) then
  41. rednet.broadcast("TurtleName")
  42. sleep(1)
  43. term.clear()
  44. term.setCursorPos(1, 1)
  45. print("Name:")
  46. term.setCursorPos(6, 1)
  47. input = read()
  48. sleep(3)
  49. rednet.broadcast(input)
  50. sleep(2.5)
  51. shell.run("turtlemenu")
  52. elseif (param == 50) then
  53. term.clear()
  54. term.setCursorPos(1, 1)
  55. term.setTextColor(colors.white)
  56. shell.run("menu")
  57. elseif (param == 4) then
  58. rednet.broadcast("TurtleRefuel")
  59. elseif (param == 5) then
  60. term.clear()
  61. term.setCursorPos(1, 1)
  62. print("Turning ON autofuel")
  63. print("on remote startup")
  64. sleep(3)
  65. shell.run("delete remote")
  66. shell.run("delete remote2")
  67. shell.run("pastebin get f39FWPcg remote")
  68. shell.run("pastebin get tVYXJMaY remote2")
  69. shell.run("delete turtlemenu")
  70. shell.run("pastebin get 7SfFaiiJ turtlemenu")
  71. sleep(2.5)
  72. os.reboot()
  73. elseif (param == 6) then
  74. term.clear()
  75. term.setCursorPos(1, 1)
  76. print("Restarting...")
  77. rednet.broadcast("TurtleRestart")
  78. sleep(1)
  79. shell.run("turtlemenu")
  80. elseif (param == 7) then
  81. term.clear()
  82. term.setCursorPos(1, 1)
  83. print("Turtle: Goodbye...")
  84. sleep(2.5)
  85. rednet.broadcast("TurtleShutdown")
  86. end
  87. end
  88. end
  89. end
  90. RCmaster()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement