Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x=0
- t=turtle
- function refuel(n)
- if t.getFuelLevel() <=10 then
- t.select(n)
- t.refuel(1)
- end
- end
- function fwd(st)
- for i=1,st do
- refuel(1)
- while t.detect() do
- while not(t.dig()) do
- t.attack()
- sleep(0.1)
- end
- sleep(0.2)
- end
- t.digDown()
- while t.detectUp() do
- while not(t.digUp()) do
- t.attackUp()
- sleep(0.1)
- end
- end
- if x>=7 then
- t.select(2)
- t.placeDown()
- x=0
- else
- drop(3)
- end
- while not(t.forward()) do
- t.attack()
- sleep(0.1)
- x=x-1
- end
- x=x+1
- end
- end
- function drop(sl)
- if t.getItemCount(16) > 0 then
- t.select(sl)
- t.placeDown()
- for i=4, 16 do
- t.select(i)
- t.dropDown()
- end
- t.select(1)
- end
- end
- print('Length?')
- fwd(tonumber(read()))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement