Advertisement
Guest User

openDoor

a guest
Mar 20th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. function addBundled(s, c)
  2.   rs.setBundledOutput(s, colors.combine(rs.getBundledOutput(s), c))
  3. end
  4.  
  5. function removeBundled(s, c)
  6.   rs.setBundledOutput(s, colors.subtract(rs.getBundledOutput(s), c))
  7. end
  8.  
  9. function main()
  10.   addBundled("back", colors.green) --Start Klaxon
  11.   addBundled("back", colors.yellow) --start pulling down
  12.   sleep(1)
  13.   for i = 1, 8, 1 do --Pulse Door pusher
  14.     addBundled("back", colors.red)
  15.     sleep(3)
  16.     removeBundled("back", colors.red)
  17.   end
  18.   removeBundled("back", colors.yellow) --stop pulling
  19.   sleep(1)
  20.   print("retracting")
  21.   addBundled("back", colors.white) --retract arm
  22.   sleep(10)
  23.   removeBundled("back", colors.white)
  24.   removeBundled("back", colors.green) --stop klaxon
  25.  
  26. end
  27.  
  28.  
  29.  
  30. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement