Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local MODEM_SIDE = "back"
- local LEVEL_ID = 2;
- local SERVER_ID = 1;
- rednet.open(MODEM_SIDE);
- parallel.waitForAll(
- function()
- while true do
- local id, message = rednet.receive();
- if message == true then
- redstone.setOutput("top", true)
- elseif message == false then
- redstone.setOutput("bottom", true)
- else
- if message[1] == LEVEL_ID then
- rednet.send(SERVER_ID, LEVEL_ID);
- end
- if message == "stop" then
- redstone.setOutput("top", false);
- redstone.setOutput("bottom", false);
- end
- end
- end
- end,
- function()
- while true do
- if redstone.getInput("right") then
- rednet.send(SERVER_ID, LEVEL_ID);
- repeat os.sleep() until not redstone.getInput("right")
- end
- os.sleep();
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement