Advertisement
Overcontrol1

Server

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