Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function Clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- function TouchCUI(m) --declare function
- n=0
- local l = #m
- while true do
- term.setCursorPos(1,3)
- for i=1, #m, 1 do --traverse the table of options
- print(m[i])
- end
- a, b, c, d = os.pullEvent("mouse_click") --wait for keypress
- for i = 1, #m do
- if d == i + 2 then n = i end
- end
- if n == 0 and d == 1 then n = 50 end
- if n > 0 then break end
- end
- return n, b --return the value
- end
- function SearchMenu(Cat)
- Clear()
- print("Press Enter to Exit")
- local C
- if Cat == "Food" then
- C = "Food"
- elseif Cat == "Entertainment" then
- C = "Enter"
- elseif Cat == "Shops" then
- C = "Shop"
- end
- shell.run(,"Find","Fin"..C)
- repeat
- local event, key = os.pullEvent("key")
- until key == keys.enter
- end
- function Menu()
- term.setBackgroundColor(colors.lightBlue)
- Clear()
- local options = {"Food","Entertainment","Shops","exit"}
- local n = CUI(options)
- if options[n] == "exit" then
- else
- SearchMenu(options[n])
- Menu()
- end
- end
- Menu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement