Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x,y,z=1,1,0
- dir=0
- function Forward()
- while not turtle.forward() do
- 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
- turtle.attackUp()
- end
- z=z+1
- end
- function Down()
- while not turtle.down() do
- 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 SelectTorch()
- for i=1,16 do
- local data=turtle.getItemDetail(i)
- if data and data.name=="minecraft:torch" then
- turtle.select(i)
- break
- end
- end
- 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
- function PlaceTorch()
- local success,data=turtle.inspect()
- if success and data.name=="minecraft:cobblestone" then
- else
- SelectCobble()
- turtle.place()
- Up()
- SelectTorch()
- turtle.place()
- Down()
- end
- end
- function Column()
- for i=1,100 do
- if turtle.detect() then break end
- Forward()
- if (y%4)==0 then
- Left()
- PlaceTorch()
- Right()
- end
- end
- Right() Right()
- while y>1 do Forward() end
- Right() Right()
- end
- while true do
- Left()
- if turtle.detect() then
- Right() Right()
- while x>1 do Forward() end
- Left()
- else
- for n=1,100 do
- Forward()
- if x%3==1 then
- Right()
- Column()
- Left()
- if turtle.detect() then
- Right()
- break
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement