Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --11--
- function forward()
- while true do
- if turtle.forward() then
- break
- else
- turtle.attack()
- turtle.dig()
- end
- end
- end
- function up()
- while true do
- if turtle.up() then
- break
- else
- turtle.digUp()
- turtle.attackUp()
- end
- end
- end
- function down()
- while true do
- if turtle.down() then
- break
- else turtle,attackDown()
- turtle.digDown()
- end
- end
- end
- local wherex, wherey, wherez,a,b,c,homey,turtley
- function comebackhome()
- rednet.open("left")
- local a,b = rednet.receive()
- b = wherex
- local a,b = rednet.receive()
- b = wherez
- local a,b = rednet.receive()
- b = homey
- local x,y,z = gps.locate()
- homey - y = wherey
- for i = 1, wherey do
- up()
- end
- turtle.turnRight()
- turtle.turnRight()
- for i = 1, wherez do
- forward()
- end
- turtle.turnRight()
- for i = 1,wherex() do
- forward()
- end
- turtle.turnRight()
- end
- function cycle()
- wherey = 0
- turtle.turnRight()
- for i = 1,wherex do
- forward()
- end
- turtle.turnLeft()
- for i = 1,wherez do
- forward()
- end
- while true do
- if turtle.detectDown() then
- if not turtle.digDown() then
- break --bedrock--
- else down()
- wherey = wherey + 1
- end
- else down()
- wherey = wherey + 1
- end
- end
- while wherey > 0 do
- up()
- wherey = wherey - 1
- if wherey > 0 then
- up()
- wherey = wherey - 1
- end
- for i = 1,16 do
- if turtle.getItemDetail(i) then
- if turtle.getItemDetail(i).name == "minecraft:cobblestone" then
- turtle.select(i)
- turtle.placeDown()
- end
- end
- end
- end
- for i = 1,16 do
- turtle.select(i)
- if turtle.getItemDetail() then
- if (turtle.getItemDetail().name == "minecraft:cobblestone") or (turtle.getItemDetail().name == "minecraft:stone") or (turtle.getItemDetail().name == "minecraft:dirt") then
- turtle.placeDown()
- turtle.Drop()
- end
- end
- turtle.turnRight()
- turtle.turnRight()
- for i = 1,wherez do
- forward()
- end
- turtle.turnRight()
- for i = 1,wherex do
- forward()
- end
- turtle.turnRight()
- rednet.send(26,wherex)
- os.sleep(1)
- rednet.send(26,wherez)
- end
- function cycle2()
- for i = 1,15 do
- cycle()
- wherez = wherez + 1
- end
- end
- function cycle3()
- for i = 1,15 do
- cycle2()
- wherex = wherex + 1
- end
- end
- ----
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement