QuickMuffin8782-Alt

Zipmenu Redux (Demo)

Nov 15th, 2020 (edited)
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. os.loadAPI("zipmenu")
  2. local menu = {}
  3. table.insert(menu, "hello")
  4. table.insert(menu, "this is a test menu")
  5. for i = 1, 100 do
  6.     table.insert(menu, "option " .. i)
  7. end
  8. for i = 105, 200, 5 do
  9.     table.insert(menu, "option " .. i)
  10. end
  11. for i = 210, 500, 10 do
  12.     table.insert(menu, "option " .. i)
  13. end
  14. for i = 600, 5000, 100 do
  15.     table.insert(menu, "option " .. i)
  16. end
  17. local menu2 = {}
  18. for a, b in pairs(_G) do
  19.     table.insert(menu2, a)
  20. end
  21.  
  22. zipmenu.setColors(colors.white, colors.cyan, colors.gray, colors.white, colors.yellow)
  23. local choice = zipmenu.drawMenu("Choose a menu to view:", "test menu", "global var menu", "Exit")
  24.  
  25. if choice == 1 then
  26.     print("The choice was " .. zipmenu.drawMenu("test menu", menu) .. "!")
  27. elseif choice == 2 then
  28.     print("The choice was " .. zipmenu.drawMenu("global var menu", menu2) .. "!")
  29. else
  30.     print("Bye!")
  31. end
Add Comment
Please, Sign In to add comment