ExplodingVortex

[Lua] Computercraft Base Control

Oct 23rd, 2015
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1,1)
  3.  
  4. print("Base Control")
  5. term.setCursorPos(1,2)
  6. print("Version 1.0")
  7. term.setCursorPos(1,4)
  8. sleep(1)
  9. print("What would you like me to Help with?")
  10. term.setCursorPos(1,6)
  11. sleep(1)
  12. print("Type Farm to control the Farms")
  13. term.setCursorPos(1,7)
  14. sleep(1)
  15. print("Type Power to control the Power")
  16.  
  17. input = read()
  18.  
  19. farm = "farm"
  20. power = "power"
  21.  
  22. if input == (farm) then
  23. term.clear()
  24. term.setCursorPos(1,1)
  25. print("Do You want to turn the Farms on or off?")
  26.  
  27. input = read()
  28.  
  29. on = "on"
  30. off = "off"
  31.  
  32. if input == (off) then
  33. print("Farms Turning Off")
  34. redstone.setOutput("back", true)
  35. sleep(3)
  36. os.reboot()
  37. end
  38.  
  39. if input == (on) then
  40. print("Farms Turning On")
  41. redstone.setOutput("back", false)
  42. sleep(3)
  43. os.reboot()
  44. end
  45. end
  46.  
  47. if input == (power) then
  48. term.clear()
  49. term.setCursorPos(1,1)
  50. print("Do you want to turn the power on or off?")
  51.  
  52. input = read()
  53.  
  54. on = "on"
  55. off = "off"
  56.  
  57. if input == (on) then
  58. print("Power is going on!")
  59. redstone.setOutput("top", false)
  60. sleep(3)
  61. os.reboot()
  62. end
  63.  
  64. if input == (off) then
  65. print("Power turning of!")
  66. redstone.setOutput("top", true)
  67. sleep(3)
  68. os.reboot()
  69. end
  70. end
Advertisement
Add Comment
Please, Sign In to add comment