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

EOF Expected

Started by TechedZombie, 02 May 2015 - 07:42 PM
TechedZombie #1
Posted 02 May 2015 - 09:42 PM
I run my program and I get end of file expected Plz Help! :(/>


function fuel()
  for i = 3, 16 do
	turtle.select(i)
  
	if turtle.refuel(2) == true then
  
	  return true
  
	end
  
  end

  error()

end

function sapSlot()
  turtle.select(2)
  local data = turtle.getItemDetail(2)
  if data.name == "minecraft:sapling" and data.damage == 2 then
  
	icnt = turtle.getItemCount(2)
if icnt ~= 1 then

   return true
  
else

   print("Please Supply More Saplings")
   while turtle.getItemCount(2) <  3 do
  
	 sleep(2)
  
	 end
  
end
  
  else
	error("No Saplings")
  end
end
chopCycle()
  if sapSlot() == true then
turtle.select(2)
turtle.place()
turtle.up()
while turtle.detect() == false do
  
   sleep(5)
  
  
end
turtle.down()
fuel()
shell.run("log2")

  end
end


Lupus590 #2
Posted 02 May 2015 - 09:57 PM
if you re-indent your code, you may realise that you have an extra end
TechedZombie #3
Posted 02 May 2015 - 10:38 PM
Where?
flaghacker #4
Posted 02 May 2015 - 10:49 PM
Where?
At the end. (see what I did there?)

We can't say that, it depend on what code you want to have in what code block. Try indenting you code and see where you messed up.
TechedZombie #5
Posted 02 May 2015 - 11:07 PM
Haha! and thanks!
Square789 #6
Posted 03 May 2015 - 01:49 PM
Please take a look at this when you're about to start a new topic, because you would've found the solution for this problem quicker there, I think.
Edited on 03 May 2015 - 11:49 AM