Advertisement
DanielLaby99

Exit

Mar 17th, 2013
968
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.32 KB | None | 0 0
  1. shell.run("clear")
  2. opcje = {}
  3. wybor = 1
  4. opcje[1] = "Ja  "
  5. opcje[2] = "Nein"
  6.  
  7.  
  8. function uruchom(numer)
  9.  
  10. if numer == 1 then
  11. shell.run("/disk/laby/deinstall")
  12. end
  13.  
  14. if numer == 2 then
  15. shell.run("/disk/Laby/setup")
  16. end
  17. end
  18.  
  19. function Taste()
  20.  sleep(0)
  21.  event, argument = os.pullEvent()
  22.  if event == "key" then
  23.   if argument == 28 then
  24.    return uruchom(wybor)
  25.   elseif argument == 200 then
  26.    if wybor == 1 then
  27.    else
  28.     wybor = wybor - 1
  29.    end
  30.   elseif argument == 208 then
  31.    if wybor == table.getn(opcje) then
  32.    else
  33.     wybor = wybor + 1
  34.    end
  35.   else
  36.    return Taste()
  37.   end
  38.  else
  39.   return Taste()
  40.  end
  41.  return menu()
  42. end
  43.  
  44. function menu()
  45.  shell.run("clear")
  46. print("                Willkommen im Setup")
  47. print("---------------------------------------------------")
  48. print("           LabyOS ist bereits installiern.         ")
  49. print("                  Deinstallieren?                  ")
  50. print("---------------------------------------------------")
  51.  
  52.  for i=1, table.getn(opcje) do
  53.   if wybor == i then
  54.    print(" Auswahl> "..opcje[i].."   :")
  55.   else
  56.    print("          "..opcje[i].."   :")
  57.   end
  58.  end
  59.     print("---------------------------------------------------")
  60.     term.setCursorPos(15,9)
  61.     print("Press Enter to next step")
  62.  return Taste()
  63. end
  64. shell.run("clear")
  65. return menu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement