Advertisement
SuPeRMiNoR3

gjgfujskylab

Nov 26th, 2014
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local colors = require("colors")
  2. local component = require("component")
  3. local sides = require("sides")
  4. local shell = require("shell")
  5. rs = component.redstone
  6.  
  7. function sendColor(col)
  8.     rs.setBundledOutput(sides.top,col,255)
  9.     os.sleep(3)
  10.     rs.setBundledOutput(sides.top,col,0)
  11. end
  12.  
  13. function readColor(col)
  14.     t = rs.getBundledInput(sides.bottom,col)
  15.     return t
  16. end
  17.  
  18. function setDest(addr, dest)
  19.     print("Setting train: " .. addr .. " to: " .. dests[dest])
  20.     addrr = relays[addr]
  21.     train_f = component.proxy(component.get(addrr))
  22.     train_f.setDestination(dests[dest])
  23. end
  24.  
  25. relays = {}
  26. relays[1] = "d73f"
  27. relays[2] = "c433"
  28. relays[3] = "ea0f"
  29. relays[4] = "5973"
  30. relays[5] = "3894"
  31.  
  32. dests = {}
  33. dests["skylab"] = "City/gjgfujskylab"
  34. dests["grand"] = "UnderGround/grandstation"
  35. dests["kittenbag"] = "UnderGround/kittenbag"
  36. dests["we38base"] = "City/wer38base"
  37. dests["long"] = "LongDistence/LongDistence"
  38. dests["spawn"] = "UnderGround/Spawn"
  39.  
  40. print("Your train is on its way!")
  41.  
  42. if readColor(colors.orange) == 0 then
  43.     setDest(1, "skylab")
  44.     sendColor(colors.orange)
  45.  
  46. elseif readColor(colors.magenta) == 0 then
  47.     setDest(2, "skylab")
  48.     sendColor(colors.magenta)
  49.  
  50. elseif readColor(colors.lightblue) == 0 then
  51.     setDest(3, "skylab")
  52.     sendColor(colors.lightblue)
  53. else
  54.     print("Error, no trains to send.")
  55. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement