Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x,y,z=1,1,0
- dir=0
- count=turtle.getItemCount(1)
- function Dig()
- local success,data=turtle.inspect()
- if success and not (data.name=="computercraft:turtle_expanded") then
- while turtle.detect() do
- turtle.dig()
- end
- end
- end
- function DigUp()
- local success,data=turtle.inspectUp()
- if success and not (data.name=="computercraft:turtle_expanded") then
- turtle.digUp()
- end
- end
- function DigDown()
- local success,data=turtle.inspectDown()
- if success then
- if data.name=="minecraft:bedrock" then return false
- elseif data.name=="computercraft:turtle_expanded" then
- else turtle.digDown()
- end
- end
- return true
- end
- function Forward()
- while not turtle.forward() do
- Dig()
- turtle.attack()
- end
- if (dir%2)==0 then y=y+1-(dir%4)
- else x=x+2-(dir%4)
- end
- end
- function Up()
- while not turtle.up() do
- DigUp()
- turtle.attackUp()
- end
- z=z+1
- end
- function Down()
- while not turtle.down() do
- DigDown()
- turtle.attackDown()
- end
- z=z-1
- end
- function Right()
- turtle.turnRight()
- dir=(dir-1)%4
- end
- function Left()
- turtle.turnLeft()
- dir=(dir+1)%4
- end
- function SelectCobble()
- for i=1,16 do
- local data=turtle.getItemDetail(i)
- if data and data.name=="minecraft:cobblestone" then
- turtle.select(i)
- break
- end
- end
- end
- if count>0 then
- turtle.select(1)
- DigDown() Down()
- DigDown() Down()
- DigDown()
- Left()
- for i=1,3*count do
- if (x%3)==0 then
- DigUp() turtle.placeUp()
- end
- Dig() Forward() DigDown()
- end
- DigUp() Up() DigUp() Up() DigUp() Up()
- Right() Dig() Forward() Right()
- while x>1 do
- DigUp()
- SelectCobble() turtle.placeUp()
- Dig() Forward()
- end
- SelectCobble() turtle.placeUp()
- Left()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement