View difference between Paste ID: yNKmYYp3 and Mapwdm1b
SHOW: | | - or go back to the newest paste.
1
term.clear()
2
print("DaanOs Installation")
3
print("Format Disk?")
4
local menuOptions = {"Yes", "No"}
5
local termX, termY = term.getSize()
6
local selected = 1
7
function centerText(text, termY)
8
term.setCursorPos(termX/2-#text/2,termY)
9
term.write("Format Disk?")
10
term.write(text)
11
return true
12
end
13
function start()
14
while true do
15
term.clear()
16
 for i,v in ipairs(menuOptions) do
17
  if i == selected then
18
       centerText(":"..v..":", i)
19
    else
20
       centerText(v,i)
21
    end
22
   end
23
   local id, key = os.pullEvent()
24
   if key == 208 and selected < #menuOptions then
25
    selected = selected + 1
26
   elseif key == 200 and selected > 1 then
27
    selected = selected - 1
28
end
29
    local id, key = os.pullEvent()
30
   if key == 28 then
31
    return selected
32
   end
33
end
34
end
35
x = start()
36
print()
37
if selected == 1 then
38-
textutils.slowPrint("Setting up installer....",20)
38+
39-
term.setBackgroundColor(colors.yellow)
39+
40
    fs.delete(file)
41-
term.setCursorPos(1,1)
41+
42-
textutils.slowPrint("Daanos Installer Set up!",20)
42+
43
shell.run("pastebin", "get", "5sZSKwDj", "startup")
44-
print("Formatting Disk...")
44+
45
end
46-
	shell.run("pastebin get iRCLtA1B install2")
46+
47
os.reboot()
48-
	shell.run("pastebin get iRCLtA1B install2")
48+