Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local installAs = "setshield.app"
- local function Setup()
- term.setCursorPos(10,12)
- print(" ")
- term.setCursorPos(20,14)
- print(" ")
- term.setCursorPos(20,15)
- print(" ")
- sleep(0.1)
- term.setCursorPos(10,12)
- print("Read files...")
- term.setCursorPos(5,10)
- textutils.slowPrint("IIIIIIIIIIIIIIII")
- if fs.exists("disk/Setup/install_pc_1") then
- if fs.exists("disk/Setup/install_pc_2") then
- local hwnd = fs.open("disk/Setup/install_pc_2", "r")
- installAs = hwnd.readAll("disk/Setup/install_pc_2")
- hwnd.close(hwnd)
- end
- sleep(0.1)
- term.setCursorPos(10,12)
- print(" ")
- sleep(0.1)
- term.setCursorPos(10,12)
- print("Installing " ..installAs.. "...")
- term.setCursorPos(5,10)
- textutils.slowPrint("IIIIIIIIIIIIIIIIIIIIIIIIIIIII")
- term.setCursorPos(5,10)
- textutils.slowPrint("IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII")
- term.setCursorPos(10,12)
- print(" ")
- if fs.exists(installAs) then
- fs.delete(installAs)
- end
- fs.copy("disk/Setup/install_pc_1", installAs)
- term.setCursorPos(10,12)
- print("Installed, Rebooting to apply changes")
- print("Installed file is named as " ..installAs.. "")
- sleep(3)
- shell.run("eject left")
- shell.run("eject top")
- shell.run("eject bottom")
- shell.run("eject back")
- shell.run("eject right")
- shell.run("eject front")
- os.reboot()
- else
- term.setCursorPos(10,12)
- print(" ")
- sleep(0.1)
- term.setCursorPos(10,12)
- print("Error Code 0x91 occured! (Corrupt Installer)")
- sleep(2)
- os.reboot()
- end
- end
- local function Aus()
- os.pullEvent = os.pullEventRaw
- opcje = {}
- wybor = 1
- opcje[1] = "Install"
- opcje[2] = "Cancel"
- function uruchom(numer)
- if numer == 1 then
- Setup()
- end
- if numer == 2 then
- shell.run("eject left")
- shell.run("eject top")
- shell.run("eject bottom")
- shell.run("eject back")
- shell.run("eject right")
- shell.run("eject front")
- term.clear()
- os.reboot()
- end
- end
- function Taste()
- sleep(0)
- event, argument = os.pullEvent()
- if event == "key" then
- if argument == 28 then
- return uruchom(wybor)
- elseif argument == 200 then
- if wybor == 1 then
- else
- wybor = wybor - 1
- end
- elseif argument == 208 then
- if wybor == table.getn(opcje) then
- else
- wybor = wybor + 1
- end
- else
- return Taste()
- end
- else
- return Taste()
- end
- return menu()
- end
- function menu()
- term.clear()
- term.setCursorPos(1,3)
- print("| ### ### |")
- print("| # # |")
- print("| ### ### |")
- print("| # # |")
- print("| ### ### |")
- term.setCursorPos(8,1)
- print("Welcome to the SetShield Wizard.")
- term.setCursorPos(4,10)
- print("[-------------------------------------------]")
- term.setCursorPos(10,12)
- print("Are you sure you want to install this program?")
- print("")
- for i=1, table.getn(opcje) do
- if wybor == i then
- print(" [ "..opcje[i].." ]")
- else
- print(" "..opcje[i].." ")
- end
- end
- return Taste()
- end
- return menu()
- end
- Aus()
Add Comment
Please, Sign In to add comment