aboutsummaryrefslogtreecommitdiff
path: root/startup
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@gmail.com>2019-03-05 19:26:59 -0500
committerAndrew Lee <alee14498@gmail.com>2019-03-05 19:26:59 -0500
commita18407bdb9c87ac970418cd625abe38f550ab45c (patch)
treecb40abeaef3b81dcd1cbf23304e80acf0445aed2 /startup
parent84a82712e4e3bd6826e572e63accc0800992eb4b (diff)
downloadbits-UI-a18407bdb9c87ac970418cd625abe38f550ab45c.tar.gz
bits-UI-a18407bdb9c87ac970418cd625abe38f550ab45c.tar.bz2
bits-UI-a18407bdb9c87ac970418cd625abe38f550ab45c.zip
Added a bunch of stuff
Diffstat (limited to 'startup')
-rw-r--r--startup74
1 files changed, 2 insertions, 72 deletions
diff --git a/startup b/startup
index b188287..94315d8 100644
--- a/startup
+++ b/startup
@@ -1,72 +1,2 @@
--- bits-UI: An operating system for ComputerCraft. Licensed with GPL-3.0.
-local boot = "/system/boot.lua"
-
-function bootloader()
- term.setCursorPos(1,1)
- print("Welcome to the BUBL boot loader!\n")
- term.setCursorPos(1,3)
- print("1. Boot bits-UI\n")
- term.setCursorPos(1,4)
- print("2. Update bits-UI\n")
- term.setCursorPos(1,5)
- print("3. Boot CraftOS\n")
- term.setCursorPos(1,7)
- term.write("> ")
-end
-
-function clear()
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.white)
-end
-
-function bootloaderInput()
- local input = read()
-
- if input == "1" then
- clear()
- shell.run("/system/boot.lua")
- elseif input == "2" then
- clear()
- if fs.exists("dev_mode") then
- print("You are running developer mode! You cannot update bit-UI.")
- sleep(3)
- clear()
- bootloader()
- bootloaderInput()
- else
- print("Running updater...")
- sleep(3)
- shell.run("pastebin", "run", "7XY80hfG")
- end
- elseif input == "3" then
- clear()
- print(os.version())
- term.setCursorPos(1,2)
- else
- print("[ERROR] Invalid number.")
- sleep(2)
- clear()
- bootloader()
- bootloaderInput()
- end
-
-end
-
-
-if fs.exists(boot) then
- term.setTextColor(colors.green)
- print("Boot detected!")
-else
- clear()
- term.setTextColor(colors.red)
- print("[ERROR] System has been halted.")
- term.setCursorPos(1,2)
- print("Details: Cannot find boot.lua")
- sleep(3)
- os.shutdown()
-end
-
-clear()
-bootloader()
-bootloaderInput() \ No newline at end of file
+-- It redirects to the startup lua file if it's running a older version of CraftOS.
+shell.run("startup.lua")