Jump to content




EOF Expected

turtle lua

5 replies to this topic

#1 TechedZombie

  • Members
  • 43 posts
  • LocationIA, USA

Posted 02 May 2015 - 08: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




#2 Lupus590

  • Members
  • 2,029 posts
  • LocationUK

Posted 02 May 2015 - 08:57 PM

if you re-indent your code, you may realise that you have an extra end

#3 TechedZombie

  • Members
  • 43 posts
  • LocationIA, USA

Posted 02 May 2015 - 09:38 PM

Where?

#4 flaghacker

  • Members
  • 655 posts

Posted 02 May 2015 - 09:49 PM

 TechedZombie, on 02 May 2015 - 09:38 PM, said:

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.

#5 TechedZombie

  • Members
  • 43 posts
  • LocationIA, USA

Posted 02 May 2015 - 10:07 PM

Haha! and thanks!

#6 Square789

  • Members
  • 39 posts
  • LocationUniverse:C:/MilkyWay/Sol/Earth/Europe/Germany

Posted 03 May 2015 - 12: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 by Square789, 03 May 2015 - 12:49 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users