Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- menuStat = 0
- repeat
- term.clear() -- Clear the screen
- term.setCursorPos(1,1) -- Set the cursor pos
- print "Select your langauge" -- Message to print above the menu
- pressedOk = false
- if menuStat == 1 then
- print[[> Francais - French]] -- Text to show if the cursor is on the first choice
- print[[ English - Anglais]]
- elseif menuStat == 2 then
- print[[ Francais - French]] -- Text to show if the cursor is on the second choice
- print[[> English - Anglais]]
- end
- event, param1 = os.pullEvent("key")
- if param1 == 208 then menuStat = menuStat + 1
- elseif param1 == 200 then menuStat = menuStat - 1
- elseif param1 == 28 then pressedOk = true end
- if menuStat == 3 then menuStat = 1
- elseif menuStat == 0 then menuStat = 2 end
- until pressedOk == true
- menuStat = tostring(menuStat)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement