Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Master
- rednet.open("right")
- times = 0
- sleep(1)
- rednet.broadcast("Changeover")
- print("Changeover!")
- Hos = 0
- repeat
- local ID, Msg = rednet.receive()
- if Msg == "Changedover!" then
- Hos = Hos+1
- print("Changeover callbacks = "..Hos)
- end
- until Hos == 8
- print("Changedover!")
- while true do
- if turtle.forward() then
- if times < 50 then
- rednet.broadcast("Heave!")
- times = times+1
- Hos = 0
- repeat
- local ID, Msg = rednet.receive()
- if Msg == "Ho!" then
- Hos = Hos+1
- end
- until Hos == 8
- else
- rednet.broadcast("Changeover")
- times = 0
- Hos = 0
- repeat
- local ID, Msg = rednet.receive()
- if Msg == "Changedover!" then
- Hos = Hos+1
- end
- until Hos == 8
- sleep(0.2)
- rednet.broadcast("Heave!")
- Hos = 0
- repeat
- local ID, Msg = rednet.receive()
- if Msg == "Ho!" then
- Hos = Hos+1
- end
- until Hos == 8
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment