Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vs = "[BOS 1.2]"
- 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(vs)
- end
- --GUI
- term.clear()
- local function drawFrontend()
- printCentered( math.floor(h/2) - 3, "")
- printCentered( math.floor(h/2) - 2, "Log In Menu" )
- printCentered( math.floor(h/2) - 1, "")
- printCentered( math.floor(h/2) + 0, ((nOption == 1) and "[Boppr]") or "Boppr" )
- printCentered( math.floor(h/2) + 1, ((nOption == 2) and "[Bruh_Itz_Gary]") or "Bruh_Itz_Gary" )
- printCentered( math.floor(h/2) + 2, "")
- 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
- drawFrontend()
- end
- elseif key == 31 or key == 208 then
- if nOption < 4 then
- nOption = nOption + 1
- 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("boppr")
- elseif nOption == 2 then
- shell.run("ios/.programs")
- elseif nOption == 3 then
- os.shutdown()
- else
- shell.run("ios/.UninstallDialog")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement