Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Functions
- function s(...) return sleep(...) end
- function w(...) return write(...) end
- function p(...) return print(...) end
- function tw(...) return term.write(...) end
- function scp(...) return term.setCursorPos(...) end
- function sbc(...) return term.setBackgroundColor(...) end
- function stc(...) return term.setTextColor(...) end
- function tc(...) return term.clear(...) end
- function tcl(...) return term.clearLine() end
- function scb(...) return term.setCursorBlink(...) end
- function ts(...) return term.scroll(...) end
- function r(...) return shell.run(...) end
- function para(...) return parallel.waitForAny(...) end
- function sw(...) return textutils.slowWrite(...) end
- function sp(...) return textutils.slowPrint(...) end
- local function options()
- while true do
- local event, key = os.pullEvent("key")
- if key == keys.left then
- option = "1"
- sbc( colors.green )
- scp(17,12)
- term.write("[Yes]")
- scp(36,12)
- sbc( colors.red )
- w([[ No ]])
- elseif key == keys.right then
- option = "2"
- scp(36,12)
- sbc( colors.red )
- term.write("[No]")
- sbc( colors.green )
- scp(17,12)
- w([[ Yes ]])
- elseif key == keys.enter and option == "2" then
- shell.run('Services/AdvancedBoot')
- elseif key == keys.enter and option == "1" then
- sleep(1)
- sbc(1)
- term.clear()
- os.reboot()
- end
- end
- end
- local function update()
- while true do
- local event, key = os.pullEvent("key")
- if key == keys.left then
- option = "1"
- sbc( colors.green )
- scp(17,12)
- term.write("[Yes]")
- scp(36,12)
- sbc( colors.red )
- w([[ No ]])
- elseif key == keys.right then
- option = "2"
- scp(36,12)
- sbc( colors.red )
- term.write("[No]")
- sbc( colors.green )
- scp(17,12)
- w([[ Yes ]])
- elseif key == keys.enter and option == "2" then
- shell.run('Services/AdvancedBoot')
- elseif key == keys.enter and option == "1" then
- shell.run('disk/Updates/UpdaterProgram')
- sleep(10)
- os.reboot()
- end
- end
- end
- local function reboot()
- while true do
- local event, button, X, Y = os.pullEvent("mouse_click")
- if X >= 20 and X <= 28 and Y == 8 then
- sbc(1)
- term.clear()
- scp(15,8)
- sbc( colors.blue )
- w([[ ]])
- sbc( colors.lightGray )
- scp(15,9)
- w([[ Are You Sure You Want ]])
- scp(15,10)
- w([[ To Reboot? ]])
- scp(15,11)
- w([[ ]])
- scp(15,12)
- w([[ ]])
- sbc( colors.green )
- scp(17,12)
- w([[ Yes ]])
- scp(36,12)
- sbc( colors.red )
- w([[ No ]])
- options()
- elseif X >= 20 and X <= 29 and Y == 10 then
- sbc(1)
- term.clear()
- scp(15,8)
- sbc( colors.blue )
- w([[ ]])
- sbc( colors.lightGray )
- scp(15,9)
- w([[ Please Login As A ]])
- scp(15,10)
- w([[ Administrator ]])
- scp(15,11)
- w([[ ]])
- scp(15,12)
- w([[ ]])
- scp(15,13)
- w([[ ]])
- scp(17,11)
- sbc( colors.white )
- w([[ ]])
- scp(17,12)
- w([[ ]])
- scp(17,11)
- stc( colors.black )
- username = read()
- scp(17,12)
- password = read("*")
- if username == username1 and password == userpass1 then
- shell.run('Programs/AdvancedConsole')
- else
- shell.run('Services/AdvancedBoot')
- end
- elseif X >= 20 and X <= 34 and Y == 12 then
- sbc(1)
- term.clear()
- scp(15,8)
- sbc( colors.blue )
- w([[ ]])
- sbc( colors.lightGray )
- scp(15,9)
- w([[ Are You Sure You Want ]])
- scp(15,10)
- w([[ Force Update? ]])
- scp(15,11)
- w([[ ]])
- scp(15,12)
- w([[ ]])
- sbc( colors.green )
- scp(17,12)
- w([[ Yes ]])
- scp(36,12)
- sbc( colors.red )
- w([[ No ]])
- update()
- end
- end
- end
- sbc(1)
- stc( colors.blue )
- term.clear()
- scp(15,1)
- print("Advanced Boot Options")
- scp(20,8)
- sbc( colors.blue )
- stc( colors.white )
- print(" Reboot ")
- scp(20,10)
- print(" Console ")
- scp(20,12)
- print(" Force Update ")
- reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement