Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --ToggleReciever
- rednet.open("bottom")
- local mottafra = 0
- local output = "back"
- local state = 0
- local ManualOn = 0
- local ManualOff = 0
- --function toggleOutput()
- while true do
- term.clear()
- UserInput = read()
- term.setCursorPos(1,4)
- print("Manual override, 1 or 0")
- print("Status: ", state)
- id, msg = rednet.receive()
- print("")
- print("Fra "..id)
- print(msg)
- if id == mottafra and msg == "Spawner_ZombiePToggle" and state == 0 then
- print("Spawner er på!")
- rs.setOutput(output, true)
- state = state + 1
- print(state)
- elseif id == mottafra and msg == "Spawner_ZombiePToggle" and state == 1 then
- print("Spawner er av!")
- rs.setOutput(output, false)
- state = state - 1
- print(state)
- end
- if UserInput == ManualOn then
- state = 1
- term.clear()
- print("Manual on confirmed: ", state)
- rs.setOutput(output, true)
- end
- if UserInput == ManualOff then
- state = 0
- term.clear()
- print("Manual off confirmed: ", state)
- rs.setOutput(output, false)
- end
- toggleOutput()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement