Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Changes:
- Turtles no longer monitor how many rows they've gone forward (no more rowsProgressed file)
- Master turtle simply waits for (numberNeighbours) unique turtles to send messages saying
- they are ready and waiting. Slave turtles repeatedly send ready and waiting signals to prevent
- the sync problems we were having before.
- --]]
- -- Open up modem to receive wireless broadcasts
- rednet.open("right")
- -- Wait until neighbouring turtles are ready
- function waitForMaster()
- local event, param1, param2
- rednet.broadcast("I am ready and waiting master")
- os.startTimer(1)
- while true do
- event, param1, param2 = os.pullEvent()
- -- Resend ready message every second, in case master is not yet ready
- if event == "timer" then
- rednet.broadcast("I am ready and waiting master")
- os.startTimer(1)
- -- Wait for master turtle to give the OK to proceed before continuing digging
- elseif event == "rednet_message" then
- local message = param2
- if message == "You are authorised to proceed" then
- break
- end -- if message
- end -- if event
- end -- while
- end -- function
- bool=true
- while bool==true do
- if rs.getInput("back", true) then
- print ("Waiting")
- sleep (1)
- else
- print ("Let's Roll!")
- bool=false
- end
- end
- X=66
- print ("---------------------------")
- print ("Starting World Eating Scripts!")
- print ("---------------------------")
- while true do
- moves = 0
- ore = false
- turtle.select(2)
- ore = turtle.compareDown()
- turtle.select(3)
- while ore == false and moves < 67 do
- turtle.digDown()
- moves = moves + 1
- while not turtle.down() do
- turtle.attack()
- end
- sleep(.5)
- turtle.select(2)
- ore = turtle.compareDown()
- turtle.select(3)
- end
- for q=1, moves do
- turtle.digUp()
- while not turtle.up() do
- turtle.attack()
- turtle.digUp()
- end
- end
- for r = 1, 2 do
- turtle.dig()
- while not turtle.forward() do
- turtle.attack()
- end
- end
- print ("Dropping off items")
- turtle.dig()
- turtle.attack()
- turtle.select(1)
- while not turtle.place() do
- turtle.select(3)
- turtle.attack()
- turtle.select(1)
- end
- for dropslot = 3, 16 do
- turtle.select(dropslot)
- turtle.drop()
- end
- waitForMaster()
- turtle.select(1)
- turtle.dig()
- turtle.select(3)
- end
Advertisement
Add Comment
Please, Sign In to add comment