Theshadow989

Test File 6 (passing array part 1)

May 2nd, 2017
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.26 KB | None | 0 0
  1. os.loadAPI("xos/api/menu")
  2.  
  3. local xxMenu,yyMenu = 0,0
  4.  
  5. local menu_options =
  6. {
  7.     [1] = {text="Command ", yMenu=1, xMenu=1, yPos=8, xPos=9, color=colors.yellow},
  8.     [2] = {text="Programs", yMenu=2, xMenu=1, yPos=9, xPos=9, color=colors.yellow},
  9.     [3] = {text="Accounts", yMenu=3, xMenu=1, yPos=10, xPos=9, color=colors.yellow},
  10.     [4] = {text="Details ", yMenu=4, xMenu=1, yPos=11, xPos=9, color=colors.yellow},
  11.     [5] = {text="Shutdown", yMenu=5, xMenu=1, yPos=12, xPos=9, color=colors.red},
  12.     [6] = {text="Settings", yMenu=1, xMenu=2, yPos=8, xPos=21, color=colors.yellow},
  13.     [7] = {text="Scripts ", yMenu=2, xMenu=2, yPos=9, xPos=21, color=colors.yellow},
  14.     [8] = {text="Attacks ", yMenu=1, xMenu=3, yPos=8, xPos=33, color=colors.yellow},
  15.     [9] = {text="Internet", yMenu=2, xMenu=3, yPos=9, xPos=33, color=colors.yellow},
  16.     [10] = {text="ServerFr", yMenu=3, xMenu=3, yPos=10, xPos=33, color=colors.yellow},
  17.     [11] = {text="  Back  ", yMenu=99, xMenu=0, yPos=14, xPos=21, color=colors.blue},
  18.     [12] = {text="Start Menu", yMenu=YY, xMenu=XX, yPos=6, xPos=20, color=colors.white},
  19. }
  20.  
  21. xxMenu,yyMenu = menu.displayMenu(menu_options, true, true) -- menu api call
  22.  
  23. term.clear() -- only for testing purposes
  24. term.setCursorPos(8,9) -- only for testing purposes
  25.  
  26. if yyMenu == 1 and xxMenu == 1 then
  27.     print("You have chosen the 'Command' option.")
  28. elseif yyMenu == 2 and xxMenu == 1 then
  29.     print("You have chosen the 'Programs' option.")
  30. elseif yyMenu == 3 and xxMenu == 1 then
  31.     print("You have chosen the 'Accounts' option.")
  32. elseif yyMenu == 4 and xxMenu == 1 then
  33.     print("You have chosen the 'Details' option.")
  34. elseif yyMenu == 5 and xxMenu == 1 then
  35.     print("You have chosen the 'Shutdown' option.")
  36. elseif yyMenu == 1 and xxMenu == 2 then
  37.     print("You have chosen the 'Settings' option.")
  38. elseif yyMenu == 2 and xxMenu == 2 then
  39.     print("You have chosen the 'Scripts' option.")
  40. elseif yyMenu == 1 and xxMenu == 3 then
  41.     print("You have chosen the 'Attacks' option.")
  42. elseif yyMenu == 2 and xxMenu == 3 then
  43.     print("You have chosen the 'Internet' option.")
  44. elseif yyMenu == 3 and xxMenu == 3 then
  45.     print("You have chosen the 'SeverFr' option.")
  46. elseif yyMenu == 99 and xxMenu == 0 then
  47.     print("You have chosen the 'back' option.")
  48. end
Add Comment
Please, Sign In to add comment