Advertisement
Rusettsten

RailServ

May 2nd, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.38 KB | None | 0 0
  1. --RailServ Version 1.0 5/1/2017
  2. repeat
  3. print("RAILSERV:")
  4. local command = read()
  5. string.lower(command) --Gets a command
  6.  
  7. rednet.open("bottom") --Opens rednet client
  8.  
  9. if command == "route" then
  10.     print("Enter Departure ID:")
  11.     local depID = read() --Gets Departure ID
  12.     print("Enter Arrival ID:")
  13.     local arrID = read() -- Gets Arrival ID
  14.    
  15.     if stationID == 1 then
  16.         if stationID == 2 then
  17.             rednet.send(4,"open1")
  18.             rednet.send(6,"close")
  19.         end
  20.     end
  21. end
  22.  
  23. if command == "open" then --Open some stuff
  24.     print("Enter Switch ID:")
  25.     local switchID = read()
  26.     string.lower(switchID)
  27.     --ENTER SWITCH ID PATCH BAY
  28.    
  29.     if switchID == "all" then
  30.         rednet.send(4,"open1")
  31.         rednet.send(6,"open")
  32.         rednet.send(4,"open2")
  33.     end
  34.     if switchID == "a10" then
  35.         rednet.send(4,"open1")
  36.     end
  37.     if switchID == "a20" then
  38.         rednet.send(4,"open2")
  39.     end
  40.     if switchID == "a15" then
  41.         rednet.send(6,"open")
  42.     end
  43. end
  44.  
  45. if command == "close" then --Close some stuff
  46.     print("Enter Switch ID:")
  47.     local switchID = read()
  48.     string.lower(switchID)
  49.     --ENTER SWITCH ID PATCH BAY
  50.    
  51.     if switchID == "all" then
  52.         rednet.send(4,"close1")
  53.         rednet.send(6,"close")
  54.         rednet.send(4,"close2")
  55.     end
  56.     if switchID == "a10" then
  57.         rednet.send(4,"close1")
  58.     end
  59.     if switchID == "a20" then
  60.         rednet.send(4,"close2")
  61.     end
  62.     if switchID == "a15" then
  63.         rednet.send(6,"close")
  64.     end
  65. end
  66. until command == "rickroll"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement