Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- opcje = {}
- wybor = 1
- opcje[1] = "Wylacz komputer"
- opcje[2] = "Zrestartuj komputer"
- opcje[3] = "Pokaz moje programy"
- opcje[4] = "Narysuj cos"
- opcje[5] = "Pokaz wszystkie programy"
- opcje[6] = "Zagraj w weza"
- opcje[7] = "Przejdz do trybu ,,Lua,,"
- opcje[8] = "Wyswietl czas gry"
- opcje[9] = "Zagraj w ,,Przygode,,"
- opcje[10] = "Zamknij menu"
- function uruchom(numer)
- if numer == 1 then
- shell.run("shutdown")
- elseif numer == 2 then
- shell.run("koniec")
- elseif numer == 3 then
- shell.run("ls")
- elseif numer == 4 then
- shell.run("paint oVca")
- elseif numer == 5 then
- shell.run("programs")
- elseif numer == 6 then
- shell.run("worm")
- elseif numer == 7 then
- shell.run("lua")
- elseif numer == 8 then
- shell.run("time")
- elseif numer == 8 then
- shell.run("adventure")
- elseif numer == 10 then
- else
- wybor = 1
- return menu()
- end
- end
- function przycisk()
- sleep(0.05)
- event, argument = os.pullEvent()
- if event == "key" then
- if argument == 28 then
- return uruchom(wybor)
- elseif argument == 200 then
- if wybor == 1 then
- else
- wybor = wybor - 1
- end
- elseif argument == 208 then
- if wybor == table.getn(opcje) then
- else
- wybor = wybor + 1
- end
- else
- return przycisk()
- end
- else
- return przycisk()
- end
- return menu()
- end
- function menu()
- shell.run("clear")
- for i=1, table.getn(opcje) do
- if wybor == i then
- print("-> "..opcje[i].." <-")
- else
- print(opcje[i])
- end
- end
- return przycisk()
- end
- shell.run("clear")
- return menu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement