Advertisement
RobotBubble

ComputerTurtleMenu

Oct 25th, 2017
134
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.setTextColor(colors.white)
  17. term.setCursorPos(1, 5)
  18. print("[M] Menu")
  19. term.setCursorPos(1, 7)
  20. print("[1] Remote")
  21. term.setCursorPos(1, 9)
  22. print("[2] Rename")
  23. term.setCursorPos(1, 11)
  24. print("[3] Refuel")
  25. term.setCursorPos(1, 13)
  26. print("[4] Restart Turtle")
  27. term.setCursorPos(1, 15)
  28. print("[5] Turn Off Turtle")
  29. function RCmaster()
  30. while true do
  31. local sEvent, param = os.pullEvent("key")
  32. if(sEvent == "key" ) then
  33. if (param == 2) then
  34. rednet.broadcast("TurtleRemote")
  35. sleep(.1)
  36. term.clear()
  37. term.setCursorPos(1, 1)
  38. shell.run("remote")
  39. elseif (param == 3) then
  40. rednet.broadcast("TurtleName")
  41. sleep(1)
  42. term.clear()
  43. term.setCursorPos(1, 1)
  44. print("Name:")
  45. term.setCursorPos(6, 1)
  46. input = read()
  47. sleep(3)
  48. rednet.broadcast(input)
  49. sleep(2.5)
  50. shell.run("turtlemenu")
  51. elseif (param == 50) then
  52. term.clear()
  53. term.setCursorPos(1, 1)
  54. term.setTextColor(colors.white)
  55. shell.run("menu")
  56. elseif (param == 4) then
  57. rednet.broadcast("TurtleRefuel")
  58. elseif (param == 5) then
  59. term.clear()
  60. term.setCursorPos(1, 1)
  61. print("Restarting...")
  62. rednet.broadcast("TurtleRestart")
  63. sleep(1)
  64. shell.run("turtlemenu")
  65. elseif (param == 6) then
  66. term.clear()
  67. term.setCursorPos(1, 1)
  68. print("Turtle: Goodbye...")
  69. sleep(2.5)
  70. rednet.broadcast("TurtleShutdown")
  71. end
  72. end
  73. end
  74. end
  75. RCmaster()
Advertisement
RAW Paste Data Copied
Advertisement