asteroidsteam

acd

Apr 5th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. rednet.open("top")
  2. local instruct = [[
  3. Commands:
  4. oil-on: Turns On Oil
  5. oil-off: Turns Off Oil
  6. water-on: Turns On Water
  7. water-off: Turns Off water
  8. all-on: Turns All on
  9. all-off: Turns All Off
  10. ]]
  11. print(instruct)
  12. while true do
  13. local inp = read()
  14. if inp == "oil-on" then
  15. rednet.broadcast("oil")
  16. os.sleep(1)
  17. rednet.broadcast("1")
  18. print("Oil On.")
  19. elseif inp == "oil-off" then
  20. rednet.broadcast("oil")
  21. os.sleep(1)
  22. rednet.broadcast("2")
  23. print("Oil Off.")
  24. elseif inp == "water-on" then
  25. rednet.broadcast("water")
  26. os.sleep(1)
  27. rednet.broadcast("1")
  28. print("Water On.")
  29. elseif inp == "water-off" then
  30. rednet.broadcast("water")
  31. os.sleep(1)
  32. rednet.broadcast("2")
  33. print("Water Off.")
  34. elseif inp == "all-on" then
  35. rednet.broadcast("water")
  36. os.sleep(1)
  37. rednet.broadcast("1")
  38. rednet.broadcast("oil")
  39. os.sleep(1)
  40. rednet.broadcast("1")
  41. print("All On.")
  42. elseif inp == "all-off" then
  43. rednet.broadcast("water")
  44. os.sleep(1)
  45. rednet.broadcast("2")
  46. rednet.broadcast("oil")
  47. os.sleep(1)
  48. rednet.broadcast("2")
  49. print("All Off.")
  50. else
  51. print("Error: Unknown Command!")
  52. end
  53. end
Add Comment
Please, Sign In to add comment