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

bios:338: [string "wood.txt"]:39: 'end' expected

Started by unzzenedy, 17 May 2013 - 01:40 AM
unzzenedy #1
Posted 17 May 2013 - 03:40 AM
can u guys find any mistakes? Pls reply!
When i run the program "Wood.txt" this show up:
bios:338: [string "wood.txt"]:39: 'end' expected (to close 'function' at line 7)

Here the code:

function fixaFuel()
if turtle.getFuelLevel < 100 then
turtle.select(16)
turtle.refuel(1)
end

function fixaBoneMeal()
if turtle.getItemCount(2) == 0 then
print "Fixa mer BoneMeal!"
end

function plantera()
turtle.forward()
turtle.forward()
turtle.select(1)
turtle.place()
turtle.turnRight()
turtle.forward()
turtle.turnLeft()
turtle.place()
turtle.turnLeft()
turtle.forward()
turtle.turnRight()
turtle.turnRight()
turtle.place()
turtle.turnRight()
turtle.forward()
for slot=3,10 do
turtle.select(slot)
turtle.drop()
end

turtle.turnLeft()
turtle.turnLeft()
turtle.select(1)
turtle.place()
turtle.select(2)
turtle.place()
end
OmegaVest #2
Posted 17 May 2013 - 10:49 AM

function func(param)
  while true do
	if not true then
	  -- Comment
	elseif blue then
	  -- New Comment
	else
	  -- Last Comment
	end
  end
end


Make sure you have enough ends for the function, loop and if blocks you open. Presently you have just nested all of the following functions into fixaFuel.
CtrlAltElite #3
Posted 17 May 2013 - 01:30 PM
The end at the veeeerry bottom is not needed.

turtle.turnLeft()
turtle.turnLeft()
turtle.select(1)
turtle.place()
turtle.select(2)
turtle.place()
-- Not needed!
end

Hope I helped! ~CtrlAltElite