Posted 28 November 2012 - 01:44 AM
The Code should give me an output with
…..
Menu item
Menu item
Menu item
it also will make a selection mark difind by a string but if i read out the array in cobination with the mark
he will show no selection but a "/" with the MenuItem behind it, why ?
Sry for my English ….. i am German ;D
…..
Menu item
Menu item
Menu item
it also will make a selection mark difind by a string but if i read out the array in cobination with the mark
he will show no selection but a "/" with the MenuItem behind it, why ?
selected = 1
maxEintrag = 3
selectedsymbol = ">> "
reboot = false
pressedOk = 0
term.clear()
local menuEintrage = {"a","b","Exit","d","e"}
function draw()
x = 1
term.clear()
term.setCursorPos(1,1)
while x < maxEintrag + 1 do
if selected == x then
print(fs.combine(selectedsymbol, menuEintrage[x]))
else
print(menuEintrage[x])
end
x = x + 1
end
end
draw()
function click()
if selected == 1 then
end
if slected == 2 then
end
end
repeat
none, key = os.pullEvent ("key")
if key == 208 then
selected = selected + 1
if selected > maxEintrag then
selected = 1
end
draw()
end
if key == 200 then
selected = selected-1
if selected <= 0 then
selected = maxEintrag
end
draw()
end
if key == 28 then
click()
end
until reboot == true
Sry for my English ….. i am German ;D