Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function moveForward()
- while not turtle.forward() do
- end
- end
- function moveUp()
- while not turtle.up() do
- end
- end
- function moveDown()
- while not turtle.down() do
- end
- end
- local function campoGrano(numero)
- if numero == 0 or numero == 1 or numero == 2 or numero == 7 or numero == 8 or numero == 9 then
- turtle.select(1)
- elseif numero == 3 or numero == 4 then
- turtle.select(2)
- elseif numero == 5 or numero == 6 then
- turtle.select(3)
- end
- for c1=0, 3, 1 do
- for c2=0, 7, 1 do
- turtle.digDown()
- turtle.placeDown()
- if c2~=7 then
- moveForward()
- end
- end
- if c1~=3 then
- if c1==0 or c1==2 then
- turtle.turnLeft()
- moveForward()
- turtle.turnLeft()
- elseif c1==1 then
- turtle.turnRight()
- moveForward()
- turtle.turnRight()
- end
- end
- end
- end
- local function transizione1()
- turtle.turnRight()
- for c1=0, 1, 1 do
- moveForward()
- end
- turtle.turnRight()
- end
- local function transizione2()
- turtle.turnRight()
- for c1=0, 2, 1 do
- moveUp()
- end
- for c1=0, 3, 1 do
- moveForward()
- end
- for c1=0, 2, 1 do
- moveDown()
- end
- turtle.turnRight()
- end
- local function transizione3()
- for c1=0, 2, 1 do
- moveUp()
- end
- for c1=0, 3, 1 do
- moveForward()
- end
- for c1=0, 2, 1 do
- moveDown()
- end
- end
- local function startF()
- turtle.turnLeft()
- for c=1, 3, 1 do
- turtle.select(c)
- turtle.suck()
- end
- turtle.turnRight()
- for c1=0, 2, 1 do
- moveUp()
- end
- for c1=0, 1, 1 do
- moveForward()
- end
- turtle.turnRight()
- moveForward()
- for c1=0, 2, 1 do
- moveDown()
- end
- end
- local function endF()
- for c1=0, 2, 1 do
- moveUp()
- end
- for c1=0, 2, 1 do
- moveForward()
- end
- turtle.turnRight()
- for c1=0, 1, 1 do
- moveForward()
- end
- for c1=0, 2, 1 do
- moveDown()
- end
- turtle.turnRight()
- for c=1, 16, 1 do
- turtle.select(c)
- turtle.drop()
- end
- turtle.turnRight()
- end
- if turtle.getFuelLevel() > 100 then
- for c1=0, 9, 1 do
- if c1==0 then
- startF()
- end
- campoGrano(c1)
- if c1==1 or c1==3 or c1==5 or c1==7 then
- transizione1()
- end
- if c1==0 or c1==2 or c1==6 or c1==8 then
- transizione2()
- end
- if c1==4 then
- transizione3()
- end
- if c1==9 then
- endF()
- end
- end
- else
- print("Too low fuel!")
- end
Advertisement
Add Comment
Please, Sign In to add comment