Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NO_TURTLES = 3
- while true do
- redstone.setOutput("right",true)
- sleep(.5)
- redstone.setOutput("right",false)
- print("Sending out magenta...")
- redstone.setBundledOutput("left",colors.magenta)
- sleep(5)
- redstone.setBundledOutput("left",0)
- n = 0
- repeat
- print("waiting for turtle" .. (n+1))
- repeat
- sleep(math.random()*2)
- until colors.test(redstone.getBundledInput("left"),colors.white)
- n = n + 1
- print("turtle " .. n .. "found!")
- redstone.setBundledOutput("left",colors.orange)
- sleep(2)
- redstone.setBundledOutput("left",0)
- until n == NO_TURTLES
- sleep(1)
- print("All turtles home!")
- redstone.setOutput("front",true)
- sleep(.5)
- redstone.setOutput("front",false)
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment