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

Error Resolving Problem

Started by Tsa6, 31 December 2012 - 05:19 AM
Tsa6 #1
Posted 31 December 2012 - 06:19 AM
So I am working on a turtle program, and as I was debuging it I came across an error I couldn't make sense of. It was Bios : 388 : [string: "HB1" ] : 36 : Unexpected symbol

So I went to line 36, but all it said was z=true.
Line 36 is part of a function, which is shown below. Could someone please tell me what the error is? I know very little about lua, so I'm probably making some huge mistake here, but I can't seem to find it.



I stink at BB code, so it's just a pic from pastebin.
remiX #2
Posted 31 December 2012 - 06:36 AM
I don't see anything wrong with it but it will need a yield if it fails to refuel multiple times.

Try this?


function stockup(target)
    while turtle.getFuelLevel() < target do
	  turtle.select(1)
	  if not turtle.refuel(1) then
		 print("Insert fuel into slot 1 and press enter")
		 read() -- Yield
	  end
	 sleep(0.1) -- yield
   end
end
Tsa6 #3
Posted 31 December 2012 - 07:32 AM
I tried what you said remiX, and it seemed to remove the error. Thanks for the help.