Marlingaming

Test Track Command Testing Program(Tablet)

Sep 10th, 2021 (edited)
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. --this program is for pocket computers, and allows manual testing of Test Tracks
  2. local Target = nil
  3. local Protocol = nil
  4. local Action = nil
  5. DirectorProtocol = 5362
  6. start()
  7.  
  8. function start()
  9. Menu()
  10. end
  11.  
  12. function Menu()
  13. print("Please Enter Action")
  14. print("1= start, 2= stop, 3= Lockdown")
  15. while true do
  16. local event, key = os.pullEvent("key")
  17. if key == keys.1 then
  18. Action = "start"
  19. break
  20. elseif key == keys.2 then
  21. Action = "stop"
  22. break
  23. elseif key == keys.3 then
  24. Action = "Lockdown"
  25. break
  26. end
  27. end
  28. print("Please Enter Track ID"
  29. local input = read()
  30. while true do
  31. local event, key = os.pullEvent("key")
  32. if key == keys.enter then
  33. Target = input
  34. break
  35. end
  36. end
  37. print("Press T to begin")
  38. repeat
  39. local event, key = os.pullEvent("key")
  40. until key == keys.t
  41. rednet.broadcast(Target, DirectorProtocol)
  42. rednet.broadcast(Action, DirectorProtocol)
  43. print("Sent Successfuly, rebooting in 15 seconds")
  44. sleep(15)
  45. os.reboot
  46. end
Add Comment
Please, Sign In to add comment