Advertisement
cochise57

Untitled

Aug 23rd, 2015
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. os.loadAPI("ocs/apis/sensor")
  2. prox = sensor.wrap("back")
  3.  
  4.  
  5. while true do
  6. local target = prox.getTargets()
  7. for tarName, _ in pairs(target) do
  8. --fetch the detailed information table for the current target.
  9. local details = prox.getTargetDetails(tarName)
  10. if details ~= nil then
  11. if details.Riding ~= nil then
  12. if details.Riding.Name == "Creeper" then
  13. while rs.testBundledInput("left", colors.green) == false do
  14. print("Wait")
  15. rs.setBundledOutput("right", colors.white)
  16. os.sleep(0.5)
  17. end
  18. rs.setBundledOutput("right",0)
  19. os.reboot()
  20. break
  21. end
  22. else
  23. break
  24. end
  25. else
  26. break
  27. end
  28.  
  29. end
  30. os.sleep(0.5)
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement