Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Oprogramowanie skladowe/instalator systemow/czesc skladowa stworzonych przez uzytkownika serwisu Discord - Wisnia#5536 --
- -- Jesli zaplaciles za to oprogramowanie zostales oszukany. --
- -- Zakazuje sie kopiowania oprogramowania bez zgody autora, czerpania korzysci materialnych, podpisywania sie pod oprogramowaniem --
- -- Dozwolone jest tworzenie modyfikacji oprogramowania badz jego czesci wylacznie wtedy, gdy widoczna jest informacja o oryginalnym autorze --
- -- Kompletna EULA dostepna jest na serwerze Discord: CRfXMXU --
- os.pullEvent = os.pullEventRaw
- local w,h = term.getSize()
- function printCentered( y,s )
- local x = math.floor((w - string.len(s)) / 2)
- term.setCursorPos(x,y)
- term.clearLine()
- term.write( s )
- end
- local nOption = 1
- local function drawMenu()
- term.clear()
- term.setCursorPos(1,1)
- term.write("Minedows v2.0 ")
- term.setCursorPos(w-11,1)
- if nOption == 1 then
- term.write("CMD")
- elseif nOption == 2 then
- term.write("Programy")
- elseif nOption == 3 then
- term.write("Wylacz ")
- else
- end
- end
- --GUI
- term.setBackgroundColor(colors.cyan)
- term.clear()
- term.setBackgroundColor(colors.cyan)
- term.setTextColor(colors.white)
- local function drawFrontend()
- printCentered( math.floor(h/2) - 3, "")
- printCentered( math.floor(h/2) - 2, "Menu Start" )
- printCentered( math.floor(h/2) - 1, "")
- printCentered( math.floor(h/2) + 0, ((nOption == 1) and "[ CMD ]") or "CMD" )
- printCentered( math.floor(h/2) + 1, ((nOption == 2) and "[ Programy ]") or "Programy" )
- printCentered( math.floor(h/2) + 2, ((nOption == 3) and "[ Wylacz ]") or "Wylacz" )
- printCentered( math.floor(h/2) + 4, "")
- end
- --Display
- drawMenu()
- drawFrontend()
- while true do
- local e,p = os.pullEvent()
- if e == "key" then
- local key = p
- if key == 17 or key == 200 then
- if nOption > 1 then
- nOption = nOption - 1
- drawMenu()
- drawFrontend()
- end
- elseif key == 31 or key == 208 then
- if nOption < 4 then
- nOption = nOption + 1
- drawMenu()
- drawFrontend()
- end
- elseif key == 28 then
- --End should not be here!!
- break
- end --End should be here!!
- end
- end
- term.clear()
- --Conditions
- if nOption == 1 then
- shell.run("os/.cmd")
- elseif nOption == 2 then
- shell.run("os/.programy")
- elseif nOption == 3 then
- os.shutdown()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement