Advertisement
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 ("Startup Functions Activating")
- print ("Going to lowest point")
- turtle.select(3)
- turtle.back()
- while true do
- local mobsPresent = turtle.attackDown()
- local digSuccess = turtle.digDown()
- local movementSuccess = turtle.down()
- if not mobsPresent and not digSuccess and not movementSuccess then
- break
- end
- end
- for b = 1, X do
- turtle.digUp()
- while not turtle.up() do
- turtle.attackUp()
- end
- end
- print ("Calibrated level for a flat bedrock world.")
- print ("---------------------------")
- print ("Starting World Eating Scripts!")
- print ("---------------------------")
- turtle.dig()
- while not turtle.forward() do
- turtle.attack()
- end
- while true do
- for i = 1, 2 do
- for c = 1, X do
- turtle.dig()
- turtle.digDown()
- while not turtle.down() do
- turtle.attackDown()
- end
- end
- for d = 1, X do
- turtle.dig()
- turtle.digUp()
- while not turtle.up() do
- turtle.attackUp()
- end
- end
- for r = 1, 2 do
- turtle.dig()
- while not turtle.forward() do
- turtle.attack()
- end
- end
- Fuel = turtle.getFuelLevel()
- print ("Fuel level is: "..Fuel)
- if Fuel >= 8192 then
- print ("Fuel level is above minimum safe limit.")
- else
- print ("Fuel is below safe limit! Refueling!")
- turtle.select(2)
- turtle.place()
- turtle.suck()
- turtle.refuel()
- turtle.dig()
- turtle.select(3)
- 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
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement