Advertisement
Guest User

GUI

a guest
Apr 29th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.94 KB | None | 0 0
  1. pos = 1
  2. gui = 1
  3. e = 0
  4.  
  5. function Action()
  6.  
  7. if gui == 1 and pos == 2 then
  8.  
  9.  
  10.  
  11. end
  12.  
  13.  
  14. end
  15.  
  16. function Event()
  17. event, key = os.pullEvent("key")
  18.  
  19. if gui == 1 then e = 3 end  
  20.      
  21.   if key == 208 and pos < e then
  22.  
  23.   pos = pos + 1
  24.  
  25.   end
  26.  
  27.   if key == 200 and pos > 1 then
  28.  
  29.   pos = pos - 1
  30.  
  31.   end
  32.  
  33.   if key == 28 then
  34.  
  35.   Action()
  36.  
  37.   end
  38.  
  39.  
  40. if gui == 1 then mainMenu() end
  41.  
  42. end
  43.  
  44.  
  45. function mainMenu()
  46.  
  47.   term.clear()
  48.   term.setCursorPos(1, 1)
  49.   print("Hauptmenu")
  50.   term.setCursorPos(1,3)
  51.  
  52.   if pos == 1 then
  53.    
  54.     print(" >Programme")
  55.     print(" Systemsteuerung")
  56.     print(" Konsole")
  57.    
  58.   end
  59.  
  60.   if pos == 2 then
  61.    
  62.     print(" Programme")
  63.     print(" >Systemsteuerung")
  64.     print(" Konsole")
  65.  
  66.   end
  67.  
  68.   if pos == 3 then
  69.    
  70.     print(" Programme")
  71.     print(" Systemsteuerung")
  72.     print(" >Konsole")
  73.    
  74.   end
  75.  
  76. end
  77.  
  78. mainMenu()
  79. while true do
  80. Event()
  81. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement