Advertisement
Overcontrol1

Cab

Jan 7th, 2023 (edited)
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. local MODEM_SIDE = "bottom"
  2. local SERVER_ID = 1;
  3.  
  4. local MAXIMUM_LEVEL = 2
  5.  
  6. rednet.open(MODEM_SIDE);
  7.  
  8. rednet.broadcast("stop");
  9.  
  10. function receiveInput()
  11. print("Enter Floor Number: ")
  12. local input = tonumber(read())
  13.  
  14. if type(input) == "number" then
  15. if input > MAXIMUM_LEVEL or input <= 0 then
  16. print("Level not in bounds.")
  17. receiveInput()
  18. return
  19. end
  20.  
  21. rednet.broadcast({input})
  22.  
  23. receiveInput()
  24. return
  25. else
  26. print("You're bad. Use an actual number.")
  27. receiveInput()
  28. return
  29. end
  30.  
  31. end
  32.  
  33. receiveInput();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement