Advertisement
Overcontrol1

ElevatorServer

Jan 7th, 2023
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. local CurrentLevel = 0;
  2.  
  3. local GEARSHIFT = "back";
  4. local CLUTCH = "right";
  5.  
  6. rednet.open("TOP");
  7.  
  8. while true do
  9. local id, message = rednet.receive();
  10. if message == 0 then -- if cab has reached destination
  11. redstone.setOutput(CLUTCH, true);
  12. else
  13. local isUp = message > CurrentLevel;
  14. CurrentLevel = message;
  15.  
  16. rednet.send(id, isUp);
  17.  
  18. redstone.setOutput(GEARSHIFT, isUp);
  19. redstone.setOutput(CLUTCH, false);
  20. end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement