blob: a1efcd0f5ce983d59ce4d1fc44113f85bdcd0b5b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
-- bits-UI: An operating system for ComputerCraft. Licensed with GPL-3.0.
local boot = "/system/boot.lua"
function bootloader()
term.setCursorPos(1,1)
term.write("Welcome to the BUBL boot loader!\n")
term.setCursorPos(1,3)
term.write("1. Boot bits-UI\n")
term.setCursorPos(1,4)
term.write("2. Update bits-UI\n")
term.setCursorPos(1,5)
term.write("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()
term.write("Running updater...")
sleep(3)
shell.run("pastebin", "run", "7XY80hfG")
elseif input == "3" then
clear()
term.write(os.version())
term.setCursorPos(1,2)
else
term.write("[ERROR] Invalid number.")
bootloader()
bootloaderInput()
end
end
if fs.exists(boot) then
term.setTextColor(colors.green)
term.write("Boot detected!")
else
clear()
term.setTextColor(colors.red)
term.write("[ERROR] System has been halted.")
term.setCursorPos(1,2)
term.write("Details: Cannot find boot.lua")
sleep(3)
os.shutdown()
end
clear()
bootloader()
bootloaderInput()
|