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

bios:338:[string "dig"]:10; '<eof>' expected

Started by BB20101997, 11 May 2013 - 01:38 PM
BB20101997 #1
Posted 11 May 2013 - 03:38 PM

funktion1=funktion()
local m = "none"
local r = "STOP"
local s
local z
while m~=r do
s,m,z = rednet.receive()
end

end

funktion2=funktion()

  while true do

   for i = 0,15,1 do

	turtle.select(i)
	turtle.drop()

  end

end

end

turtle.select(0)
turtle.place()
turtle.turnLeft(2)

local t=1

while t==1 do
t = parallel.waitForAny(function1,function2)
end

for i = 0,15,1 do

  turtle.select(i)
  turtle.drop()

end

turtle.select(0)
turtle.turnLeft(2)
turtle.dig()

need help,pleas,don´t know what " '<eof>' expected " means and how to fix it
Edited by
Lyqyd #2
Posted 11 May 2013 - 04:45 PM
Split into new topic.
Engineer #3
Posted 11 May 2013 - 04:53 PM
For future reference, please use [code][/code] Tags for future reference.
Also when you have a long code to show, please upload it to pastebin or post it in between [spoiler] [/spoiler] tags.
Example:

Spoiler

Heey, this is a very long code!

Now to get back on your problem:

I have re indented your code for you:
Spoiler

funktion1 = function() --# funktion should be function, any chance you are German?:P/>
	local m = "none"
	local r = "STOP"
	--#local s You cant do anything with those, so I commented them out
	--#local z
	while m~=r do
		s,m,z = rednet.receive()
	end
end

funktion2=function() --# funktion should be function
	while true do
		for i = 0,15,1 do
			turtle.select(i)
			turtle.drop()
		end
	end
end

turtle.select(0)
turtle.place()
turtle.turnLeft(2)

local t=1
while t==1 do
	t = parallel.waitForAny(function1, function2)
end
for i = 0,15,1 do
	turtle.select(i)
	turtle.drop()
end

turtle.select(0)
turtle.turnLeft(2)
turtle.dig()

And <eof> generally means that you have an end too much or too few ends. Because you named you functions funktions, lua thought it was nil. Then it saw an end too much and thought: "What can I do with that?".

But the code in the spoiler should work :)/>
BB20101997 #4
Posted 13 May 2013 - 10:10 AM
Your right i am German,thank you