Advertisement
Plazter

Lys

Jun 15th, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. m = peripheral.wrap("right")
  2. m.setFreq(1)
  3.  
  4. function lever()
  5. if not rs.getInput("top") then
  6. m.set(false)
  7. end
  8.  
  9. if rs.getInput("top") then
  10. m.set(true)
  11. end
  12. end
  13.  
  14. function Control()
  15. print("What do u wish to do?")
  16. input = read()
  17. if input == "on" then
  18. print("Lights On!")
  19. m.set(true)
  20. end
  21. if input == "off" then
  22. print("Lights Off!")
  23. m.set(false)
  24. end
  25.  
  26. if input == "Exit" then
  27. print("Shutting down the program..!")
  28. sleep(3)
  29. print("Program Terminated!!")
  30. break
  31. end
  32. end
  33.  
  34. while true do
  35. lever()
  36. Control()
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement