Advertisement
RavenSH4

Untitled

Jan 20th, 2020
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. --update data from redstone channels (sensors)
  2. function UpdateSensors()
  3. RedstoneBottom = rs.getInput("bottom")
  4. RedstoneTop = rs.getInput("right")
  5.  
  6. --
  7. if RedstoneBottom then
  8. rs.setOutput("left", true)
  9. elseif RedstoneTop then
  10. rs.setOutput("left", false)
  11. else
  12. --
  13. end
  14. end
  15.  
  16. UpdateSensors()
  17.  
  18. repeat
  19. event,p1,p2,p3 = os.pullEvent()
  20. if event=="redstone" then
  21. UpdateSensors()
  22. end
  23. until event=="char" and p1==("q")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement