Advertisement
Overcontrol1

Level

Jan 7th, 2023 (edited)
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. local MODEM_SIDE = "back"
  2. local LEVEL_ID = 2;
  3. local SERVER_ID = 1;
  4.  
  5. rednet.open(MODEM_SIDE);
  6.  
  7. parallel.waitForAll(
  8. function()
  9. while true do
  10. local id, message = rednet.receive();
  11.  
  12. if message == true then
  13. redstone.setOutput("top", true)
  14. elseif message == false then
  15. redstone.setOutput("bottom", true)
  16. else
  17. if message[1] == LEVEL_ID then
  18. rednet.send(SERVER_ID, LEVEL_ID);
  19. end
  20. if message == "stop" then
  21. redstone.setOutput("top", false);
  22. redstone.setOutput("bottom", false);
  23. end
  24. end
  25. end
  26. end,
  27.  
  28. function()
  29. while true do
  30. if redstone.getInput("right") then
  31. rednet.send(SERVER_ID, LEVEL_ID);
  32. repeat os.sleep() until not redstone.getInput("right")
  33. end
  34.  
  35. os.sleep();
  36. end
  37. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement