Posted 29 December 2012 - 12:20 PM
So i have my code working the way i want it but if i run into gravel it gets funny. I just cant find a way to make it so if i cant move forward dig until it can..
Any way to solve?
Thanks Mike
inside the turtle the first slot is fuel, second enderchest, third torch
Any way to solve?
Thanks Mike
function Torch()
turtle.turnRight();
turtle.dig();
turtle.select(3);
turtle.place();
turtle.turnLeft();
end
function Dig()
turtle.dig();
turtle.forward();
turtle.digUp();
if turtle.getFuelLevel() < 2000 then
turtle.refuel(1)
end
end
function Turn()
turtle.turnRight();
turtle.dig();
turtle.select(2);
turtle.place();
for i = 4,16 do
turtle.select(i)
turtle.drop()
end
turtle.select(2);
turtle.dig();
turtle.select(1)
turtle.forward();
turtle.digUp();
turtle.dig();
turtle.forward();
turtle.digUp();
turtle.turnRight();
end
function TurnLeft()
turtle.turnLeft();
turtle.dig();
turtle.select(2);
turtle.place();
for i = 4,16 do
turtle.select(i)
turtle.drop()
end
turtle.select(2);
turtle.dig();
turtle.select(1)
turtle.forward();
turtle.digUp();
turtle.dig();
turtle.forward();
turtle.digUp();
turtle.turnLeft();
end
function Go()
for i=1,8 do
Dig(i)
end
Torch()
end
function Go2()
for i=1,8 do
Go(i)
end
end
function Program()
Go2()
Turn()
Go2()
TurnLeft()
end
function LoopProgram()
local a = 1
repeat
Program(a)
a = a + 1
until a == 5
end
LoopProgram()
inside the turtle the first slot is fuel, second enderchest, third torch