Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --BIRCH OS INSTALLER, LITERALLY TAKES SECONDS.
- BIRCHOS_OS = [[
- shell.run("clear")
- birch.oldUI = false
- --os.pullEvent = os.pullEventRaw
- l = 0
- local edge_boot_dir = "sys16/edge/"
- local OS_SYSTEM_VERSION = birch.osversion
- local OS_SYSTEM_CREATOR = "COMPUTERCRAFT_COMPUTER."..os.getComputerID()
- local OS_SHUTDOWN_MESSAGE = "SHUTTING DOWN"
- local OS_REBOOT_MESSAGE = "REBOOTING"
- local OS_UNLOCKED = settings.getVariable("system/settings","unlock")
- local OS_ROOTLOGIN = false
- local OS_BINARYBOOTCODE = settings.getVariable("system/settings","bootcode")
- local OS_BINARYBOOTCODE_CHECK = "01000001"
- local OS_ADMINLOGIN_PASSWORD = "01011"
- local OS_SYSTEM_PREBOOT_VENDOR = ""
- local bootPart = 0
- local testrows = {"{@} Desktop","","","","","","","","","","","","","","","","","",""} -- This is seriously not a good method for rendering the menu system, it looks cool though.
- local CTHEME = tonumber(settings.getVariable("system/api/thememanager/themes/theme.birchtheme","OS_DEFAULTBACKGROUNDCOLOR"))
- if settings.getVariable("system/settings","theme") == "dark" then
- OS_GUI_COLOR = colors.gray
- OS_TEXT_COLOR = colors.white
- OS_WELCOME_COLOR = colors.white
- OS_STARTMENU_SHUTDOWNCOLOR = colors.gray
- OS_STARTMENU_LOGOUTCOLOR = colors.gray
- OS_STARTMENU_REBOOTCOLOR = colors.gray
- OS_STARTMENU_COLOR = colors.lightGray
- OS_CMD_COLOR = colors.black
- --OS_BAR_DESIGN = "-======["..formattedTime.."]======-"
- --OS_BAR_BOTTOM_DESIGN = "-o================o-"
- elseif settings.getVariable("system/settings","theme") == "bright" then
- OS_GUI_COLOR = colors.white
- OS_TEXT_COLOR = colors.black
- OS_WELCOME_COLOR = colors.green
- OS_STARTMENU_SHUTDOWNCOLOR = colors.red
- OS_STARTMENU_LOGOUTCOLOR = colors.lime
- OS_STARTMENU_REBOOTCOLOR = colors.yellow
- OS_STARTMENU_COLOR = colors.lightGray
- OS_CMD_COLOR = colors.black
- --OS_BAR_DESIGN = "-======["..formattedTime.."]======-"
- --OS_BAR_BOTTOM_DESIGN = "-o================o-"
- elseif settings.getVariable("system/settings","theme") == "custom" then
- OS_GUI_COLOR = tonumber(settings.getVariable("system/api/thememanager/themes/theme.birchtheme","OS_DEFAULTBACKGROUNDCOLOR"))
- OS_TEXT_COLOR = tonumber(settings.getVariable("system/api/thememanager/themes/theme.birchtheme","OS_DEFAULTTEXTCOLOR"))
- OS_WELCOME_COLOR = tonumber(settings.getVariable("system/api/thememanager/themes/theme.birchtheme","OS_LOGINSCREEN_WELCOMECOLOR"))
- OS_STARTMENU_SHUTDOWNCOLOR = tonumber(settings.getVariable("system/api/thememanager/themes/theme.birchtheme","OS_STARTMENU_SHUTDOWNCOLOR"))
- OS_STARTMENU_LOGOUTCOLOR = tonumber(settings.getVariable("system/api/thememanager/themes/theme.birchtheme","OS_STARTMENU_LOGOUTCOLOR"))
- OS_STARTMENU_REBOOTCOLOR = tonumber(settings.getVariable("system/api/thememanager/themes/theme.birchtheme","OS_STARTMENU_REBOOTCOLOR"))
- OS_STARTMENU_COLOR = tonumber(settings.getVariable("system/api/thememanager/themes/theme.birchtheme","OS_STARTMENU_COLOR"))
- OS_CMD_COLOR = tonumber(settings.getVariable("system/api/thememanager/themes/theme.birchtheme","OS_CMD_BGCOLOR"))
- --OS_BAR_DESIGN = "-======["..formattedTime.."]======-"
- --OS_BAR_BOTTOM_DESIGN = "~o================o~"
- end
- if settings.getVariable("system/settings","theme") == nil then
- OS_TEXT_COLOR = colors.white
- OS_GUI_COLOR = colors.gray
- end
- state = ""
- state_dev = ""
- local menu = false -- COMPLETELY DEPRECATED UNLESS birch.oldUI is set to true (set to off by default)
- local desktop = false
- -- SYSTEM FUNCTIONS
- function OS_DESKTOP()
- PROGMENU = false
- term.setCursorPos(1,1)
- local day = os.day()
- local systime = os.time()
- if settings.getVariable("system/settings","timeformat") == "12" then
- formattedTime = textutils.formatTime(systime, false)
- else
- formattedTime = textutils.formatTime(systime, true)
- end
- menu = false
- birch.systemcheck()
- term.setBackgroundColor(OS_GUI_COLOR)
- birch.tclear()
- if birch.oldUI == false then
- shell.run("system/desktop_test.lua")
- end
- birch.aP("[>] MENU | Birch OS Ultimate ["..state..""..state_dev.."Day: "..day.."]",OS_TEXT_COLOR)
- while true do
- systime = os.time()
- day = os.day()
- if settings.getVariable("system/settings","timeformat") == "12" then
- formattedTime = textutils.formatTime(systime, false)
- else
- formattedTime = textutils.formatTime(systime, true)
- end
- state = birch.osstate
- local event, button, x, y = os.pullEvent("mouse_click")
- if dbg == true then
- print("x:"..x..",y:"..y)
- end
- if x == 2 and y == 1 and button == 1 then
- if not menu == true then
- term.setCursorPos(2,1)
- birch.aP("v",OS_TEXT_COLOR)
- menu = true
- birch.aP(tostring(OS_BAR_DESIGN),OS_TEXT_COLOR)
- birch.aP(" [S] SHUT DOWN",OS_STARTMENU_SHUTDOWNCOLOR)
- birch.aP(" [R] REBOOT",OS_STARTMENU_REBOOTCOLOR) --TODO: CHANGE COLOR
- birch.aP(" [L] LOG OUT",OS_STARTMENU_LOGOUTCOLOR)
- birch.aP(" [>] SYSTEM INFORMATION",OS_TEXT_COLOR)
- birch.aP(" [>] PROGRAMS",OS_TEXT_COLOR)
- birch.aP(" [>] MONITOR",OS_TEXT_COLOR)
- birch.aP(" [>] NEW GRAPHICS TEST",colors.red)
- birch.aP(" [!] This is only here for debug reasons.")
- if OS_UNLOCKED == "true" then
- print("")
- birch.aP(" [>] ROOT",OS_TEXT_COLOR)
- end
- birch.aP(tostring(OS_BAR_BOTTOM_DESIGN),OS_TEXT_COLOR)
- else if menu == true then
- menu = false
- term.setCursorPos(2,1)
- term.setTextColor(OS_TEXT_COLOR)
- birch.aP(">",OS_TEXT_COLOR)
- OS_DESKTOP()
- end
- end
- end
- if x == 3 and y == 3 and button == 1 and menu == true then
- shell.run("system/desktop_test.lua")
- end
- if x == 3 and y == 4 and button == 1 and menu == true then
- os.reboot()
- end
- if x == 2 and y == 5 and button == 1 and menu == true then
- shell.run("system/desktop_test.lua")
- end
- if x == 3 and y == 6 and button == 1 and menu == true then
- SYSTEM_INFO()
- end
- if x == 3 and y == 7 and button == 1 and menu == true then
- --OS_SYSTEM_EDIT()
- if not PROGMENU == true then
- menu = false
- PROGMENU = true
- shell.run("clear")
- birch.aP("[v] MENU | Birch OS Ultimate ["..state..""..state_dev.."Day: "..day.."]",OS_TEXT_COLOR)
- birch.aP("-=[X]==["..formattedTime.."]======-",OS_TEXT_COLOR)
- birch.aP(" [o] SCRIPT EDITOR",OS_TEXT_COLOR)
- birch.aP(" [o] VIRTUAL OS",OS_TEXT_COLOR)
- birch.aP(" [o] CHAT",OS_TEXT_COLOR)
- birch.aP(" [o] API LOADER",OS_TEXT_COLOR)
- birch.aP("-= SYSTEM TOOLS =-",OS_TEXT_COLOR)
- birch.aP(" [o] SYSTEM DIAGNOSE",OS_TEXT_COLOR)
- birch.aP(" [o] OLD OS FILES",OS_TEXT_COLOR)
- birch.aP(" [o] UPDATE BIRCH OS",OS_TEXT_COLOR)
- birch.aP(" [o] CREATE FILE/SCRIPT",OS_TEXT_COLOR)
- birch.aP(" [o] OPEN PROGRAM",OS_TEXT_COLOR)
- else if PROGMENU == true then
- PROGMENU = false
- shell.run("clear")
- OS_DESKTOP()
- end
- end
- end
- if x == 4 and y == 2 and button == 1 and PROGMENU == true then
- OS_DESKTOP()
- end
- if x == 3 and y == 8 and button == 1 and menu == true then
- OS_PROGRAMS()
- end
- if x == 3 and y == 9 and button == 1 and menu == true then
- shell.run("system/desktop_test.lua")
- end
- if x == 3 and y == 10 and button == 1 and menu == true and OS_ROOTLOGIN == true then
- OS_SYSTEM_EDIT()
- end
- if x == 3 and y == 3 and button == 1 and PROGMENU == true then
- print("ENTER DIRECTORY")
- dir = read()
- shell.run("edit "..dir)
- return OS_DESKTOP()
- end
- if x == 3 and y == 4 and button == 1 and PROGMENU == true then
- if fs.exists("system/api/source_api_programs/virtualos.lua") then
- term.clear()
- term.setBackgroundColor(colors.black)
- --term.reset()
- shell.run("system/api/source_api_programs/virtualos.lua")
- else
- print("NO BOOTABLE OS FOUND.")
- end
- end
- if x == 3 and y == 9 and button == 1 and PROGMENU == true then
- shell.run("system/os.old_ass_file")
- end
- if x == 3 and y == 5 and button == 1 and PROGMENU == true then
- shell.run("system/programs/chat.lua")
- end
- if x == 3 and y == 6 and button == 1 and PROGMENU == true then
- print("ENTER DIRECTORY:")
- d = read()
- os.loadAPI(d)
- print("Loaded successfully.")
- sleep(1)
- return OS_DESKTOP()
- end
- if x == 3 and y == 8 and button == 1 and PROGMENU == true then
- systemdiag.diag("-s","-sa")
- end
- if x == 3 and y == 10 and button == 1 and PROGMENU == true then
- shell.run("clear")
- term.setBackgroundColor(colors.black)
- term.clear()
- birch.sysLog("Updating..")
- shell.run("pastebin run UgSYtY4H")
- end
- if x == 3 and y == 11 and button == 1 and PROGMENU == true then
- birch.aP("Directory:",OS_TEXT_COLOR)
- term.setCursorPos(11,13)
- local dir = io.read()
- birch.aP("Enter data:",OS_TEXT_COLOR)
- local data = io.read()
- birch.createFile(dir,data)
- end
- if x == 3 and y == 12 and button == 1 and PROGMENU == true then
- birch.aP("Directory:",OS_TEXT_COLOR)
- term.setCursorPos(11,13)
- local dir = io.read()
- shell.run(dir)
- end
- end
- end
- -- PROGRAMS
- function OS_LOGIN_SCREEN()
- if fs.exists("system/desktop_test.lua") then
- shell.run("system/desktop_test.lua")
- else
- birch.crash("Missing system files: %sysroot%/desktop_test.lua")
- end
- end
- function SYSTEM_INFO()
- birch.tclear()
- term.setCursorPos(1,1)
- birch.aP("[x]",colors.red)
- term.setCursorPos(4,1)
- birch.aP(" System information",OS_TEXT_COLOR)
- term.setCursorPos(1,2)
- birch.aP("___________________________________________________",OS_TEXT_COLOR)
- birch.aP("SYSTEM VERSION: "..OS_SYSTEM_VERSION,OS_TEXT_COLOR)
- birch.aP("SYSTEM VENDOR: "..OS_SYSTEM_CREATOR,OS_TEXT_COLOR)
- birch.aP("BIRCH OS API VERSION: "..birch.apiversion,OS_TEXT_COLOR)
- birch.aP("NETWORK API VERSION: "..network.apiversion,OS_TEXT_COLOR)
- birch.aP("OPERATION API VERSION: "..operation.apiversion,OS_TEXT_COLOR)
- birch.aP("USER NAME: "..settings.getVariable("system/settings","username"),OS_TEXT_COLOR)
- birch.aP("PASSWORD: "..tostring(settings.getVariable("system/settings","loginkey")),OS_TEXT_COLOR)
- birch.aP("",OS_TEXT_COLOR)
- birch.aP("SYSTEM UNLOCKED: "..OS_UNLOCKED,colors.cyan)
- birch.aP("SYSTEM DEFAULT COLORS: "..tostring(OS_GUI_COLOR).."+"..tostring(OS_TEXT_COLOR),colors.cyan)
- birch.aP("OS ERRORS: "..state,colors.red)
- print("")
- while(1) do
- local event, button, x, y = os.pullEvent("mouse_click")
- if dbg == true then
- print("x:"..x..",y:"..y)
- end
- if x == 2 and y == 1 and button == 1 then
- shell.run("system/desktop_test.lua")--OS_DESKTOP()
- end
- end
- end
- function NETWORK_CONNECTION_TEST()
- --print("Attempting to connect..")
- --rednet.open("right")
- --rednet.broadcast("move_back")
- --sleep(1)
- --rednet.broadcast("turn_right")
- --sleep(1)
- --rednet.broadcast("move_forward")
- --sleep(1)
- --rednet.broadcast("move_back")
- --sleep(1)
- --rednet.broadcast("turn_left")
- --print("Connected.")
- --DISABLED SINCE ALPHA 4.0
- end
- function OS_FIRST_BOOT()
- local CTHEME = tonumber(settings.getVariable("system/api/thememanager/themes/theme.birchtheme","OS_DEFAULTBACKGROUNDCOLOR"))
- local usrnm = false
- local thm = false
- local tfm = false
- shell.run("clear")
- edge.button(1,1,16,19,colors.lightGray,OS_GUI_COLOR,"First Boot Setup")
- edge.button(3,3,13,3,colors.gray,OS_GUI_COLOR,"Username")
- edge.button(3,5,13,5,colors.gray,OS_GUI_COLOR,"Password")
- edge.button(3,7,13,7,colors.lightGray,OS_GUI_COLOR,"Themes:")
- edge.button(3,9,13,9,colors.gray,OS_GUI_COLOR,"Dark")
- edge.button(3,11,13,11,colors.white,OS_GUI_COLOR,"Bright")
- edge.button(3,13,13,13,CTHEME,OS_GUI_COLOR,"Custom")
- edge.button(3,15,13,15,colors.lightGray,OS_GUI_COLOR,"Clock format:")
- edge.button(2,17,7,17,colors.gray,OS_GUI_COLOR,"AM/PM")
- edge.button(9,17,14,17,colors.gray,OS_GUI_COLOR,"24H")
- edge.button(40,17,45,17,colors.gray,OS_GUI_COLOR,"Next")
- edge.xprint("Welcome to Birch OS!",25,5,colors.black)
- edge.xprint("Please pick your username and ",20,7,colors.black)
- edge.xprint("password (pass is optional)!",20,8,colors.black)
- edge.xprint("Pick a theme of your liking.",20,10,colors.black)
- while(true) do
- local event, button, x, y = os.pullEvent("mouse_click")
- if x == 3 and y == 3 or x == 4 and y == 3 or x == 5 and y == 3 or x == 6 and y == 3 or x == 7 and y == 3 or x == 8 and y == 3 or x == 9 and y == 3 or x == 10 and y == 3 or x == 11 and y == 3 or x == 12 and y == 3 or x == 13 and y == 3 then
- edge.button(3,3,13,3,colors.white,OS_GUI_COLOR,"")
- term.setCursorPos(3,3)
- term.setTextColor(colors.black)
- local usr = io.read()
- settings.setVariable("system/settings","username",usr)
- usrnm = true
- edge.button(3,3,13,3,colors.green,OS_GUI_COLOR,usr)
- end
- if x == 3 and y == 5 or x == 4 and y == 5 or x == 5 and y == 5 or x == 6 and y == 5 or x == 7 and y == 5 or x == 8 and y == 5 or x == 9 and y == 5 or x == 10 and y == 5 or x == 11 and y == 5 or x == 12 and y == 5 or x == 13 and y == 5 then
- edge.button(3,5,13,5,colors.white,OS_GUI_COLOR,"")
- term.setCursorPos(3,5)
- term.setTextColor(colors.black)
- local pass = read("*")
- settings.setVariable("system/settings","loginkey",pass)
- edge.button(3,5,13,5,colors.green,OS_GUI_COLOR,"Pass set!")
- end
- if x == 3 and y == 9 or x == 4 and y == 9 or x == 5 and y == 9 or x == 6 and y == 9 or x == 7 and y == 9 or x == 8 and y == 9 or x == 9 and y == 9 or x == 10 and y == 9 or x == 11 and y == 9 or x == 12 and y == 9 or x == 13 and y == 9 then
- edge.button(3,9,13,9,colors.gray,OS_GUI_COLOR,"Theme set!")
- settings.setVariable("system/settings","theme","dark")
- thm = true
- end
- if x == 3 and y == 11 or x == 4 and y == 11 or x == 5 and y == 11 or x == 6 and y == 11 or x == 7 and y == 11 or x == 8 and y == 11 or x == 9 and y == 11 or x == 10 and y == 11 or x == 11 and y == 11 or x == 12 and y == 11 or x == 13 and y == 11 then
- edge.button(3,11,13,11,colors.white,OS_GUI_COLOR,"Theme set!")
- settings.setVariable("system/settings","theme","bright")
- thm = true
- end
- if x == 3 and y == 13 or x == 4 and y == 13 or x == 5 and y == 13 or x == 6 and y == 13 or x == 7 and y == 13 or x == 8 and y == 13 or x == 9 and y == 13 or x == 10 and y == 13 or x == 11 and y == 13 or x == 12 and y == 13 or x == 13 and y == 13 then
- edge.button(3,13,13,13,CTHEME,OS_GUI_COLOR,"Theme set!")
- settings.setVariable("system/settings","theme","custom")
- thm = true
- end
- if x == 2 and y == 17 or x == 3 and y == 17 or x == 4 and y == 17 or x == 5 and y == 17 or x == 6 and y == 17 or x == 7 and y == 17 then
- edge.button(2,17,7,17,colors.green,OS_GUI_COLOR,"AM/PM")
- settings.setVariable("system/settings","timeformat","12")
- tfm = true
- end
- if x == 9 and y == 17 or x == 10 and y == 17 or x == 11 and y == 17 or x == 12 and y == 17 or x == 13 and y == 17 or x == 14 and y == 17 then
- edge.button(9,17,14,17,colors.green,OS_GUI_COLOR,"24H")
- settings.setVariable("system/settings","timeformat","24")
- tfm = true
- end
- if x == 40 and y == 17 or x == 41 and y == 17 or x == 42 and y == 17 or x == 43 and y == 17 or x == 44 and y == 17 or x == 45 and y == 17 then
- if tfm == true and thm == true and usrnm == true then
- os.reboot()
- else
- if tfm == false then
- edge.xprint("Pick time format!",20,17,colors.red)
- end
- if thm == false then
- edge.xprint("Pick a theme!",20,11,colors.red)
- end
- if usrnm == false then
- edge.xprint("Pick your username!",20,3,colors.red)
- end
- sleep(3)
- OS_FIRST_BOOT()
- end
- end
- end
- --sleep(999)
- end
- function OS_PROGRAMS()
- -- THIS WAS SUPPOSED TO BE A PROGRAM LIST.
- birch.sysLog("Started monitor setup")
- shell.run("clear")
- birch.printcenter("SIDE: ",2)
- side = read()
- shell.run("monitor "..side.." startup")
- return OS_DESKTOP()
- end
- function OS_DEBUG()
- shell.run("clear")
- print("[X] CLEAR LOGS")
- print("[X] FORCE SHUTDOWN")
- print("[X] REINSTALL BIRCHOS")
- print("[X] DISABLE THEMES")
- print("[X] RESET BIRCHOS TO FACTORY SETTINGS")
- print("[X] INSTALL EXPERIMENTAL VERSION")
- print("[X] COMMAND PROMPT")
- print("[X] UNINSTALL BIRCH OS ULTIMATE")
- print("")
- print("[X] EXIT")
- local event, button, x, y = os.pullEvent("mouse_click")
- while(true) do
- if x == 2 and y == 1 and button == 1 then
- fs.delete("system/log.txt")
- fs.delete("system/crashlog")
- os.reboot()
- end
- if x == 2 and y == 2 and button == 1 then
- os.shutdown()
- end
- if x == 2 and y == 3 and button == 1 then
- shell.run("pastebin run UgSYtY4H")
- end
- if x == 2 and y == 4 and button == 1 then
- settings.setVariable("system/settings","theme","dark")
- return OS_DEBUG()
- end
- if x == 2 and y == 5 and button == 1 then
- settings.setVariable("system/settings","username","nil")
- settings.setVariable("system/settings","loginkey","nil")
- return OS_DEBUG()
- end
- if x == 2 and y == 6 and button == 1 then
- shell.run("pastebin run haULzXdY")
- end
- if x == 2 and y == 7 and button == 1 then
- OS_COMMANDLINE()
- end
- if x == 2 and y == 8 and button == 1 then
- shell.run("rm system")
- shell.run("rm startup")
- shell.run("rm beta")
- print("BirchOS has been uninstalled.")
- sleep(2)
- os.reboot()
- end
- if x == 2 and y == 10 and button == 1 then
- BOOT_ANIMATION()
- end
- end
- end
- function AdvanceBoot()
- if bootPart == 0 then
- term.setBackgroundColor(OS_GUI_COLOR)
- term.setTextColor(OS_TEXT_COLOR)
- shell.run("clear")
- if birch.release == false then
- birch.printcenter("PRE-RELEASE PRODUCT",18)
- birch.printcenter(birch.osversion,19)
- end
- if fs.exists("beta/birchtwo") then
- os.loadAPI("beta/birchtwo")
- else
- birch.crash("MISSING_API: BETA/BIRCHTWO")
- end
- birch.printcenter("Birch OS",8)
- birch.printcenter("[== ]",10)
- sleep(0.3)
- shell.run("clear")
- if birch.release == false then
- birch.printcenter("PRE-RELEASE PRODUCT",18)
- birch.printcenter(birch.osversion,19)
- end
- if fs.exists("system/api/sc") then
- os.loadAPI("system/api/sc")
- else
- birch.crash("MISSING_API: API/SC")
- end
- birch.printcenter("Birch OS",8)
- birch.printcenter("[==== ]",10)
- sleep(0.05)
- shell.run("clear")
- if birch.release == false then
- birch.printcenter("PRE-RELEASE PRODUCT",18)
- birch.printcenter(birch.osversion,19)
- end
- if fs.exists("system/api/network") then
- os.loadAPI("system/api/network")
- else
- birch.crash("MISSING_API: API/NETWORK")
- end
- birch.printcenter("Birch OS",8)
- birch.printcenter("[====== ]",10)
- sleep(0.17)
- shell.run("clear")
- if birch.release == false then
- birch.printcenter("PRE-RELEASE PRODUCT",18)
- birch.printcenter(birch.osversion,19)
- end
- if fs.exists("system/api/operation") then
- os.loadAPI("system/api/operation")
- else
- birch.crash("MISSING_API: API/OPERATION")
- end
- birch.printcenter("Birch OS",8)
- birch.printcenter("[======== ]",10)
- sleep(0.1)
- shell.run("clear")
- if birch.release == false then
- birch.printcenter("PRE-RELEASE PRODUCT",18)
- birch.printcenter(birch.osversion,19)
- end
- if fs.exists("beta/systemdiag") then
- os.loadAPI("beta/systemdiag")
- else
- birch.crash("MISSING_API: BETA/SYSTEMDIAG")
- end
- birch.printcenter("Birch OS",8)
- birch.printcenter("[==========]",10)
- sleep(0.2)
- shell.run("clear")
- if birch.release == false then
- birch.printcenter("PRE-RELEASE PRODUCT",18)
- birch.printcenter(birch.osversion,19)
- end
- if fs.exists("system/api/edge") then
- os.loadAPI("system/api/edge")
- else
- birch.crash("MISSING_API: Edge Graphics API")
- end
- birch.printcenter("Birch OS",8)
- --birch.printcenter("[ULTIMATE]",9)
- birch.printcenter("[==========]",10)
- birch.sysLog("Finished loading")
- sleep(0.3)
- if settings.getVariable("system/settings","username") == "nil" then
- OS_FIRST_BOOT()
- end
- term.setBackgroundColor(OS_GUI_COLOR)
- OS_LOGIN_SCREEN()
- end
- end
- -- BOOT STUFF
- if not http then
- birch.crash("HTTP_NOT_ENABLED")
- end
- -- LOAD SYSTEM FILES --
- -- There are literally no APIS to load, since they're loaded in /startup
- -- SET UP SYSTEM --
- --print("[OS] Setting up system")
- if settings.getVariable("system/settings","autoupdate") == nil then
- settings.setVariable("system/settings","autoupdate","false")
- end
- os.setComputerLabel("[BirchOS]")
- birch.sysLog("System initialized!")
- if fs.exists("system/crashlog") then
- if settings.getVariable("system/crashlog","crash") == "true" then
- print("RECENT SYSTEM CRASH PROMPT ON LOGIN.")
- end
- end
- if settings.getVariable("system/settings","unlock") == "true" then
- --birch.aP("[ROOT] System is unlocked",colors.green)
- birch.sysLog("System is unlocked, enabling root access.")
- OS_ROOTLOGIN = true
- end
- if OS_BINARYBOOTCODE == OS_BINARYBOOTCODE_CHECK then
- --sleep(0.001)
- else
- if OS_BINARYBOOTCODE == 01000101 then
- settings.setVariable("system/settings","debug",true)
- birch.sysLog("DEBUG IS ENABLED")
- else
- birch.sysLog("ERROR!! BOOT CODE IS INVALID.")
- birch.crash("INVALID BOOT CODE")
- print(OS_BINARYBOOTCODE)
- print("+")
- print(OS_BINARYBOOTCODE_CHECK)
- print("DOES NOT MATCH")
- while(true) do
- sleep(1)
- end
- end
- end
- if settings.getVariable("system/crashlog","reason") then
- r = settings.getVariable("system/crashlog","reason")
- end
- if settings.getVariable("system/settings","debug") == "true" then
- dbg = true
- end
- if settings.getVariable("system/crashlog","crash") == "true" then
- c = true
- end
- if settings.getVariable("system/settings","edgebeta") == "true" then
- shell.run("clear")
- birch.sysLog("BIRCH EDGE BETA NOT FOUND")
- end
- if settings.getVariable("system/settings","disablebootan") == "true" then
- os.loadAPI("system/api/birch")
- os.loadAPI("system/api/settings")
- os.loadAPI("system/api/sc")
- os.loadAPI("system/api/operation")
- os.loadAPI("system/api/edge")
- os.loadAPI("system/api/network")
- shell.run("system/desktop_test.lua")
- else
- AdvanceBoot()
- end
- ]]
- BIRCHOS_DESKTOP = [[
- shell.run("clear")
- birch.systemcheck()
- birch.oldUI = false
- os.pullEvent = os.pullEventRaw
- l = 0
- local edge_boot_dir = "sys16/edge/"
- local OS_SYSTEM_VERSION = birch.osversion
- local OS_SYSTEM_CREATOR = "COMPUTERCRAFT_COMPUTER."..os.getComputerID()
- local OS_SHUTDOWN_MESSAGE = "SHUTTING DOWN"
- local OS_REBOOT_MESSAGE = "REBOOTING"
- local OS_UNLOCKED = settings.getVariable("system/settings","unlock")
- local OS_ROOTLOGIN = false
- local OS_BINARYBOOTCODE = settings.getVariable("system/settings","bootcode")
- local OS_BINARYBOOTCODE_CHECK = "01000001"
- local OS_ADMINLOGIN_PASSWORD = "01011"
- local OS_SYSTEM_PREBOOT_VENDOR = ""
- local bootPart = 0
- -- This is seriously not a good method for rendering the menu system, it looks cool though.
- local CTHEME = tonumber(settings.getVariable("system/api/thememanager/themes/theme.birchtheme","OS_DEFAULTBACKGROUNDCOLOR"))
- if settings.getVariable("system/settings","theme") == "dark" then
- OS_GUI_COLOR = colors.gray
- OS_TEXT_COLOR = colors.white
- OS_WELCOME_COLOR = colors.white
- OS_STARTMENU_SHUTDOWNCOLOR = colors.gray
- OS_STARTMENU_LOGOUTCOLOR = colors.gray
- OS_STARTMENU_REBOOTCOLOR = colors.gray
- OS_STARTMENU_COLOR = colors.lightGray
- OS_CMD_COLOR = colors.black
- --OS_BAR_DESIGN = "-======["..formattedTime.."]======-"
- --OS_BAR_BOTTOM_DESIGN = "-o================o-"
- elseif settings.getVariable("system/settings","theme") == "bright" then
- OS_GUI_COLOR = colors.white
- OS_TEXT_COLOR = colors.black
- OS_WELCOME_COLOR = colors.green
- OS_STARTMENU_SHUTDOWNCOLOR = colors.red
- OS_STARTMENU_LOGOUTCOLOR = colors.lime
- OS_STARTMENU_REBOOTCOLOR = colors.yellow
- OS_STARTMENU_COLOR = colors.lightGray
- OS_CMD_COLOR = colors.black
- --OS_BAR_DESIGN = "-======["..formattedTime.."]======-"
- --OS_BAR_BOTTOM_DESIGN = "-o================o-"
- elseif settings.getVariable("system/settings","theme") == "custom" then
- OS_GUI_COLOR = tonumber(settings.getVariable("system/api/thememanager/themes/theme.birchtheme","OS_DEFAULTBACKGROUNDCOLOR"))
- OS_TEXT_COLOR = tonumber(settings.getVariable("system/api/thememanager/themes/theme.birchtheme","OS_DEFAULTTEXTCOLOR"))
- OS_WELCOME_COLOR = tonumber(settings.getVariable("system/api/thememanager/themes/theme.birchtheme","OS_LOGINSCREEN_WELCOMECOLOR"))
- OS_STARTMENU_SHUTDOWNCOLOR = tonumber(settings.getVariable("system/api/thememanager/themes/theme.birchtheme","OS_STARTMENU_SHUTDOWNCOLOR"))
- OS_STARTMENU_LOGOUTCOLOR = tonumber(settings.getVariable("system/api/thememanager/themes/theme.birchtheme","OS_STARTMENU_LOGOUTCOLOR"))
- OS_STARTMENU_REBOOTCOLOR = tonumber(settings.getVariable("system/api/thememanager/themes/theme.birchtheme","OS_STARTMENU_REBOOTCOLOR"))
- OS_STARTMENU_COLOR = tonumber(settings.getVariable("system/api/thememanager/themes/theme.birchtheme","OS_STARTMENU_COLOR"))
- OS_CMD_COLOR = tonumber(settings.getVariable("system/api/thememanager/themes/theme.birchtheme","OS_CMD_BGCOLOR"))
- --OS_BAR_DESIGN = "-======["..formattedTime.."]======-"
- --OS_BAR_BOTTOM_DESIGN = "~o================o~"
- end
- function desktop()
- term.clear()
- birch.systemcheck()
- --edge.button(3,3,12,4,colors.blue,OS_GUI_COLOR,"Home")
- --edge.button(14,3,23,4,colors.orange,OS_GUI_COLOR,"Settings")
- --edge.button(3,6,12,7,colors.red,OS_GUI_COLOR,"Shut down")
- --edge.button(3,9,12,10,colors.green,OS_GUI_COLOR,"Log Out")
- edge.xprint(">",1,9,OS_TEXT_COLOR)
- edge.xprint("<",51,9,OS_TEXT_COLOR)
- --edge.button(50,1,52,1,colors.lightGray,OS_GUI_COLOR,"X")
- edge.xprint("BirchOS/"..settings.getVariable("system/settings","username").."/",1,1,OS_TEXT_COLOR)
- edge.xprint(birch.osstate,1,2,OS_TEXT_COLOR)
- edge.xprint("c",51,1,OS_TEXT_COLOR)
- --edge.xprint("[EDGE DESKTOP SYSTEM API]",1,19,colors.cyan)
- --edge.xprint("Home",3,3,colors.black)
- --edge.xprint("Settings",14,3,colors.black)
- while(true) do
- if settings.getVariable("system/settings","timeformat") == "12" then
- --edge.xtime(42,1)
- edge.xtime(term.getSize() / 2 - 3,1)
- else
- edge.xtime(term.getSize() / 2 - 3,1)
- end
- local event, button, x, y = os.pullEvent("mouse_click")
- --if x == 3 and y == 3 or x == 4 and y == 3 or x == 5 and y == 3 or x == 6 and y == 3 or x == 7 and y == 3 or x == 8 and y == 3 or x == 9 and y == 3 or x == 10 and y == 3 or x == 11 and y == 3 or x == 12 and y == 3 or x == 3 and y == 4 or x == 4 and y == 4 or x == 5 and y == 4 or x == 6 and y == 4 or x == 7 and y == 4 or x == 8 and y == 4 or x == 9 and y == 4 or x == 10 and y == 4 or x == 11 and y == 4 or x == 12 and y == 4 then
- -- return OS_DESKTOP()
- --end
- --if x == 14 and y == 3 or x == 15 and y == 3 or x == 16 and y == 3 or x == 17 and y == 3 or x == 18 and y == 3 or x == 19 and y == 3 or x == 20 and y == 3 or x == 21 and y == 3 or x == 14 and y == 4 or x == 15 and y == 4 or x == 16 and y == 4 or x == 17 and y == 4 or x == 18 and y == 4 or x == 19 and y == 4 or x == 20 and y == 4 or x == 21 and y == 4 then
- -- shell.run("clear")
- -- edge.setbgColor(colors.black)
- -- return OS_SYSTEM_EDIT()
- --end
- --if x == 3 and y == 6 or x == 4 and y == 6 or x == 5 and y == 6 or x == 6 and y == 6 or x == 7 and y == 6 or x == 8 and y == 6 or x == 9 and y == 6 or x == 10 and y == 6 or x == 11 and y == 6 or x == 12 and y == 6 or x == 3 and y == 7 or x == 4 and y == 7 or x == 5 and y == 7 or x == 6 and y == 7 or x == 7 and y == 7 or x == 8 and y == 7 or x == 9 and y == 7 or x == 10 and y == 7 or x == 11 and y == 7 or x == 12 and y == 7 then
- --edge.setbgColor(colors.black)
- --return OS_SHUTDOWN_REBOOT("SHUTDOWN")--edge.shutdown(0)
- --end
- if x == 51 and y == 1 and button == 1 or button == 2 then
- commandline()
- end
- if x == 51 and y == 9 and button == 1 then
- edge.button(37,1,51,19,OS_STARTMENU_COLOR,OS_GUI_COLOR,"")
- edge.button(51,8,51,8,OS_STARTMENU_COLOR,OS_GUI_COLOR,"+")
- edge.button(51,10,51,10,OS_STARTMENU_COLOR,OS_GUI_COLOR,"+")
- edge.button(39,2,50,2,OS_STARTMENU_COLOR,OS_GUI_COLOR,"Day: "..os.day())
- edge.button(39,4,49,4,colors.gray,OS_GUI_COLOR,"VirtualOS")
- edge.button(39,6,49,6,colors.gray,OS_GUI_COLOR,"New file")
- if fs.exists(tostring(settings.getVariable("system/desktopcfg","customprogram"))) then
- if tostring(settings.getVariable("system/desktopcfg","customprogram")) == "system/api/source_api_programs/bootloader" then
- edge.button(39,8,49,8,colors.gray,OS_GUI_COLOR,"SettEdit")
- elseif tostring(settings.getVariable("system/desktopcfg","customprogram")) == "system/os.lua" then
- edge.button(39,8,49,8,colors.gray,OS_GUI_COLOR,"Kernel")
- elseif tostring(settings.getVariable("system/desktopcfg","customprogram")) == "system/desktop_test.lua" then
- edge.button(39,8,49,8,colors.gray,OS_GUI_COLOR,"Desktop")
- else
- edge.button(39,8,49,8,colors.gray,OS_GUI_COLOR,string.sub(settings.getVariable("system/desktopcfg","customprogram"),-8,-5))
- end
- end
- if fs.exists(tostring(settings.getVariable("system/desktopcfg","customprogramtwo"))) then
- if settings.getVariable("system/desktopcfg","customprogramtwo") == "system/api/source_api_programs/bootloader" then
- edge.button(39,10,49,10,colors.gray,OS_GUI_COLOR,"SettEdit")
- elseif tostring(settings.getVariable("system/desktopcfg","customprogramtwo")) == "system/os.lua" then
- edge.button(39,10,49,10,colors.gray,OS_GUI_COLOR,"Kernel")
- elseif tostring(settings.getVariable("system/desktopcfg","customprogramtwo")) == "system/desktop_test.lua" then
- edge.button(39,10,49,10,colors.gray,OS_GUI_COLOR,"Desktop")
- else
- edge.button(39,10,49,10,colors.gray,OS_GUI_COLOR,string.sub(settings.getVariable("system/desktopcfg","customprogramtwo"),1,-5))
- end
- end
- --edge.xtime(38,4)
- edge.xprint(">",36,9,OS_TEXT_COLOR)
- while(true) do
- local event, button, x, y = os.pullEvent("mouse_click")
- if x == 51 and y == 8 then
- edge.button(39,8,49,8,colors.white,OS_GUI_COLOR,"")
- term.setCursorPos(39,8)
- term.setTextColor(colors.black)
- local customp = io.read()
- settings.setVariable("system/desktopcfg","customprogram",customp)
- edge.button(39,8,49,8,colors.white,OS_GUI_COLOR,"Program set")
- end
- if x == 51 and y == 10 then
- edge.button(39,10,49,10,colors.white,OS_GUI_COLOR,"")
- term.setCursorPos(39,10)
- term.setTextColor(colors.black)
- local customp = io.read()
- settings.setVariable("system/desktopcfg","customprogramtwo",customp)
- edge.button(39,10,49,10,colors.white,OS_GUI_COLOR,"Program set")
- end
- if settings.getVariable("system/settings","debug") == "false" then
- os.setComputerLabel("[BirchOS "..settings.getVariable("system/settings","username").."]")
- else
- os.setComputerLabel("x:"..x.." , y:"..y)
- end
- if x == 36 and y == 9 then
- desktop()
- end
- if x >= 39 and x <= 49 and y == 4 then
- virtualos()
- end
- if x >= 39 and x <= 49 and y == 8 then
- if fs.exists(settings.getVariable("system/desktopcfg","customprogram")) then
- shell.run(tostring(settings.getVariable("system/desktopcfg","customprogram")))
- end
- end
- if x >= 39 and x <= 49 and y == 10 then
- if fs.exists(settings.getVariable("system/desktopcfg","customprogramtwo")) then
- shell.run(tostring(settings.getVariable("system/desktopcfg","customprogramtwo")))
- end
- end
- if x >= 39 and x <= 49 and y == 6 then
- edge.button(39,6,49,6,colors.white,OS_GUI_COLOR,"")
- term.setCursorPos(39,6)
- term.setTextColor(colors.black)
- local file = io.read()
- local cfile = fs.open(file,"w")
- cfile.close()
- term.setTextColor(colors.white)
- shell.run("edit "..file)
- return desktop()
- end
- end
- end
- if x == 1 and y == 9 and button == 1 then
- -- search function
- edge.xprint("<",16,9,OS_TEXT_COLOR)
- edge.button(1,1,15,19,OS_STARTMENU_COLOR,OS_GUI_COLOR," Search")
- edge.button(3,3,13,3,colors.white,OS_GUI_COLOR,"Search..")
- edge.button(3,5,13,5,colors.gray,OS_GUI_COLOR,"Monitor")
- edge.button(3,7,13,7,colors.gray,OS_GUI_COLOR,"Info")
- edge.button(3,9,13,9,colors.gray,OS_GUI_COLOR,"Settings")
- edge.button(3,14,13,14,OS_STARTMENU_SHUTDOWNCOLOR,OS_GUI_COLOR,"Shut down")
- edge.button(3,16,13,16,OS_STARTMENU_LOGOUTCOLOR,OS_GUI_COLOR,"Log out")
- edge.button(3,18,13,18,OS_STARTMENU_REBOOTCOLOR,OS_GUI_COLOR,"Reboot")
- --term.setCursorPos(3,3)
- --term.setTextColor(colors.black)
- --searhquery = io.read()
- --term.setTextColor(colors.white)
- while(true) do
- local event, button, x, y = os.pullEvent("mouse_click")
- --if x == 3 and y == 16 or x == 4 and y == 16 or x == 5 and y == 16 or x == 6 and y == 16 or x == 7 and y == 16 or x == 8 and y == 16 or x == 9 and y == 16 or x == 10 and y == 16 or x == 12 and y == 16 or x == 13 and y == 16 then
- --edge.textColor(OS_TEXT_COLOR)
- --return OS_LOGIN_SCREEN()
- --end
- --if x == 3 and y == 14 or x == 4 and y == 14 or x == 5 and y == 14 or x == 6 and y == 14 or x == 7 and y == 14 or x == 8 and y == 14 or x == 9 and y == 14 or x == 10 and y == 14 or x == 12 and y == 14 or x == 13 and y == 14 then
- --edge.textColor(OS_TEXT_COLOR)
- --birch.off()
- --end
- if x == 3 and y == 7 or x == 4 and y == 7 or x == 5 and y == 7 or x == 6 and y == 7 or x == 7 and y == 7 or x == 8 and y == 7 or x == 9 and y == 7 or x == 10 and y == 7 or x == 12 and y == 7 or x == 13 and y == 7 then
- edge.button(1,1,15,19,OS_STARTMENU_COLOR,OS_GUI_COLOR," Info")
- birch.sysLog("Rendering")
- --edge.button(3,3,13,3,colors.gray,OS_GUI_COLOR,"< BACK")
- edge.button(3,3,13,3,colors.gray,OS_GUI_COLOR,"System")
- edge.button(3,5,13,5,colors.gray,OS_GUI_COLOR,"Edition")
- edge.button(3,7,13,7,colors.gray,OS_GUI_COLOR,"Changelog")
- while(true) do
- local event, button, x, y = os.pullEvent("mouse_click")
- if x == 16 and y == 9 then
- desktop()
- end
- if x >= 3 and x <= 13 and y == 7 then
- edge.button(15,1,52,19,colors.gray,OS_GUI_COLOR," Changelog")
- edge.button(17,5,17,5,colors.gray,OS_GUI_COLOR,"Version 1.1:")
- edge.button(18,6,18,6,colors.gray,OS_GUI_COLOR,"Added custom buttons")
- end
- if x == 3 and y == 3 or x == 4 and y == 3 or x == 5 and y == 3 or x == 6 and y == 3 or x == 7 and y == 3 or x == 8 and y == 3 or x == 9 and y == 3 or x == 10 and y == 3 or x == 11 and y == 3 or x == 12 and y == 3 or x == 13 and y == 3 then
- edge.button(15,1,52,19,colors.gray,OS_GUI_COLOR," System Information")
- edge.button(17,3,25,3,colors.gray,OS_GUI_COLOR,"System version: "..tostring(birch.osversion))
- edge.button(17,5,25,3,colors.gray,OS_GUI_COLOR,"BirchAPI version: "..tostring(birch.apiversion))
- edge.button(17,7,25,3,colors.gray,OS_GUI_COLOR,"EdgeAPI version: "..tostring(edge.version))
- edge.button(17,11,25,3,colors.gray,OS_GUI_COLOR,"Username: "..tostring(settings.getVariable("system/settings","username")))
- if fs.getFreeSpace("") / 1024 <= 1 then
- edge.button(17,15,25,3,colors.gray,OS_GUI_COLOR,"Free space: "..tostring(math.floor(fs.getFreeSpace("/")/1024)).."KB [Low]")
- else
- edge.button(17,15,25,3,colors.gray,OS_GUI_COLOR,"Free space: "..tostring(math.floor(fs.getFreeSpace("/")/1024)).."KB")
- end
- if fs.exists("system/") and fs.exists("system/api") and fs.exists("beta") and fs.exists("startup") then
- edge.button(17,18,25,3,colors.gray,OS_GUI_COLOR,"System: Healthy")
- else
- edge.button(17,18,25,3,colors.gray,OS_GUI_COLOR,"System: Severely damaged")
- end
- edge.xprint("<",16,9,OS_TEXT_COLOR)
- end
- if x == 3 and y == 5 or x == 4 and y == 5 or x == 5 and y == 5 or x == 6 and y == 5 or x == 7 and y == 5 or x == 8 and y == 5 or x == 9 and y == 5 or x == 10 and y == 5 or x == 11 and y == 5 or x == 12 and y == 5 or x == 13 and y == 5 then
- edge.button(15,1,52,19,colors.gray,OS_GUI_COLOR," System Edition")
- edge.button(17,3,25,3,colors.gray,OS_GUI_COLOR,"Standard_Edition_"..tostring(birch.osversion))
- edge.button(17,18,25,18,colors.gray,OS_GUI_COLOR,"BirchOS by Nothy")
- edge.xprint("<",16,9,OS_TEXT_COLOR)
- end
- if x == 4 and y == 1 then
- edge.button(15,1,52,19,colors.gray,OS_GUI_COLOR," EDGE BETA")
- edge.button(23,6,35,6,colors.gray,OS_GUI_COLOR,"EDGE BETA CODE:")
- edge.button(25,7,35,7,colors.white,OS_GUI_COLOR,"")
- edge.xprint("<",16,9,OS_TEXT_COLOR)
- while(true) do
- local event, button, x, y = os.pullEvent("mouse_click")
- if x == 16 and y == 9 then
- desktop()
- end
- if x == 25 and y == 7 or x == 26 and y == 7 or x == 27 and y == 7 or x == 28 and y == 7 or x == 29 and y == 7 or x == 29 and y == 7 or x == 30 and y == 7 or x == 31 and y == 7 or x == 32 and y == 7 or x == 33 and y == 7 or x == 34 and y == 7 then
- edge.button(25,7,35,7,colors.white,OS_GUI_COLOR,"")
- term.setCursorPos(25,7)
- term.setTextColor(colors.black)
- code = io.read()
- if code == "EDGEBETA" or code == "CM9R2F" or code == "CM10R1G" or code == "NOTHYISBEST" then
- settings.setVariable("system/settings","edgebeta","true")
- edge.button(20,6,35,6,colors.gray,OS_GUI_COLOR,"EDGE BETA will be downloaded on reboot.") --ADD EDGE BETA DOWNLOAD IN BOOT DIR
- sleep(5)
- desktop()
- end
- end
- end
- end
- end
- --edge.button(15,1,52,19,colors.gray,OS_GUI_COLOR," System information")
- end
- if x == 16 and y == 9 then
- desktop()
- end
- if x == 3 and y == 14 or x == 4 and y == 14 or x == 5 and y == 14 or x == 6 and y == 14 or x == 7 and y == 14 or x == 8 and y == 14 or x == 9 and y == 14 or x == 10 and y == 14 or x == 11 and y == 14 or x == 12 and y == 14 or x == 13 and y == 14 then
- os.shutdown()
- end
- if x == 3 and y == 16 or x == 4 and y == 16 or x == 5 and y == 16 or x == 6 and y == 16 or x == 7 and y == 16 or x == 8 and y == 16 or x == 9 and y == 16 or x == 10 and y == 16 or x == 11 and y == 16 or x == 12 and y == 16 or x == 13 and y == 16 then
- return OS_LOGIN_SCREEN()
- end
- if x == 3 and y == 18 or x == 4 and y == 18 or x == 5 and y == 18 or x == 6 and y == 18 or x == 7 and y == 18 or x == 8 and y == 18 or x == 9 and y == 18 or x == 10 and y == 18 or x == 11 and y == 18 or x == 12 and y == 18 or x == 13 and y == 18 then
- os.reboot()
- end
- if x == 3 and y == 9 or x == 4 and y == 9 or x == 5 and y == 9 or x == 6 and y == 9 or x == 7 and y == 9 or x == 8 and y == 9 or x == 9 and y == 9 or x == 10 and y == 9 or x == 11 and y == 9 or x == 12 and y == 9 or x == 13 and y == 9 then
- --shell.run("clear")
- edge.button(1,1,15,19,OS_STARTMENU_COLOR,OS_GUI_COLOR," Settings")
- edge.button(3,3,13,3,colors.gray,OS_GUI_COLOR,"Theme")
- edge.button(3,5,13,5,colors.gray,OS_GUI_COLOR,"Password")
- edge.button(3,7,13,7,colors.gray,OS_GUI_COLOR,"Username")
- edge.button(3,9,13,9,colors.gray,OS_GUI_COLOR,"Updates")
- --edge.button(3,9,13,9,colors.gray,OS_GUI_COLOR,"TestSetting2")
- edge.button(3,14,13,14,OS_STARTMENU_SHUTDOWNCOLOR,OS_GUI_COLOR,"Shut down")
- edge.button(3,16,13,16,OS_STARTMENU_LOGOUTCOLOR,OS_GUI_COLOR,"Log out")
- edge.button(3,18,13,18,OS_STARTMENU_REBOOTCOLOR,OS_GUI_COLOR,"Reboot")
- edge.xprint("<",16,9,OS_TEXT_COLOR)
- while(true) do
- local event, button, x, y = os.pullEvent("mouse_click")
- if x == 16 and y == 9 then
- desktop()
- birch.sysLog("User closed MenuItem1")
- end
- if x == 3 and y == 14 or x == 4 and y == 14 or x == 5 and y == 14 or x == 6 and y == 14 or x == 7 and y == 14 or x == 8 and y == 14 or x == 9 and y == 14 or x == 10 and y == 14 or x == 11 and y == 14 or x == 12 and y == 14 or x == 13 and y == 14 then
- os.shutdown()
- end
- if x == 3 and y == 16 or x == 4 and y == 16 or x == 5 and y == 16 or x == 6 and y == 16 or x == 7 and y == 16 or x == 8 and y == 16 or x == 9 and y == 16 or x == 10 and y == 16 or x == 11 and y == 16 or x == 12 and y == 16 or x == 13 and y == 16 then
- return OS_LOGIN_SCREEN()
- end
- if x == 3 and y == 18 or x == 4 and y == 18 or x == 5 and y == 18 or x == 6 and y == 18 or x == 7 and y == 18 or x == 8 and y == 18 or x == 9 and y == 18 or x == 10 and y == 18 or x == 11 and y == 18 or x == 12 and y == 18 or x == 13 and y == 18 then
- os.reboot()
- end
- if x == 3 and y == 9 or x == 4 and y == 9 or x == 5 and y == 9 or x == 6 and y == 9 or x == 7 and y == 9 or x == 8 and y == 9 or x == 9 and y == 9 or x == 10 and y == 9 or x == 11 and y == 9 or x == 12 and y == 9 or x == 13 and y == 9 then
- edge.button(1,1,15,19,OS_STARTMENU_COLOR,OS_GUI_COLOR," Updates")
- edge.button(2,3,13,3,colors.lightGray,OS_GUI_COLOR,"Install:")
- edge.button(3,5,13,5,colors.gray,OS_GUI_COLOR,"Latest")
- edge.button(3,7,13,7,colors.gray,OS_GUI_COLOR,"Experimental")
- if settings.getVariable("system/settings","autoupdate") == "true" then
- edge.button(2,8,5,8,OS_STARTMENU_COLOR,OS_GUI_COLOR,"Auto Updates")
- edge.button(6,9,6,8,colors.lightGray,OS_GUI_COLOR," ON")
- edge.button(3,9,5,9,colors.green,OS_GUI_COLOR,"")
- edge.button(3,9,4,9,colors.gray,OS_GUI_COLOR,"")
- elseif settings.getVariable("system/settings","autoupdate") == "false" then
- edge.button(2,8,5,8,OS_STARTMENU_COLOR,OS_GUI_COLOR,"Auto Updates")
- edge.button(6,9,6,8,colors.lightGray,OS_GUI_COLOR," OFF")
- edge.button(3,9,5,9,colors.gray,OS_GUI_COLOR,"")
- edge.button(3,9,3,9,colors.red,OS_GUI_COLOR,"")
- end
- while(true) do
- local event, button, x, y = os.pullEvent("mouse_click")
- if x == 16 and y == 9 then
- desktop()
- end
- if x == 3 and y == 9 or x == 4 and y == 9 or x == 5 and y == 9 then
- if settings.getVariable("system/settings","autoupdate") == true then
- settings.setVariable("system/settings","autoupdate","false")
- edge.button(2,8,5,8,OS_STARTMENU_COLOR,OS_GUI_COLOR,"Auto Updates")
- edge.button(6,9,6,8,colors.lightGray,OS_GUI_COLOR," OFF")
- edge.button(3,9,5,9,colors.gray,OS_GUI_COLOR,"")
- edge.button(3,9,3,9,colors.red,OS_GUI_COLOR,"")
- birch.sysLog("success.")
- end
- if settings.getVariable("system/settings","autoupdate") == false then
- settings.setVariable("system/settings","autoupdate","true")
- edge.button(2,8,5,8,OS_STARTMENU_COLOR,OS_GUI_COLOR,"Auto Updates")
- edge.button(6,9,6,8,colors.lightGray,OS_GUI_COLOR," ON ")
- edge.button(3,9,5,9,colors.green,OS_GUI_COLOR,"")
- edge.button(3,9,4,9,colors.gray,OS_GUI_COLOR,"")
- end
- end
- if x == 3 and y == 5 or x == 4 and y == 5 or x == 5 and y == 5 or x == 6 and y == 5 or x == 7 and y == 5 or x == 8 and y == 5 or x == 9 and y == 5 or x == 10 and y == 5 or x == 11 and y == 5 or x == 12 and y == 5 or x == 13 and y == 5 then
- shell.run("pastebin run UgSYtY4H")
- end
- if x == 3 and y == 7 or x == 4 and y == 7 or x == 5 and y == 7 or x == 6 and y == 7 or x == 7 and y == 7 or x == 8 and y == 7 or x == 9 and y == 7 or x == 10 and y == 7 or x == 12 and y == 7 or x == 13 and y == 7 then
- shell.run("pastebin run haULzXdY")
- end
- end
- end
- if x == 3 and y == 5 or x == 4 and y == 5 or x == 5 and y == 5 or x == 6 and y == 5 or x == 7 and y == 5 or x == 8 and y == 5 or x == 9 and y == 5 or x == 10 and y == 5 or x == 11 and y == 5 or x == 12 and y == 5 or x == 13 and y == 5 then
- edge.button(3,5,13,5,colors.white,colors.white,"")
- term.setCursorPos(3,5)
- term.setTextColor(colors.black)
- newp = read("*")
- settings.setVariable("system/settings","loginkey",newp)
- desktop()
- end
- if x == 3 and y == 3 or x == 4 and y == 3 or x == 5 and y == 3 or x == 6 and y == 3 or x == 7 and y == 3 or x == 8 and y == 3 or x == 9 and y == 3 or x == 10 and y == 3 or x == 11 and y == 3 or x == 12 and y == 3 or x == 13 and y == 3 then
- edge.button(1,1,15,19,OS_STARTMENU_COLOR,OS_GUI_COLOR," Theme")
- edge.button(2,3,15,3,OS_STARTMENU_COLOR,OS_GUI_COLOR,"Pick a theme:")
- edge.button(3,5,13,5,colors.gray,OS_GUI_COLOR,"Dark")
- edge.button(3,7,13,7,colors.white,OS_GUI_COLOR,"Bright")
- edge.button(3,9,13,9,CTHEME,OS_GUI_COLOR,"Custom")
- if settings.getVariable("system/settings","theme") == "bright" then
- edge.button(14,7,14,7,OS_STARTMENU_COLOR,OS_GUI_COLOR,"<")
- end
- if settings.getVariable("system/settings","theme") == "dark" then
- edge.button(14,5,14,5,OS_STARTMENU_COLOR,OS_GUI_COLOR,"<")
- end
- if settings.getVariable("system/settings","theme") == "custom" then
- edge.button(14,9,14,9,OS_STARTMENU_COLOR,OS_GUI_COLOR,"<")
- end
- --edge.button(3,11,13,11,colors.gray,OS_GUI_COLOR,"Edit Custom")
- while(true) do
- local event, button, x, y = os.pullEvent("mouse_click")
- if x == 16 and y == 9 then
- desktop()
- end
- if x == 3 and y == 9 or x == 4 and y == 9 or x == 5 and y == 9 or x == 6 and y == 9 or x == 7 and y == 9 or x == 8 and y == 9 or x == 9 and y == 9 or x == 10 and y == 9 or x == 11 and y == 9 or x == 12 and y == 9 or x == 13 and y == 9 then
- settings.setVariable("system/settings","theme","custom")
- edge.button(3,9,13,9,CTHEME,OS_GUI_COLOR,"Theme set!")
- end
- if x == 3 and y == 5 or x == 4 and y == 5 or x == 5 and y == 5 or x == 6 and y == 5 or x == 7 and y == 5 or x == 8 and y == 5 or x == 9 and y == 5 or x == 10 and y == 5 or x == 11 and y == 5 or x == 12 and y == 5 or x == 13 and y == 5 then
- settings.setVariable("system/settings","theme","dark")
- edge.button(3,5,13,5,colors.gray,OS_GUI_COLOR,"Theme set!")
- end
- if x == 3 and y == 7 or x == 4 and y == 7 or x == 5 and y == 7 or x == 6 and y == 7 or x == 7 and y == 7 or x == 8 and y == 7 or x == 9 and y == 7 or x == 10 and y == 7 or x == 11 and y == 7 or x == 12 and y == 7 or x == 13 and y == 7 then
- settings.setVariable("system/settings","theme","bright")
- edge.button(3,7,13,7,colors.white,OS_GUI_COLOR,"Theme set!")
- end
- if x == 3 and y == 11 or x == 4 and y == 11 or x == 5 and y == 11 or x == 6 and y == 11 or x == 7 and y == 11 or x == 8 and y == 11 or x == 9 and y == 11 or x == 10 and y == 11 or x == 11 and y == 11 or x == 12 and y == 7 or x == 13 and y == 11 then
- edge.button(15,1,52,19,colors.gray,OS_GUI_COLOR," Edit Theme")
- edge.xprint("WIP",20,5,colors.red)
- sleep(5)
- desktop()
- end
- end
- --term.setCursorPos(3,3)
- --term.setTextColor(colors.black)
- --thm = read()
- --settings.setVariable("system/settings","theme",thm)
- --desktop()
- end
- if x == 3 and y == 7 or x == 4 and y == 7 or x == 5 and y == 7 or x == 6 and y == 7 or x == 7 and y == 7 or x == 8 and y == 7 or x == 9 and y == 7 or x == 10 and y == 7 or x == 11 and y == 7 or x == 12 and y == 7 or x == 13 and y == 7 then
- edge.button(3,7,13,7,colors.white,colors.white,"")
- term.setCursorPos(3,7)
- term.setTextColor(colors.black)
- usr = read()
- settings.setVariable("system/settings","username",usr)
- desktop()
- end
- end
- end
- if x == 3 and y == 5 or x == 4 and y == 5 or x == 5 and y == 5 or x == 6 and y == 5 or x == 7 and y == 5 or x == 8 and y == 5 or x == 9 and y == 5 or x == 10 and y == 5 or x == 11 and y == 5 or x == 12 and y == 5 or x == 13 and y == 5 then
- edge.button(3,5,13,5,colors.white,colors.white,"Side:")
- term.setCursorPos(3+5,5)
- term.setTextColor(colors.black)
- side = io.read()
- term.setTextColor(colors.white)
- if peripheral.isPresent(side) == true then
- shell.run("monitor "..side.." startup")
- else
- edge.button(3,5,13,5,colors.red,colors.white,"No monitor")
- end
- end
- if x == 3 and y == 3 or x == 4 and y == 3 or x == 5 and y == 3 or x == 6 and y == 3 or x == 7 and y == 3 or x == 8 and y == 3 or x == 9 and y == 3 or x == 10 and y == 3 or x == 11 and y == 3 or x == 12 and y == 3 or x == 13 and y == 3 then
- edge.button(3,3,13,3,colors.white,colors.white,"")
- term.setCursorPos(3,3)
- term.setTextColor(colors.black)
- searhquery = io.read()
- if searhquery == "home" then
- term.setTextColor(colors.white)
- return OS_DESKTOP()
- elseif searhquery == "log out" then
- return OS_LOGIN_SCREEN()
- elseif searhquery == "info" then
- return SYSTEM_INFO()
- elseif searhquery == "shut down" then
- birch.off()
- elseif searhquery == "restart" then
- birch.restart()
- elseif searhquery == "delete" then
- edge.button(3,3,13,3,colors.white,colors.white,"File:")
- term.setCursorPos(8,3)
- term.setTextColor(colors.black)
- local dir = io.read()
- edge.makeFile(dir)
- shell.run("rm "..dir)
- elseif searhquery == "cmd" then
- desktop() -- 420 blaze it
- elseif searhquery == "force oldUISys" then
- birch.oldUI = true
- return OS_DESKTOP()
- elseif searhquery == "force noBoot" then
- settings.setVariable("system/settings","disablebootan","true")
- elseif searhquery == "force Boot" then
- settings.setVariable("system/settings","disablebootan","false")
- elseif searhquery == "create" then
- edge.button(3,3,13,3,colors.white,colors.white,"Dir:")
- term.setCursorPos(7,3)
- term.setTextColor(colors.black)
- local dir = io.read()
- edge.makeFile(dir)
- shell.run("edit "..dir)
- elseif searhquery == "run" then
- edge.button(3,3,13,3,colors.white,colors.white,"Dir:")
- term.setCursorPos(7,3)
- term.setTextColor(colors.black)
- local dir = io.read()
- shell.run(dir)
- else
- term.setTextColor(colors.white)
- if searchquery == "update" or fs.exists(searhquery) then
- shell.run("edit "..searhquery)
- return desktop()
- else
- desktop()
- end
- --if x == 3 and y == 7
- --end
- end
- end
- end --????
- end
- end
- end
- function OS_LOGIN_SCREEN()
- if fs.exists("system/crashlog") then
- if settings.getVariable("system/crashlog","crash") == "true" then
- term.setTextColor(colors.white)
- edge.button(1,1,42,5,OS_STARTMENU_COLOR,OS_GUI_COLOR,"[x] SYSTEM CRASH REPORT")
- edge.button(5,2,42,5,OS_STARTMENU_COLOR,OS_GUI_COLOR,"BirchOS has recently crashed due to")
- edge.button(5,3,42,5,OS_STARTMENU_COLOR,OS_GUI_COLOR,"missing files or errors in the system.")
- edge.button(5,4,42,5,OS_STARTMENU_COLOR,OS_GUI_COLOR,"Reason: "..tostring(settings.getVariable("system/crashlog","crash_reason")))
- term.setTextColor(OS_TEXT_COLOR)
- while(true) do
- local event, button, x, y = os.pullEvent("mouse_click")
- if x == 2 and y == 1 then
- settings.setVariable("system/crashlog","crash","false")
- OS_LOGIN_SCREEN()
- end
- end
- end
- end
- term.clear()
- birch.sysLog("Login screen loaded.")
- local time = os.time()
- if settings.getVariable("system/settings","timeformat") == "12" then
- formattedTime = textutils.formatTime(time, false)
- else
- formattedTime = textutils.formatTime(time, true)
- end
- local day = os.day()
- shell.run("clear")
- edge.button(1,1,1,1,OS_GUI_COLOR,OS_GUI_COLOR,"BirchOS")
- edge.button(term.getSize() / 2 - 10,5,term.getSize() / 2 + 12,10,OS_STARTMENU_COLOR,OS_GUI_COLOR,"")
- edge.button(term.getSize() /2 + 10,5,term.getSize() / 2 + 12,5,OS_STARTMENU_COLOR,OS_GUI_COLOR,"[x]")
- edge.button(term.getSize() / 2 - 8,6,term.getSize() / 2 + 12,6,OS_STARTMENU_COLOR,OS_GUI_COLOR,"Username")
- edge.button(term.getSize() / 2 - 8,7,term.getSize() / 2 + 2,7,colors.white,OS_GUI_COLOR,"")
- edge.button(term.getSize() / 2 - 8,8,term.getSize() / 2 + 12,8,OS_STARTMENU_COLOR,OS_GUI_COLOR,"Password")
- edge.button(term.getSize() / 2 - 8,9,term.getSize() / 2 + 2,9,colors.white,OS_GUI_COLOR,"")
- edge.xtime(term.getSize() / 2 - 3,1)
- --print("")
- --term.setTextColor(OS_TEXT_COLOR)
- --birch.printcenter(formattedTime..", Day: "..day,19)
- --birch.printcenter("Login",8)
- --term.setCursorPos(21,9)
- --print("[>] "..settings.getVariable("system/settings","username").."")
- while(1) do
- local event, button, x, y = os.pullEvent("mouse_click")
- --birch.aP(x.."+"..y,colors.red)
- if x == 36 and y == 5 then
- shell.run("clear")
- edge.button(1,1,1,1,OS_GUI_COLOR,OS_GUI_COLOR,"BirchOS")
- edge.xtime(term.getSize() / 2 - 3,1)
- local tx, ty = term.getSize()
- edge.button(tx / 2 - 6,ty /2,tx / 2 + 12,ty / 2,OS_GUI_COLOR,OS_GUI_COLOR,"Shutting down.")
- sleep(2)
- os.shutdown()
- end
- if x == 14 and y == 7 or x == 18 and y == 7 or x == 19 and y == 7 or x == 20 and y == 7 or x == 21 and y == 7 or x == 22 and y == 7 or x == 23 and y == 7 or x == 24 and y == 7 or x == 25 and y == 7 or x == 26 and y == 7 or x == 27 and y == 7 then
- edge.button(term.getSize() / 2 - 8,7,term.getSize() / 2 + 2,7,colors.white,OS_GUI_COLOR,"")
- term.setCursorPos(term.getSize() / 2 - 8,7)
- term.setTextColor(colors.black)
- username = io.read()
- if username == "root_nocredentials" then
- edge.button(term.getSize() / 2 - 8,8,term.getSize() / 2 + 12,8,OS_STARTMENU_COLOR,OS_GUI_COLOR,"Password")
- edge.button(term.getSize() / 2 - 8,9,term.getSize() / 2 + 2,9,colors.white,OS_GUI_COLOR,"")
- term.setCursorPos(term.getSize() / 2 -8 ,9)
- term.setTextColor(colors.black)
- p = read("*")
- if p == "root_sysLoginAdm" then
- desktop()
- else
- edge.button(term.getSize() / 2 - 8,9,term.getSize() / 2 + 2,9,colors.red,OS_GUI_COLOR,"")
- end
- end
- if username == settings.getVariable("system/settings","username") then
- if settings.getVariable("system/settings","loginkey") == "nil" then
- desktop()
- end
- edge.button(term.getSize() / 2 - 8,8,term.getSize() / 2 + 12,8,OS_STARTMENU_COLOR,OS_GUI_COLOR,"Password")
- edge.button(term.getSize() / 2 - 8,9,term.getSize() / 2 + 2,9,colors.white,OS_GUI_COLOR,"")
- term.setCursorPos(term.getSize() / 2 -8 ,9)
- term.setTextColor(colors.black)
- p = read("*")
- if p == settings.getVariable("system/settings","loginkey") then
- desktop()
- else
- edge.button(term.getSize() / 2 - 8,9,term.getSize() / 2 + 2,9,colors.red,OS_GUI_COLOR,"")
- end
- else
- edge.button(term.getSize() / 2 - 8,7,term.getSize() / 2 + 2,7,colors.red,OS_GUI_COLOR,"")
- end
- end
- end
- end
- function virtualos()
- edge.button(1,1,15,19,OS_STARTMENU_COLOR,OS_GUI_COLOR," VirtualOS")
- edge.button(3,5,13,5,colors.gray,OS_GUI_COLOR,"Boot")
- while(true) do
- local event, button, x, y = os.pullEvent("mouse_click")
- if x >= 3 and x <= 13 and y == 5 then
- if fs.exists("system/api/source_api_programs/virtualos.lua") then
- shell.run("system/api/source_api_programs/virtualos.lua")
- else
- edge.button(term.getSize() / 2 - 10,5,term.getSize() / 2 + 12,10,colors.cyan,OS_GUI_COLOR," Uh oh!")
- edge.button(term.getSize() /2 -8,7,term.getSize() / 2 + 1, 7,colors.cyan,OS_GUI_COLOR,"BirchOS was unable")
- edge.button(term.getSize() /2 -8,8,term.getSize() / 2 +1 , 8, colors.cyan,OS_GUI_COLOR,"to load VirtualOS")
- edge.button(term.getSize() /2 -8,9,term.getSize() / 2 +1 , 9, colors.cyan,OS_GUI_COLOR,"ERR:0x1 NO LIB")
- edge.button(term.getSize() /2 - 1, 10, term.getSize() / 2 + 0, 10, colors.gray,OS_GUI_COLOR,"OK.")
- birch.sysLog("MissingLibraryException: VirtualOS libraries not found")
- while(true) do
- local event, button, x, y = os.pullEvent("mouse_click")
- if x >= term.getSize() / 2 - 1 and x <= term.getSize() / 2 + 0 and y == 10 then
- desktop()
- end
- end
- end
- end
- end
- end
- function commandline()
- print("not yet implemented ya lil shit yo")
- end
- edge.button(1,10,51,15,OS_STARTMENU_COLOR,OS_GUI_COLOR,"[x]")
- edge.button(25,11,25,11,OS_STARTMENU_COLOR,OS_GUI_COLOR,"Upgrade BirchOS now!")
- edge.button(1,12,1,12,OS_STARTMENU_COLOR,OS_GUI_COLOR,"The same familiar interface, faster and packed with features!")
- edge.button(term.getSize() /2 - 4, 15, term.getSize() / 2 + 0, 15, colors.gray,OS_GUI_COLOR,"UPGRADE")
- local event, button, x, y = os.pullEvent("mouse_click")
- if y == 10 then
- OS_LOGIN_SCREEN()
- end
- if y == 15 then
- shell.run("pastebin run eMqb3wXt")
- end
- OS_LOGIN_SCREEN()
- ]]
- BIRCHOS_EDGE = [[
- version = "2.0"
- -- Do not store OS version in an API. Never again.
- -- EDGE API MADE BY NOTHY
- function makeFile(dir,data)
- local f = fs.open(dir,"w")
- f.writeLine(data)
- f.close()
- end
- function killFile(dir) end
- function makeDir(dir) end
- function cprint(str,y)
- local x = term.getSize()
- local centerXPos = ( x - string.len(str) ) / 2
- term.setCursorPos( centerXPos, y )
- write( str )
- end
- function aprint(string , color)
- term.setTextColor(color)
- print(string)
- term.setTextColor(colors.white)
- end
- function shutdown(timer)
- sleep(timer)
- os.shutdown()
- end
- function reboot(timer)
- sleep(timer)
- os.reboot()
- end
- function setbgColor(color)
- term.setBackgroundColor(color)
- end
- function textColor(color)
- term.setTextColor(color)
- end
- function button(x,y,sx,sy,color,defaultcolor,name)
- paintutils.drawFilledBox(x,y,sx,sy,color)
- xprint(name,x,y,colors.black)
- setbgColor(defaultcolor)
- end
- function xprint(str,x,y,color)
- term.setCursorPos(x,y)
- aprint(str,color)
- term.setCursorPos(1,1)
- end
- function xtime(x,y)
- local systime = os.time()
- if settings.getVariable("system/settings","timeformat") == "12" then
- formattedTime = textutils.formatTime(systime, false)
- else
- formattedTime = textutils.formatTime(systime, true)
- end
- xprint(formattedTime,x,y,colors.black)
- end
- --1337!
- ]]
- BIRCHOS_BIRCHAPI = [[
- --systemcheckMissing()
- osversion = "REL 1.1"
- osstate = ""
- apiversion = "BIRCH2A5"
- dis = false
- release = true
- oldUI = false
- function init()
- if not dis == true then
- print("BirchOS SYSTEM API initialized!")
- end
- end
- function disableinitmessage()
- dis = true
- end
- function off()
- tclear()
- printcenter(osversion,1)
- printcenter("Shutting down",5)
- sleep(1)
- os.shutdown()
- end
- function restart()
- tclear()
- printcenter(osversion,1)
- printcenter("Restarting",5)
- sleep(1)
- os.reboot()
- end
- function systemcheck()
- --print("feature removed.")
- if not fs.exists("system") then
- osstate = "SYSTEM FILES MISSING"
- end
- if not fs.exists("system/api") then
- osstate = "API MISSING"
- end
- if not fs.exists("startup") then
- osstate = "STARTUP SCRIPT MISSING"
- end
- if settings.getVariable("system/crashlog","crash") == true then
- osstate = settings.getVariable("system/crashlog","crashreason")
- end
- end
- function tclear()
- term.clear()
- term.setCursorPos(1,1)
- end
- function crash(reason)
- term.clear()
- term.setCursorPos(1,1)
- term.setBackgroundColor(colors.blue)
- term.setTextColor(colors.white)
- term.clear()
- print("Uh oh!")
- print("Something went wrong, Please contact BirchOS Devs about this!")
- print("Useful information:")
- print("Crash reason:")
- print(reason)
- print("")
- print("A log file has been placed in:")
- print("system/log.txt")
- sysLog("!!!! CRASH !!!!")
- sysLog("CRASH INFORMATION:")
- sysLog(tostring(reason))
- sysLog(tostring(osversion))
- sysLog(tostring(apiversion)) -- 1337 (2015-12-21)
- sysLog("Username: "..settings.getVariable("system/settings","username"))
- --syslog("Release: "..tostring(release))
- --syslog("oldUI: "..tostring(oldUI))
- sleep(10)
- --fs.makeDir("system/crashlog")
- settings.setVariable("system/crashlog","crash","true")
- settings.setVariable("system/crashlog","crash_reason",tostring(reason))
- os.shutdown()
- end
- function systemcheckMissing()
- if not fs.exists("system") then
- local sysm = true
- end
- if not fs.exists("api") then
- local apim = true
- end
- if not fs.exists("startup") then
- local startupm = true
- end
- os.reboot()
- end
- function printcenter( text, y )
- local x = term.getSize()
- local centerXPos = ( x - string.len(text) ) / 2
- term.setCursorPos( centerXPos, y )
- write( text )
- end
- function aP(str , c)
- term.setTextColor(tonumber(c))
- print(str)
- term.setTextColor(colors.white)
- end
- --function advancedPrintCenter(string , color, y)
- -- local x = term.getSize()
- -- local centerXPos = ( x - string.len(text) ) / 2
- -- term.setCursorPos( centerXPos, y )
- -- term.setTextColor(colors.""..color)
- -- print(string)
- -- term.setTextColor(colors.white)
- --end
- function birchOS2()
- print("Placeholder function for BirchOS2.")
- end
- function update() -- Downloads updates.
- --shell.run("pastebin run UgSYtY4H")
- end
- function createFile(dir,data)
- local file = fs.open(dir,"w")
- file.write(data)
- file.close()
- print("File created at: "..dir)
- end
- function sysLog(string)
- --Logs system activity, highly useful for debugging.
- local time = os.time()
- if not fs.exists("system/log.txt") then
- logfile = fs.open("system/log.txt","w")
- logfile.close()
- end
- logfile = fs.open("system/log.txt","a")
- logfile.writeLine("["..time.."]: "..string.."\n")
- logfile.close()
- end
- ]]
- BIRCHOS_SETTINGS_API = [[
- local function getLines(filename)
- if not fs.exists(filename) then return end
- local t = {}
- for line in io.lines(filename) do
- table.insert(t, line)
- end
- return t
- end
- local function writeSettings(filename, settingsTable)
- if not fs.exists(filename) then return false end
- file = fs.open(filename, "w")
- for _,item in ipairs(settingsTable) do
- if item == settingsTable[table.getn(settingsTable)] then --om sista entry
- file.write(item)
- else
- file.writeLine(item)
- end
- end
- file.close()
- return true
- end
- function getVariable(filename, variableName)
- if not fs.exists(filename) then return false end
- local lns = getLines(filename)
- for _,item in ipairs(lns) do
- local var, val = string.match(item, "(.+)%s*=%s*(.+)")
- if var == variableName then
- return val
- end
- end
- return false
- end
- function setVariable(filename, variableName, value)
- local file
- if not fs.exists(filename) then
- file = fs.open(filename, "w")
- file.write(variableName.."="..value)
- file.close()
- return true
- end
- local alreadyExists = false
- local lns = getLines(filename)
- local x = 1
- for _,item in ipairs(lns) do
- local var, val = string.match(item, "(.+)%s*=%s*(.+)")
- if var == variableName then
- --print("already exists, replacing")
- lns[x] = var.."="..value
- alreadyExists = true
- end
- x = x + 1
- end
- if alreadyExists == false then
- table.insert(lns, variableName.."="..value)
- end
- writeSettings(filename,lns)
- return true
- end
- function removeVariable(filename, variableName)
- if not fs.exists(filename) then return false end
- local lns = getLines(filename)
- local x = 1
- for _,item in ipairs(lns) do
- local var, val = string.match(item, "(%w+)%s*=%s*(%w+)")
- if var == variableName then
- table.remove(lns, x)
- end
- x = x + 1
- end
- writeSettings(filename,lns)
- return true
- end
- ]]
- BIRCHOS_NETWORK_API = [[
- apiversion = "1.0"
- mmsg = false
- msg = ""
- idd = 0
- dis = false
- function init()
- if not dis == true then
- print("BirchOS Network API initialized!")
- end
- end
- function disableinitmessage()
- dis = true
- end
- function connect()
- rednet.open("right")
- end
- function disconnect()
- rednet.close()
- end
- function send(i,m)
- rednet.send(i,m)
- end
- function rec()
- id, message = rednet.receive()
- if rednet.receive() then
- mssg = true
- end
- print("[IM]("..id.."): "..message)
- end
- function block(blocked_id)
- while(true) do
- id, message = rednet.receive()
- if blocked_id == id then
- print("Message from '"..blocked_id.."' was blocked.",1)
- end
- end
- end
- function networkGUI()
- while(true) do
- local event = os.pullEvent()
- birch.tclear()
- print("Connected.")
- if event == "rednet_receive" then
- id, message = rednet.receive()
- print("[IM]("..id.."): "..message)
- end
- print("Enter message:")
- msg = io.read()
- print("To ID:")
- idd = io.read()
- send(id,msg)
- mssg = false
- end
- end
- ]]
- BIRCHOS_OPERATION_API = [[
- apiversion = "1.0"
- function init()
- if not dis == true then
- print("Background Operation API Initialized!")
- end
- end
- function disableinitmessage()
- dis = true
- end
- function performance_Test(num) -- performance test
- while(1) do
- num = num + 1
- print(num)
- --settings.setVariable("system/settings","count",num)
- if num >= 10000 then
- print("Performance test successful.")
- print("AUTOMATIC REBOOT IN 10 SECONDS")
- sleep(10)
- os.reboot()
- break
- end
- end
- end
- function createBackGroundOperation(operation_name,operation_task,operation_Executable)
- end
- function advancedTermination(task_name,task_Executable)
- end
- function forceReboot()
- term.clear()
- os.reboot()
- end
- ]]
- BIRCHOS_SC_API =[[
- dis = false
- function init()
- if not dis == true then
- print("BirchOS Source API [BETA] initialized!")
- end
- end
- function disableinitmessage()
- dis = true
- end
- function gameload(saveDir,gameProperties,bool)
- end
- function gameinitialize()
- -- This is literally used for initializing games. Literally nothing else. Game engine coming soon instead of this massive pile of shit.
- end
- function toolkit()
- end
- function advanced_toolkit()
- end
- function toolkit_crash()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.clear()
- print("SOURCEAPI TOOLKIT HAS CRASHED")
- print("REBOOTING IN 10 SECONDS")
- sleep(1)
- birch.crash("TOOLKIT CRASH")
- --os.reboot()
- end
- function color(c)
- term.setTextColor(c)
- end
- ]]
- BIRCHOS_BOOTLOADER = [[
- term.setTextColor(colors.black)
- function Loop()
- birch.tclear()
- --settings.setVariable("system/settings","unlock","true")
- print("BirchOS Bootloader (POWERED BY VICK'S SETTINGS API)")
- print("[NOTE: OS REBOOTS AFTER CHANGE]")
- print("[V] Environment variables")
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- local term = os.pullEventRaw()
- if term == "terminate" then
- shell.run("system/os.lua")
- end
- if x == 2 and y == 3 and button == 1 then
- if not page == true then
- page = true
- print("birchos.system.settings.modified."..settings.getVariable("system/settings","test"))
- --print()
- print("birchos.system.settings.isvalid."..settings.getVariable("system/settings","isvalid"))
- --print()
- print("birchos.system.settings.disablebootan."..settings.getVariable("system/settings","disablebootan"))
- print("birchos.system.settings.test."..settings.getVariable("system/settings","test"))
- print("birchos.unlock."..settings.getVariable("system/settings","unlock"))
- print("[X] [NYI] | [X] EDIT")
- elseif not page == false then
- page = false
- Loop()
- end
- end
- if x == 14 and y == 9 and button == 1 and page == true then
- print("ENTER VARIABLE NAME")
- varName = io.read()
- print("VALUE:")
- varVal = io.read()
- settings.setVariable("system/settings",varName,varVal)
- os.reboot()
- end
- --if x == 2 and y == 9 and button == 1 and page == true then
- -- print("ENTER VARIABLE TO EDIT (only type the last part of the var (not true/false part))")
- -- ed = io.read()
- -- if ed == string.lower("modified") then
- -- print("True or false?")
- -- ed = io.read()
- -- if ed == string.lower("true") then
- -- settings.setVariable("system/settings","test","true")
- -- os.reboot()
- -- elseif ed == string.lower("false") then
- -- settings.setVariable("system/settings","test","false")
- -- os.reboot()
- -- end
- -- elseif ed == string.lower("disablebootan") then
- -- print("True or false?")
- -- ed = io.read()
- -- if ed == string.lower("true") then
- -- settings.setVariable("system/settings","disablebootan","true")
- -- os.reboot()
- -- elseif ed == string.lower("false") then
- -- settings.setVariable("system/settings","disablebootan","false")
- -- os.reboot()
- -- end
- -- end
- --end
- end
- end
- Loop()
- ]]
- BIRCHOS_STARTUP = [[
- local BOOTLOADER_TAG = "[BOOT]"
- local edge_boot_dir = "sys16/edge/"
- os.pullEvent = os.pullEventRaw
- --shell.run("pastebin run eMqb3wXt")
- function boot_de_faking_os(file_name)
- --print("Birch OS is loading files..")
- if fs.exists(file_name) then
- os.loadAPI("system/api/settings")
- --sleep(0.1)
- os.loadAPI("system/api/birch")
- --birch.init()
- --sleep(0.1)
- --os.loadAPI("beta/birchtwo")
- --sleep(0.1)
- --os.loadAPI("system/api/sc")
- --sc.init()
- --sleep(0.1)
- --os.loadAPI("system/api/network")
- --network.init()
- --sleep(0.1)
- --os.loadAPI("system/api/operation")
- --operation.init()
- --sleep(0.1)
- --os.loadAPI("beta/systemdiag")
- --sleep(0.1)
- --print(BOOTLOADER_TAG..": SYSTEM INITIALIZED")
- shell.run(file_name)
- else
- os.loadAPI("system/api/settings")
- os.loadAPI("system/api/birch")
- os.loadAPI("beta/birchtwo")
- os.loadAPI("system/api/sc")
- os.loadAPI("system/api/network")
- os.loadAPI("system/api/operation")
- os.loadAPI("beta/systemdiag")
- birch.crash(BOOTLOADER_TAG..": FILE NOT FOUND")
- end
- end
- shell.run("clear")
- boot_de_faking_os("system/api/source_api_programs/settingsChecker")
- ]]
- BIRCHOS_CHAT = [[
- function printCenter(text)
- term.setCursorPos(sizeX/2-#text/2,1)
- print(text)
- end
- function fill(color)
- for line=1,sizeY do
- paintutils.drawLine(1,line,sizeX,line,colors[color])
- end
- end
- function updateChatHud()
- term.clear()
- fill("black")
- paintutils.drawPixel(sizeX,1,colors.red)
- term.setCursorPos(sizeX,1)
- io.write("X")
- paintutils.drawPixel(sizeX-1,1,colors.blue)
- term.setCursorPos(sizeX-1,1)
- io.write("U")
- paintutils.drawLine(1,sizeY,sizeX,sizeY,colors[user.color])
- paintutils.drawLine(sizeX/2-(11+#user.room)/2-1,1,sizeX/2-(11+#user.room)/2+11+#user.room,1,colors[user.color])
- printCenter("Chatroom : "..user.room)
- term.setCursorPos(1,2)
- io.write("Color : "..user.color.." ")
- for i=1,sizeY-3 do
- local disp = chats[#chats-(i-3)]
- if disp ~= nil then
- term.setCursorPos(1,sizeY-i)
- io.write(disp)
- end
- end
- term.setCursorPos(1,sizeY)
- io.write("\\\\>")
- end
- function send(userName,room,input)
- local package = userName..";"..room..";"..input
- --chats[#chats+1] = (userName ~= "Cont." and (user.userName.." : ") or "")..input
- print(package)
- rednet.broadcast(package)
- updateChatHud()
- end
- user = {
- color = "black",
- room = "Default",
- }
- sizeX,sizeY = term.getSize()
- chats = {}
- version = "v1.0"
- for _,side in pairs({"left","right","top","bottom","front","back"}) do
- if peripheral.getType(side) == "modem" then
- rednet.open(side)
- break
- end
- end
- if not term.isColor() then
- for i,v in pairs(paintutils) do
- paintutils[i] = function() return 0 end
- end
- end
- term.clear()
- printCenter("CCChat "..version.." by TeamDman")
- io.write("Enter your username : ")
- user.userName = io.read()
- term.clear()
- updateChatHud()
- while true do
- local event,arg1,arg2,arg3 = os.pullEvent()
- if event == "rednet_message" then
- local name,room,message = arg2:match("(.*);(.*);(.*)")
- if name == "Cont." and room == user.room then
- chats[#chats+1] = message
- elseif room == user.room then
- chats[#chats+1] = name.." : "..message
- end
- updateChatHud()
- elseif event == "mouse_click" or event == "key" then
- if (event == "mouse_click" and arg3 == sizeY) or (event == "key" and keys.getName(arg1) == "t") then
- sleep(0.1)
- term.setCursorPos(4,sizeY)
- local input = io.read()
- if #input+#user.userName+3 > sizeX then
- send(user.userName,user.room,input:sub(1,sizeX-(#user.userName+3)))
- input = input:sub(sizeX-(#input+#user.userName+3)+1)
- repeat
- send("Cont.",user.room,input:sub(1,sizeX))
- input = input:sub(sizeX+1)
- until #input == 0
- else
- send(user.userName,user.room,input)
- end
- elseif event == "mouse_click" and (arg3 == 2 or arg3 == 1) then
- if arg3 == 1 then
- if arg2 == sizeX then -- Close
- shell.run("system/os.lua")
- break
- elseif arg2 == sizeX-1 then -- Update
- --fs.delete("chat")
- --shell.run("pastebin","get","H0YpZjhK","/chat")
- shell.run("startup")
- break
- else
- term.setCursorPos(sizeX/2-(11+#user.room)/2,1)
- term.clearLine()
- io.write("Chatroom : ")
- user.room = io.read()
- end
- else
- term.setCursorPos(1,2)
- term.clearLine()
- io.write("Color : ")
- user.color = io.read()
- end
- updateChatHud()
- end
- end
- end
- ]]
- BIRCHOS_SETTINGS_FILE = [[
- test=false
- isvalid=false
- disablebootan=false
- unlock=false
- performanceMode=false
- username=nil
- debug=false
- loginkey=nil
- bootcode=01000001
- theme=bright
- timeformat=24
- edgebeta=false
- customprogram=nil
- -- PACKAGED SETTINGS.
- autoupdate=false
- pdate=false
- ]]
- BIRCHOS_SETTINGS_CHECKER = [[
- if fs.exists("system/settings") then
- shell.run("system/os.lua")
- else
- settings.setVariable("system/settings","test","true")
- settings.setVariable("system/settings","isvalid","true")
- settings.setVariable("system/settings","disablebootan","false")
- settings.setVariable("system/settings","unlock","true")
- settings.setVariable("system/settings","performanceMode","false")
- --mod = settings.getVariable("system/settings","test")
- --valid = settings.getVariable("system/settings","isvalid")
- shell.run("system/os.lua")
- end
- ]]
- BIRCHOS_THEME = [[
- OS_DEFAULTBACKGROUNDCOLOR=8
- OS_DEFAULTTEXTCOLOR=128
- OS_STARTMENU_SHUTDOWNCOLOR=16384
- OS_STARTMENU_LOGOUTCOLOR=32
- OS_STARTMENU_REBOOTCOLOR=16
- OS_STARTMENU_COLOR=512
- OS_STARTMENU_BG=2048
- OS_LOGINSCREEN_WELCOMECOLOR=2
- OS_CMD_BGCOLOR=1
- ]]
- BIRCHOS_SYSTEMDIAG = [[
- local os_ = nil
- local api = nil
- local system = nil
- local apiprog = nil
- local function launchdiag(s,sa,a)
- sleep(0.5)
- if s == "-s" then
- if fs.exists("system") then
- sleep(0.5)
- system = true
- else
- system = false
- end
- end
- if sa == "-sa" then
- if fs.exists("system/api/source_api_programs/bootloader") and fs.exists("system/api/source_api_programs/settingsChecker") and fs.exists("system/api/source_api_programs/virtualos.lua") then
- apiprog = true
- else
- apiprog = false
- end
- end
- if fs.exists("system/os.lua") then
- sleep(0.5)
- os_ = true
- else
- os_ = false
- end
- if fs.exists("system/api") then
- sleep(0.5)
- if fs.exists("system/api/birch") and fs.exists("system/api/network") and fs.exists("system/api/operation") and fs.exists("system/api/sc") and fs.exists("system/api/settings") then
- sleep(0.5)
- api = true
- else
- api = false
- end
- end
- result()
- end
- function result()
- print("")
- print("RESULT:")
- if apiprog == true then
- print("API PROGRAMS: OK")
- else
- term.setTextColor(colors.red)
- print("API PROGRAMS: MISSING")
- term.setTextColor(colors.white)
- end
- if api == true then
- sleep(0.1)
- print("API: OK")
- else
- term.setTextColor(colors.red)
- print("API: MISSING")
- term.setTextColor(colors.white)
- end
- if system == true then
- sleep(0.1)
- print("SYSTEM: OK")
- else
- term.setTextColor(colors.red)
- print("SYSTEM: MISSING")
- term.setTextColor(colors.white)
- end
- if os_ == true then
- sleep(0.1)
- print("OS: OK")
- else
- term.setTextColor(colors.red)
- print("OS: MISSING")
- term.setTextColor(colors.white)
- end
- end
- function diag(arg1,arg2,arg3)
- print("LAUNCHING SYSTEM DIAGNOSE")
- sleep(0.2)
- print("WAITING FOR RESULTS...")
- launchdiag(arg1,arg2,arg3)
- end
- ]]
- BIRCHTWO = [[
- apiversion = "8.6"
- osversion = birch.osversion
- dis = false
- function init()
- if not dis == true then
- print("BirchOS Ultimate API initialized!")
- end
- end
- function disableinitmessage()
- dis = true
- end
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- function crash(reason)
- term.clear()
- term.setCursorPos(1,1)
- print("ERROR"..osversion..apiversion.."x"..tostring(math.random(1000000,9127830)))
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- term.setBackgroundColor(colors.blue)
- term.setTextColor(colors.white)
- term.clear()
- print("BIRCH OS HAS RUN INTO AN ERROR AND HAD TO TERMINATE TO PREVENT ERROR")
- print("IF YOU SEE THIS FREQUENTLY PLEASE CONTACT THE DEVELOPERS OF BIRCH OS")
- print("[INFORMATION]")
- print("CRASH_REASON:")
- print(reason)
- sleep(10)
- --fs.makeDir("system/crashlog")
- settings.setVariable("system/crashlog","crash","true")
- settings.setVariable("system/crashlog","crash_reason",tostring(reason))
- os.reboot()
- end
- function systemcheckMissing()
- if not fs.exists("system") then
- local sysm = true
- end
- if not fs.exists("api") then
- local apim = true
- end
- if not fs.exists("startup") then
- local startupm = true
- end
- os.reboot()
- end
- function printcenter( text, y, col )
- term.setTextColor(col)
- local x = term.getSize()
- local centerXPos = ( x - string.len(text) ) / 2
- term.setCursorPos( centerXPos, y )
- write( text )
- term.setTextColor(colors.white)
- end
- function aP(str , c)
- term.setTextColor(c)
- print(str)
- term.setTextColor(colors.white)
- end
- ]]
- function Install()
- if not fs.exists("system/settings") then
- if fs.getFreeSpace("/") <= 80000 then
- printcenter(math.floor(fs.getFreeSpace("/")/1024) .."KB out of required 80KB",9)
- printcenter("Birch OS",8)
- printcenter("Not enough space on disk! :(",10)
- sleep(10)
- os.reboot()
- end
- end
- --fs.delete("*/*")
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- shell.run("clear")
- printcenter("Birch OS",8)
- printcenter("[= ]",10)
- btheme = fs.open("system/api/thememanager/themes/theme.birchtheme","w")
- term.setCursorPos(1,2)
- btheme.write(BIRCHOS_THEME)
- btheme.close()
- term.setBackgroundColor(colors.white)
- shell.run("clear")
- printcenter("Birch OS",8)
- printcenter("[= ]",10)
- sleep(0.1)
- bsettch = fs.open("system/api/source_api_programs/settingsChecker","w")
- term.setBackgroundColor(colors.white)
- shell.run("clear")
- printcenter("Birch OS",8)
- printcenter("[== ]",10)
- bsettch.write(BIRCHOS_SETTINGS_CHECKER)
- bsettch.close()
- if not fs.exists("system/settings") then
- term.setBackgroundColor(colors.white)
- shell.run("clear")
- printcenter("Birch OS",8)
- printcenter("[=== ]",10)
- bsettf = fs.open("system/settings","w")
- sleep(0.25)
- bsettf.write(BIRCHOS_SETTINGS_FILE)
- bsettf.close()
- end
- bchat = fs.open("system/programs/chat.lua","w")
- term.setBackgroundColor(colors.white)
- shell.run("clear")
- printcenter("Birch OS",8)
- printcenter("[==== ]",10)
- sleep(0.1)
- bchat.write(BIRCHOS_CHAT)
- bchat.close()
- bos = fs.open("system/os.lua","w")
- term.setBackgroundColor(colors.white)
- shell.run("clear")
- printcenter("Birch OS",8)
- printcenter("[====== ]",10)
- sleep(0.1)
- bos.write(BIRCHOS_OS)
- bos.close()
- startup = fs.open("startup","w")
- term.setBackgroundColor(colors.white)
- shell.run("clear")
- printcenter("Birch OS",8)
- printcenter("[======== ]",10)
- sleep(0.1)
- startup.write(BIRCHOS_STARTUP)
- startup.close()
- bootl = fs.open("system/api/source_api_programs/bootloader","w")
- term.setBackgroundColor(colors.white)
- shell.run("clear")
- printcenter("Birch OS",8)
- printcenter("[========= ]",10)
- sleep(0.1)
- bootl.write(BIRCHOS_BOOTLOADER)
- bootl.close()
- scapi = fs.open("system/api/sc","w")
- term.setBackgroundColor(colors.white)
- shell.run("clear")
- printcenter("Birch OS",8)
- printcenter("[==========]",10)
- --printcenter("Finishing up...",12)
- sleep(0.1)
- scapi.write(BIRCHOS_SC_API)
- scapi.close()
- birchapi = fs.open("system/api/birch","w")
- birchapi.write(BIRCHOS_BIRCHAPI)
- birchapi.close()
- operationapi = fs.open("system/api/operation","w")
- sleep(0.1)
- operationapi.write(BIRCHOS_OPERATION_API)
- operationapi.close()
- settingsapi = fs.open("system/api/settings","w")
- settingsapi.write(BIRCHOS_SETTINGS_API)
- settingsapi.close()
- networkapi = fs.open("system/api/network","w")
- networkapi.write(BIRCHOS_NETWORK_API)
- networkapi.close()
- sysdiag = fs.open("beta/systemdiag","w")
- sysdiag.write(BIRCHOS_SYSTEMDIAG)
- sysdiag.close()
- b2 = fs.open("beta/birchtwo","w")
- b2.write(BIRCHTWO)
- b2.close()
- edge = fs.open("system/api/edge","w")
- edge.write(BIRCHOS_EDGE)
- edge.close()
- desktop = fs.open("system/desktop_test.lua","w")
- desktop.write(BIRCHOS_DESKTOP)
- desktop.close()
- sleep(1)
- os.reboot()
- end
- function aP(str , c)
- term.setTextColor(c)
- print(str)
- term.setTextColor(colors.white)
- end
- function printcenter( text, y )
- local x = term.getSize()
- local centerXPos = ( x - string.len(text) ) / 2
- term.setCursorPos( centerXPos, y )
- write( text )
- end
- function Main()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- shell.run("clear")
- if fs.exists("system/os.lua") and fs.exists("system/desktop_test.lua") then
- printcenter("Do you want to update BirchOS?",1)
- else
- printcenter("Do you want to install BirchOS?",1)
- end
- term.setCursorPos(1,2)
- print("")
- if fs.exists("system/os.lua") and fs.exists("system/settings") and fs.exists("system/desktop_test.lua") then
- aP("[X] Update",colors.green)
- print("")
- aP("[X] Exit",colors.red)
- else
- aP("[X] Yes",colors.green)
- print("")
- aP("[X] No",colors.red)
- end
- if fs.exists("system/settings") then
- term.setCursorPos(14,3)
- aP("[X] Repair",colors.orange)
- term.setCursorPos(1,6)
- end
- term.setTextColor(colors.black)
- print("")
- print("Changes in PRE-RELEASE 1.1:")
- print(" + Added HTTP detection")
- print(" + Added update notifications")
- print(" - Removed verification features")
- print(" * Working towards a more open OS")
- print(" Be open. Be free. - Nothy")
- print("Changes in Beta 1.4:")
- print(" * New installer")
- print(" + Added repair option to installer")
- print(" + VirtualOS is back! :D")
- print(" * Trying out window features")
- print(" (Big step towards multitasking)")
- while(true) do
- local event, button, x, y = os.pullEvent("mouse_click")
- if x == 2 and y == 3 then
- shell.run("clear")
- Install()
- end
- if x == 15 and y == 3 then
- shell.run("rm system")
- shell.run("rm beta")
- shell.run("rm startup")
- Install()
- end
- if x == 2 and y == 5 then
- shell.run("clear")
- print("Goodbye!")
- sleep(1)
- os.shutdown()
- end
- end
- end
- if not term.isColor() then
- shell.run("clear")
- printcenter("Birch OS Error",5)
- printcenter("The current terminal is not supported.",6)
- sleep(5)
- os.shutdown()
- else
- Install()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement