Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = peripheral.wrap("right")
- m.setFreq(1)
- function lever()
- if not rs.getInput("top") then
- m.set(false)
- end
- if rs.getInput("top") then
- m.set(true)
- end
- end
- function Control()
- print("What do u wish to do?")
- input = read()
- if input == "on" then
- print("Lights On!")
- m.set(true)
- end
- if input == "off" then
- print("Lights Off!")
- m.set(false)
- end
- if input == "Exit" then
- print("Shutting down the program..!")
- sleep(3)
- print("Program Terminated!!")
- break
- end
- end
- while true do
- lever()
- Control()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement