Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- --Client Program Manager
- --this program allows the user to see all download applications, management using inbuilt tools, start programs, etc
- --this program is for minecraft 1.16.5, cc tweaked
- local AppAmount = 0
- local w, h = term.getSize()
- local AppName = {}
- local AppFile = {}
- local nOption = 0
- function CenterText(y,text)
- local x = math.floor((w - string.len(text)) /2)
- term.setCursorPos(x,y)
- term.clearLine()
- term.write(text)
- end
- function GetApps()
- local file = fs.open("AppList","r")
- local Items = file.readLine(1)
- for i = 1, Items do
- AppName[i] = file.readLine(i*2)
- AppFile[i] = file.readLine(i*2+1)
- end
- file.close()
- end
- function AppList()
- end
- local function drawMenu()
- term.clear()
- if nOption == 0 then
- term.setCursorPos(w-11,1)
- term.write("Exit")
- end
- for i = 1, #AppName do
- if nOption == i then
- term.setCursorPos(w-11,1)
- CenterText(1,AppName[i].." - "..AppFile[i])
- end
- end
- end
- term.clear()
- local function drawFrontend()
- CenterText( math.floor(h/2) - 3, "")
- CenterText( math.floor(h/2) + 3, ((nOption == 0) and "[ Exit ]") or "Exit" )
- for i = 1, #AppName do
- CenterText( math.floor(h/2) + i+4, ((nOption == i) and "[ "..AppName[i].." ]") or AppName[i] )
- end
- end
- GetApps()
- drawMenu()
- drawFrontend()
- while true do
- local event, key = os.pullEvent("key")
- if key == keys.w or key == keys.up then
- nOption = nOption - 1
- elseif key == keys.s or key == keys.down then
- nOption = nOption + 1
- end
- if nOption < 0 then
- nOption = #AppName
- elseif nOption > #AppName then
- nOption = 0
- end
- drawMenu()
- drawFrontend()
- if key == keys.enter then
- break
- end
- end
- if nOption > 0 then
- if nOption == 1 then
- if fs.exists("ApertureDL_AppStore") == nil or fs.exists("ApertureOS_AppStore") == false then
- term.clearLine()
- local x, y = term.getCursorPos()
- term.setCursorPos((w - string.len("Downloading.....done!")/2), y)
- textutils.slowWrite("Downloading...done!")
- shell.run("C_Pastebin","run","SJ9gjJ6H")
- sleep(3)
- shell.run("ApertureDL_AppStore")
- else
- shell.run("ApertureDL_AppStore")
- end
- elseif nOption == 2 then
- shell.run("ApertureOS_SettingsMenu")
- else
- shell.run(AppFile[nOption])
- end
- elseif nOption == 0 then
- shell.run("ApertureOS_Base")
- else
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement