Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- --Aperture OS
- --this program acts as the base program for majority of my new programs, it handles startup, editing, etc
- --this program is for minecraft 1.16.5, CC Tweaked
- settings.load("SystemSettings")
- local w,h = term.getSize()
- local Version = "1.0"
- function CenterText(y,text)
- local x = math.floor((w - string.len(text)) /2)
- term.setCursorPos(x,y)
- term.clearLine()
- term.write(text)
- end
- local nOption = 1
- local function drawMenu()
- term.clear()
- term.setCursorPos(1,1)
- term.write("APERTURE OS v"..Version)
- term.setCursorPos(1,20)
- term.write("NEW MENU SCRIPT BEING DEVELOPED TO ALLOW COMBINATION OF BOTH MENU AND APP MENU")
- term.setCursorPos(1,2)
- shell.run("id")
- term.setCursorPos(w-11,1)
- if nOption == 1 then
- term.write("Command (WIP DONT USE)")
- elseif nOption == 2 then
- term.write("Programs")
- elseif nOption == 3 then
- term.write("Shutdown")
- elseif nOption == 4 then
- term.write("Find Update")
- else
- end
- end
- --gui
- term.clear()
- local function drawFrontend()
- CenterText( math.floor(h/2) - 3, "")
- CenterText( math.floor(h/2) - 2, "Start Menu")
- CenterText( math.floor(h/2) - 8, "")
- CenterText( math.floor(h/2) + 0, ((nOption == 1) and "[ Command ]") or "Command" )
- CenterText( math.floor(h/2) + 1, ((nOption == 2) and "[ Programs ]") or "Programs" )
- CenterText( math.floor(h/2) + 2, ((nOption == 3) and "[ Shutdown ]") or "Shutdown" )
- CenterText( math.floor(h/2) + 3, ((nOption == 4) and "[ Find Update ]") or "Find Update" )
- CenterText( 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 == 200 then
- if nOption < 4 then
- nOption = nOption + 1
- drawMenu()
- drawFrontend()
- end
- elseif key == 28 then
- break
- end
- end
- end
- term.clear()
- --conditions
- if nOption == 1 then --console
- shell.run("ApertureOS_ClientConsole") --client side Console
- elseif nOption == 2 then --programs
- shell.run("ApertureOS_ApplicationMenu") --client side App Menu
- elseif nOption == 3 then --shutdown
- shell.run("ShutdownPrompt")
- elseif nOption == 4 then --find updates
- shell.run("") --client side update search
- end
Add Comment
Please, Sign In to add comment