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

I dont know what's wrong (Menu Programm)

Started by Radioaktiv3, 27 November 2012 - 09:03 AM
Radioaktiv3 #1
Posted 27 November 2012 - 10:03 AM

selected = 0
maxEintrag = 3
selectedsymbol = ">> "
reboot = false
term.clear()
local menuEintrage = {"a","b","c","d","e"}
function draw()
		print("")
		x = 0
		while not x == maxEintrag do
			if selected == 0 then
			print(fs.combine(selectedsymbol , menuEintrage[x]))
			else
			print(fs.combine("" , menuEintrage[x]))
			end
			x = x + 1
		end
end

--------------------------------------------------------------------- All Lines below are "wrong" ( a "=" is expected)

repeate
	none, key = os.pullEvent ("key")
	if key == 208 then
		selected = selected + 1
		   if selected > maxEintrag then
			  selected = 0
		   end
		elseif key == 200 then
			selected = selected - 1
				if selected < 0 then
					  selected = maxEintrag
				end
		end
	end

until reboot == true





Whats wrong ?

I tryed every thing and find no solution.


Sry for my bad English i am German ;D
GopherAtl #2
Posted 27 November 2012 - 10:05 AM
"repeate" should be just "repeat."

"repeate" is undefined so it's interpreting it as a variable name, and expecting you to set it to something, so, "= expected"
OmegaVest #3
Posted 27 November 2012 - 10:05 AM
repeate is supposed to be repeat.

EDIT: Drat! Ninja'd again.