Quipex

Disk/mem/redworks/programs/circuits/Lever

Apr 23rd, 2012
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. --0
  2. --6
  3. --0
  4. input = {}
  5. output = {}
  6. extra = {}
  7. output[1] = "back"
  8. output[2] = "front"
  9. output[3] = "left"
  10. output[4] = "right"
  11. output[5] = "bottom"
  12. output[6] = "top"
  13.  
  14. -- 6-way Ouput Lever
  15. -- Created by: Streetstar5 aka FuzzyPurp
  16.  
  17. rState = false
  18. local rRunning = true
  19.  
  20. term.clear()
  21. term.setCursorPos(1,2)
  22. print("Artificial Lever is now running.")
  23. print("Press T to turn ON and F to turn off")
  24. print("Output(s): " .. output[1] .. ", " ..output[2] .. ", " .. output[3] .. ".")
  25. print("Output(s): " .. output[4] .. ", " ..output[5] .. ", " .. output[6] .. ".")
  26. print("\nHold Control+T to terminate.")
  27.  
  28. while true do
  29.  
  30. local rEvent, param = os.pullEvent()
  31. if rEvent == "key" then
  32. if param == 20 then
  33. rState = true
  34. end
  35. if param == 33 then
  36. rState = false
  37. end
  38. end
  39. rs.setOutput(output[1], rState)
  40. rs.setOutput(output[2], rState)
  41. rs.setOutput(output[3], rState)
  42. rs.setOutput(output[4], rState)
  43. rs.setOutput(output[5], rState)
  44. rs.setOutput(output[6], rState)
  45. end
Advertisement
Add Comment
Please, Sign In to add comment