klassekatze

bow

Apr 6th, 2018 (edited)
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. local component = require("component")
  2. local sides = require("sides")
  3. local colors = require("colors")
  4. local robot = require("robot")
  5. local rs = component.list("redstone")()
  6.  
  7. do_debug = true
  8. DEBUG = function(msg)
  9. if do_debug then
  10. print(msg)
  11. end
  12. end
  13.  
  14. -- OCEmu has no redstone.
  15. if rs == nil then
  16. rs = {}
  17. rs.getInput = function(s) return 0 end
  18. else
  19. rs = component.proxy(rs)
  20. end
  21.  
  22. local getred = function ()
  23. for i = 0,5,1
  24. do
  25. --DEBUG("tested " .. i .. "=" .. rs.getInput(i))
  26. if rs.getInput(i) > 0 then
  27. return 15
  28. end
  29. end
  30. return 0
  31. end
  32.  
  33. while true do
  34. if getred() > 0 then
  35. -- signal = fireeeee
  36. robot.use(3,false,1.06)
  37. end
  38. os.sleep(0)
  39. end
Add Comment
Please, Sign In to add comment