Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dir=0
- x=0
- y=0
- z=0
- local i=0
- local j=0
- modem = peripheral.wrap("left")
- function hugoDebug()
- modem.transmit(3, 1337, x.." "..y)
- end
- function hugoSurfaceMove()
- hugoDebug()
- if turtle.forward() then
- while turtle.detectDown()~=true do
- if turtle.down() then z=z-1 end
- end
- if dir%4==0 then x=x+1 end
- if dir%4==1 then y=y+1 end
- if dir%4==2 then x=x-1 end
- if dir%4==3 then y=y-1 end
- else
- while turtle.detect() do
- if turtle.up() then z=z+1 end
- end
- end
- end
- turtle.refuel()
- for i=0,math.random(3,5) do
- for j=0,math.random(0,3) do
- turtle.turnRight()
- dir=dir+1
- end
- for j=0,math.random(5,10) do
- hugoSurfaceMove()
- end
- end
- turtle.up()
- turtle.down()
- if y<0 then
- while dir%4~=1 do
- turtle.turnRight()
- dir=dir+1
- end
- while y<0 do hugoSurfaceMove() end
- end
- if y>0 then
- while dir%4~=3 do
- turtle.turnRight()
- dir=dir+1
- end
- while y>0 do hugoSurfaceMove() end
- end
- if x<0 then
- while dir%4~=0 do
- turtle.turnRight()
- dir=dir+1
- end
- while x<0 do hugoSurfaceMove() end
- end
- if x>0 then
- while dir%4~=2 do
- turtle.turnRight()
- dir=dir+1
- end
- while x>0 do hugoSurfaceMove() end
- end
Advertisement
Add Comment
Please, Sign In to add comment