Posted 13 April 2016 - 07:47 AM
Spoiler
function deposit()
turtle.select(2)
turtle.dropDown()
end
function chop()
local success,data = turtle.inspect()
if data.name == "minecraft:log"
then
turtle.dig()
turtle.forward()
while turtle.detectUp() == true
do
turtle.digUp()
turtle.up()
end
while turtle.detectDown() == false do
turtle.down()
end
turtle.back()
turtle.select(3)
turtle.place()
turtle.select(1)
end
end
function fuellevel()
local fuel = turtle.getFuelLevel()
if fuel<20 then
turtle.select(1)
turtle.refuel(1)
end
end
function movealong()
for i=1,3,1 do
leftright()
turtle.forward()
turtle.forward()
end
end
function leftright()
turtle.turnLeft()
chop()
turtle.turnRight()
turtle.turnRight()
chop()
turtle.turnLeft()
end
function actualmove()
movealong()
leftright()
turtle.forward()
deposit()
turtle.forward()
movealong()
end
function turnright()
turtle.forward()
deposit()
turtle.turnRight()
turtle.forward()
turtle.forward()
turtle.turnRight()
turtle.forward()
end
function turnleft()
turtle.forward()
deposit()
turtle.turnLeft()
turtle.forward()
turtle.forward()
turtle.turnLeft()
turtle.forward()
end
function loopdelooping()
for tempvalue=1,3,1 do
actualmove()
turnright()
actualmove()
turnleft()
end
actualmove()
turnright()
actualmove()
turtle.forward()
turtle.deposit()
turtle.turnRight()
for h=1,14,1 do
turtle.forward()
end
turtle.turnRight()
turtle.forward()
end
function suckmeup()
turtle.suck()
end
local chopme = true
while chopme do
fuelcheck()
loopdelooping()
suckmeup()
turtle.suckup()
end
My problem is that in my while statement it doesn't want to seem to execute turtle.suck and it only goes around one time. What am I doing wrong?
Sorry if my code is a bit messy and thanks in advance.