Guest User

door

a guest
Jul 26th, 2012
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.49 KB | None | 0 0
  1. tArgs = {... }
  2. if #tArgs <1 then
  3. syntax()
  4. end
  5. local sides = { 'top','bottom', 'left', 'right' }
  6. sArg = tArgs[1]
  7.  
  8. function main(sArg)
  9. if sArg == "open" then
  10. open()
  11. elseif sArg == "close" then
  12. close()
  13. else syntax()
  14. end
  15. end
  16.  
  17.  
  18. function open()
  19. for i=1, #sides do
  20. rs.setOutput(sides[i], true)
  21. end
  22. return
  23. end
  24.  
  25. function close()
  26. for i = 1, # sides do
  27. rs.setOutput(sides[i], false)
  28. end
  29. return
  30. end
  31.  
  32. function syntax()
  33. print("Syntax: door <open/close>")
  34. return
  35. end
  36.  
  37. main(sArg)
Advertisement
Add Comment
Please, Sign In to add comment