This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
FafCereBrate's profile picture

Yep, another broken lumberjack

Started by FafCereBrate, 16 December 2012 - 01:57 PM
FafCereBrate #1
Posted 16 December 2012 - 02:57 PM
i have written my own lumberjack code.
yes, i know there are plenty out there that work
but i just wanted to write my own
practice my turtle skills

the error is

bios:338: [string "tree"]:14: '<eof>' expected

and the code is

local function checkFuel()
  if turtle.getFuelLevel() < 1 then
	turtle.select(1)
	turtle.refuel(1)
	turtle.select(2)
  end
end

local function lumber()
  if turtle.digUp() then
	checkFuel()
	turtle.up()
  end
end

local height = 0

turtle.select(2)
turtle.dig()
turtle.forward()
while turtle.compareUp() do
  lumber()
  height = height+1
end

while height > 0 do
  checkFuel()
  turtle.down()
  height = height-1
end
turtle.back()

slot 1 is where i put my fuel
and slot 2 is where i put my sample logs
theoriginalbit #2
Posted 16 December 2012 - 03:04 PM
looks fine to me. is this the whole program? <eof> normally means it thinks your missing or have an extra end somewhere.

also just an FYI since a few ppl haven't know turtle.refuel(1) only refuels one coal from the slot's stack.
FafCereBrate #3
Posted 16 December 2012 - 03:08 PM
looks fine to me. is this the whole program? <eof> normally means it thinks your missing or have an extra end somewhere.

yep that is the entire code right from my turtle

also just an FYI since a few ppl haven't know turtle.refuel(1) only refuels one coal from the slot's stack.

before i posted my question i looked through this thread to see if anyone is having a similar problem and came across you saying that.
thank you for the advice
theoriginalbit #4
Posted 16 December 2012 - 03:11 PM
looks fine to me. is this the whole program? <eof> normally means it thinks your missing or have an extra end somewhere.

yep that is the entire code right from my turtle

very odd, unless I keep overlooking it there is no issue.

thank you for the advice

your welcome
FafCereBrate #5
Posted 16 December 2012 - 03:14 PM
looks fine to me. is this the whole program? <eof> normally means it thinks your missing or have an extra end somewhere.

yep that is the entire code right from my turtle

very odd, unless I keep overlooking it there is no issue.

ya i am constantly checking my code but can't find anything
keep switching the order of things too to see if that works
still getting same error
Lyqyd #6
Posted 17 December 2012 - 07:10 AM
Did you retype the code, or copy and paste the whole code out?
FafCereBrate #7
Posted 17 December 2012 - 08:33 PM
Did you retype the code, or copy and paste the whole code out?

i retyped it, but also
i renamed the program with the same exact coding and it worked flawlessly
ChunLing #8
Posted 17 December 2012 - 11:05 PM
You just renamed the file? Or did you retype it in a different file?