Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("menusys")
- choice_state = {
- [1] = { false, false },
- [2] = { false, false },
- }
- function choice_concat(text,x,y)
- if choice_state[x][y] == true then
- return text .. " " .. x .. "-" .. y .. " [ON]"
- else
- return text .. " " .. x .. "-" .. y .. " [OFF]"
- end
- end
- choices = { }
- for xkey,xvalue in ipairs(choice_state) do
- choices[xkey] = { }
- for ykey,yvalue in ipairs(xvalue) do
- choices[xkey][ykey] = function() return choice_concat("NODE",xkey,ykey) end
- end
- end
- x = 1
- y = 1
- while true do
- x,y = menusys.displayMenuMult(choices,"Test Functions","Test Functions",x,y)
- if x == 0 then
- exit()
- else
- if choice_state[x][y] == true then
- choice_state[x][y] = false
- else choice_state[x][y] = true
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement