thomasfn

Gate Computer #1

Aug 21st, 2012
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.56 KB | None | 0 0
  1. print( "-- GATE COMPUTER --" )
  2.  
  3. rednet.open("back")
  4.  
  5. -- white = up
  6. -- orange = down
  7. -- blue = back
  8. -- yellow = forward
  9.  
  10. local function FireMotor( col )
  11.     rs.setBundledOutput("left", colours[col])
  12.     sleep(0.4)
  13.     rs.setBundledOutput("left", 0)
  14.     sleep(0.4)
  15. end
  16.  
  17. local function OpenGate()
  18.     print( "Opening gate" )
  19.     for i=1, 3 do
  20.         FireMotor("yellow")
  21.     end
  22.     for i=1, 3 do
  23.         FireMotor("white")
  24.     end
  25. end
  26.  
  27. local function CloseGate()
  28.     print( "Closing gate" )
  29.     for i=1, 3 do
  30.         FireMotor("orange")
  31.     end
  32.     for i=1, 3 do
  33.         FireMotor("lightBlue")
  34.     end
  35. end
Advertisement
Add Comment
Please, Sign In to add comment