Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- turnDirection = "Left"
- testTurtle = function()
- rednet.open("right") --enable modem on the right side of the PC
- id,message = rednet.receive() --wait until a mesage is received
- if id == 4 then
- if message == "Turn Left" then
- turnDirection = "Left"
- elseif message == "Turn Right" then
- turnDirection = "Right"
- end
- rednet.send(4,os.GetLabel() .. " is now turning " .. turndirection)
- end
- rednet.close("right") -- disable modem on the right side of the PC
- end
- turn = function()
- if turnDirection == "Left" then
- turtle.turnLeft()
- else
- turtle.turnRight()
- end
- end
- parallel.waitForAny(testTurtle,turn)
Advertisement
Add Comment
Please, Sign In to add comment