View difference between Paste ID: w36tUtgJ and DBbJiz0A
SHOW: | | - or go back to the newest paste.
1
shell.run("pastebin get bbBTPdx7 os/walktrough")
2
local w,h = term.getSize()
3
4
--Center Text
5
6
function printCentered (y,s)
7
    local x = math.floor((w - string.len(s)) /2)
8
    term.setCursorPos(x,y)
9
    term.clearLine()
10
    term.write(s)
11
end
12
13
--Drawmenu
14
15
local nOption = 1
16
17
local function drawMenu()
18
    term.setBackgroundColor(colors.cyan)
19
    term.clear()
20
    term.setCursorPos(1,1)
21
    local logo = paintutils.loadImage("os/.logo")
22
    paintutils.drawImage(logo, 1, 1)
23
    term.setBackgroundColor(colors.cyan)
24
    
25
    term.setCursorPos(w-11,1)
26
    if nOption == 1 then
27
        term.write("YES")
28
    elseif nOption == 2 then
29
        term.write("NO")
30
    elseif nOption == 3 then
31
        term.write("EXIT SETUP")
32
    else
33
        end
34
end    
35
36
--GUI
37
38
term.clear()
39
local function drawFrontend()
40
    printCentered(math.floor(h/2) -3, "")
41
    printCentered(math.floor(h/2) -2, "INSTALL USING FLOPPY DISK?")
42
    printCentered(math.floor(h/2) -1, "")
43
    printCentered(math.floor(h/2) + 0, (nOption == 1 and "[ YES ]") or "YES")
44
    printCentered(math.floor(h/2) + 1, (nOption == 2 and "[ NO ]") or "NO")
45
    printCentered(math.floor(h/2) + 2, (nOption == 3 and "[ EXIT SETUP ]") or "EXIT SETUP")
46
end
47
48
--Display
49
50
drawMenu()
51
drawFrontend()
52
53
while true do
54
    local e,p = os.pullEvent()
55
        if e == "key" then
56-
            if key == 17 or key == 200 then
56+
57
            if key == keys.up or key == 200 then
58
            
59
                if nOption > 1 then
60
                    nOption = nOption -1
61
                    drawMenu()
62
                    drawFrontend()
63-
            elseif key == 31 or key == 208 then
63+
64
            elseif key == keys.down or key == 208 then
65
                if nOption < 3 then
66
                    nOption = nOption +1
67
                    drawMenu()
68
                    drawFrontend()
69-
        elseif key == 28 then
69+
70
        elseif key == keys.enter then
71
            break
72
end
73
end
74
end
75
76
term.clear()
77
78
--Conditions
79
if nOption == 1 then
80-
    shell.run("pastebin get n5e0HdMR disk/startup")
80+
81
    shell.run("pastebin get GQyFnaPu disk/installer")
82
    shell.run("pastebin get pbLcNfKv disk/install")
83-
    shell.run("disk/install")   
83+
	shell.run("disk/install")
84
elseif nOption == 2 then
85-
    shell.run("pastebin get G7Teq7mR startup")
85+
86
    shell.run("pastebin get fAUEnic0 os/installer")
87
	shell.run("os/installer")
88-
    os.reboot()
88+
89-
    shell.run("os/installer")
89+
90
    term.clear()
91
    term.setCursorPos(1,1)
92
end