Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --AREA OF ADJUSTMENTS
- monitor = 1000
- sorter = 1001
- switch = "right"
- signal_out = "front"
- wireless = "top"
- reverse = "n"
- rednet.open(wireless)
- --DETERMINING WEITHER ITS ALREADY ON--
- if redstone.getInput(switch) == true and reverse == "n" then
- if redstone.getInput(switch) == true then
- status = "activated"
- else
- status = "deactivated"
- end
- else
- if redstone.getInput(switch) == false then
- status = "activated"
- else
- status = "deactivated"
- end
- end
- while true do
- print("receiving... currently " .. status)
- event, id, text = os.pullEvent()
- if event == "rednet_message" then
- print("received " .. text)
- if text == "switch" and id == monitor then
- redstone.setOutput(signal_out, true)
- sleep(0.2)
- redstone.setOutput(signal_out, false)
- sleep(0.5)
- end
- if redstone.getInput(switch) == true and reverse == "n" then
- if redstone.getInput(switch) == true then
- status = "activated"
- else
- status = "deactivated"
- end
- else
- if redstone.getInput(switch) == false then
- status = "activated"
- else
- status = "deactivated"
- end
- end
- print(status)
- if text == "status update" and id == monitor then
- print(status)
- rednet.send(monitor, status)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment