Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local x=0
- local y=0
- local z=0
- local targx
- local targy
- local targz
- --local sides = {"left","front","right","back"}
- modem = peripheral.wrap("right")
- modem.open(1)
- modem.open(2)
- if modem.isOpen(1) ~= true then
- print("Modem cannot open on channel 1")
- error()
- end
- if modem.isOpen(2) ~= true then
- print("Modem cannot open on channel 2")
- error()
- end
- modem.transmit(1,2,"Turtle's Modem is alive")
- print("Insert how many blocks to dig in the X direction")
- targx=tonumber(read())
- print("Insert how many blocks to dig in the Y direction")
- targy=tonumber(read())
- print("Insert how many blocks to dig in the Z direction")
- targz=tonumber(read())
- print("The desired hole is " ..targx "x" ..targy "x" ..targz " in size")
- print("Place the turtle on the BOTTOM RIGHT corner of the area you want to dig")
- print("Then place a redstone torch behind the turtle. The turtle will face the correct direction automatically")
- print("Press any key when torch is placed")
- read()
- while redstone.getInput("back")~=true do
- turtle.turnLeft()
- end
- if turtle.getFuelLevel()<64 then
- print("Place fuel on the first turtle slot")
- while turtle.refuel() == false do
- turtle.refuel()
- os.sleep(1)
- end
- end
- print("Press enter to start")
- read()
- print("Starting in 5 seconds")
- modem.transmit(1,2,"Starting in 5 seconds")
- os.sleep(5)
- modem.transmit(1,2,"Starting")
- for x=0,targx-1,1 do
- for y=0,targy-1,1 do
- for z=0,targz-1,1 do
- modem.transmit(1,2,z)
- turtle.dig()
- modem.transmit(1,2,"Dig")
- if z~= (targz-1) then
- turtle.forward()
- end
- end
- for z=targy-1,0,-1 do
- turtle.back()
- modem.transmit(1,2,z)
- end
- if y~=(targy-1) then
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- end
- end
- turtle.turnLeft()
- for y=targy-1,0,-1 do
- turtle.back()
- modem.transmit(1,2,y)
- end
- turtle.turnRight()
- if x~=(targx-1) then
- turtle.up()
- end
- end
- for x=targx-1,0,-1 do
- turtle.down()
- end
- modem.transmit(1,2,"Done")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement