Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- j=0
- i=0
- turtle=1
- max=10
- -- write("Maximale Laenge: ")
- -- max=tonumber(read())
- rednet.open("right")
- function sendPos()
- local x,y,z = gps.locate(5)
- if x then
- rednet.broadcast("[" .. turtle .. "]: (" .. x .. "," .. y .. "," .. z .. ")")
- end
- end
- function fforward()
- while(turtle.forward()==false) do
- turtle.dig()
- end
- end
- function fdigUp()
- while(turtle.detectUp()) do
- turtle.digUp()
- sleep(0.4)
- end
- end
- function placeTorch()
- turtle.turnRight()
- turtle.turnRight()
- turtle.select(2)
- turtle.place()
- turtle.turnRight()
- turtle.turnRight()
- j=0
- end
- function step()
- fforward()
- fdigUp()
- turtle.select(1)
- turtle.placeDown()
- if(j>12) then
- placeTorch()
- end
- j=j+1
- end
- while(i<max) do
- for k=1,i do
- step()
- end
- i=i+2
- turtle.turnRight()
- sendPos()
- end
- rednet.close("right")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement