Posted 31 December 2012 - 02:49 PM
Hi, I'm making a lumberjack program that,
Cuts down a tree, puts wood into a chest then replants sapling and bone meals it.
I am having this error
line 11 'do' expected
and i have no idea whats causing it
Please Post Fixes
And here is my code
Thanks in Advance
Cuts down a tree, puts wood into a chest then replants sapling and bone meals it.
I am having this error
line 11 'do' expected
and i have no idea whats causing it
Please Post Fixes
And here is my code
H = 8
Error = 0
local function checkFuel()
if turtle.getFuelLevel() < 20 then
turtle.select(16)
turtle.refuel(1)
end
end
while turtle.compare(15) = true and H == 8 do
checkFuel()
turtle.dig()
turtle.forward()
H = H - 1
print("Starting To Chop Tree")
end
while turtle.compare(15) = false and H == 8 and Error ~= 3 do
turtle.select(2)
turtle.place()
turtle.select(3)
turtle.place()
Error = Error + 1
end
while H == 7 do
checkFuel()
turtle.digUp()
turtle.up()
H = H - 1
end
while H == 6 do
checkFuel()
turtle.digUp()
turtle.up()
H = H - 1
end
while H == 5 do
checkFuel()
turtle.digUp()
turtle.up()
H = H - 1
end
while H == 4 do
checkFuel()
turtle.digUp()
turtle.up()
H = H - 1
end
while H == 3 do
checkFuel()
turtle.digUp()
turtle.up()
H = H - 1
end
while H == 2 do
checkFuel()
turtle.digUp()
turtle.up()
H = H - 1
end
while H == 1 do
checkFuel()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
H = H - 1
print("Tree Chopped Successfully")
end
while H == 0 do
checkFuel()
turtle.turnRight()
turtle.turnRight()
turtle.forward()
turtle.select(1)
turtle.drop()
checkFuel()
turtle.turnRight()
turtle.turnRight()
turtle.select(2)
turtle.place()
turtle.select(3)
turtle.place()
H == 8
end
while Error == 3 do
print(" !!!!!Error Detected!!!!!")
print(" Please Check Supplies")
print(" And Click The Mouse")
local event, param1 = os.pullEvent ("mouse_click")
if param1 == true then
os.reboot()
end
Thanks in Advance