Advertisement
Marlingaming

CC Tweaked CCSPS 2.0.0 - RoPla App

Feb 16th, 2022 (edited)
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. local function Clear()
  2. term.clear()
  3. term.setCursorPos(1,1)
  4. end
  5.  
  6. function TouchCUI(m) --declare function
  7. n=0
  8. local l = #m
  9. while true do
  10. term.setCursorPos(1,3)
  11. for i=1, #m, 1 do --traverse the table of options
  12. print(m[i])
  13. end
  14. a, b, c, d = os.pullEvent("mouse_click") --wait for keypress
  15. for i = 1, #m do
  16. if d == i + 2 then n = i end
  17. end
  18. if n == 0 and d == 1 then n = 50 end
  19. if n > 0 then break end
  20. end
  21. return n, b --return the value
  22. end
  23.  
  24. function SearchMenu(Cat)
  25. Clear()
  26. print("Press Enter to Exit")
  27. local C
  28. if Cat == "Food" then
  29. C = "Food"
  30. elseif Cat == "Entertainment" then
  31. C = "Enter"
  32. elseif Cat == "Shops" then
  33. C = "Shop"
  34. end
  35. shell.run(,"Find","Fin"..C)
  36. repeat
  37. local event, key = os.pullEvent("key")
  38. until key == keys.enter
  39. end
  40.  
  41. function Menu()
  42. term.setBackgroundColor(colors.lightBlue)
  43. Clear()
  44. local options = {"Food","Entertainment","Shops","exit"}
  45. local n = CUI(options)
  46. if options[n] == "exit" then
  47.  
  48. else
  49. SearchMenu(options[n])
  50. Menu()
  51. end
  52. end
  53.  
  54. Menu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement