Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function centerPrint(text,y,distance)
- if text == nil then text = "" end
- if y == nil then y = 1 end
- if distance == nil then distance = 0 end
- local dx, dy = term.getSize()
- term.setCursorPos(dx/2-#text/2-distance,y)
- print(text)
- end
- local function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- local function bg(color)
- term.setBackgroundColor(color)
- end
- local function text(color)
- term.setTextColor(color)
- end
- local version = "1.0"
- if term.isColor() then
- local isclicking = true
- while isclicking do
- bg(colors.gray)
- text(colors.white)
- clear()
- centerPrint("DooOS - Minimalistyczny system Doo",7)
- text(colors.cyan)
- centerPrint("Czy chcesz pobrac i zainstalowac ten system?",8)
- term.setCursorPos(15,10)
- bg(colors.lime)
- text(colors.white)
- write(" Tak ")
- term.setCursorPos(32,10)
- bg(colors.red)
- write(" Nie ")
- bg(colors.gray)
- local event,button,x,y = os.pullEvent("mouse_click")
- if x >= 15 and x <= 20 and y == 10 then
- isclicking = false
- bg(colors.gray)
- text(colors.orange)
- clear()
- centerPrint("Pobieranie i instalowanie systemu w toku...",10)
- sleep(3)
- shell.run("pastebin get W5etF99L git")
- shell.run("git PaffcioStudio DooOS")
- clear()
- centerPrint("Konczenie instalacji, juz prawie :)",10)
- sleep(3)
- fs.delete("git")
- clear()
- centerPrint("Konczenie instalacji, juz prawie :) [1/7]",10)
- sleep(0.1)
- fs.delete("LICENSE")
- clear()
- fs.delete(".gitignore")
- clear()
- centerPrint("Konczenie instalacji, juz prawie :) [2/7]",10)
- sleep(0.1)
- fs.move("DooOS/*", "_bak")
- clear()
- centerPrint("Konczenie instalacji, juz prawie :) [3/7]",10)
- sleep(0.1)
- fs.move("_bak/DooOS/*", "/DooOS")
- clear()
- centerPrint("Konczenie instalacji, juz prawie :) [4/7]",10)
- sleep(0.1)
- fs.move("_bak/startup", "startup")
- clear()
- fs.move("_bak/edit", "edit")
- clear()
- fs.move("_bak/hilight", "hilight")
- clear()
- fs.move("_bak/pastebin", "pastebin")
- clear()
- clear()
- centerPrint("Konczenie instalacji, juz prawie :) [5/7]",10)
- sleep(0.1)
- fs.delete("_bak")
- clear()
- fs.delete(".gitignore")
- clear()
- centerPrint("Konczenie instalacji, juz prawie :) [6/7]",10)
- sleep(0.1)
- fs.delete("DooOS_Instalacja")
- clear()
- centerPrint("Konczenie instalacji, juz prawie :) [7/7]",10)
- clear()
- centerPrint("Zaczynamy... =)",10)
- sleep(2)
- os.reboot()
- elseif x >= 32 and x <= 36 and y == 10 then
- bg(colors.gray)
- text(colors.orange)
- centerPrint("Instalacja przerwana.",15)
- centerPrint("Za moment nastapi uruchomienie CraftOS",16)
- sleep(3)
- bg(colors.black)
- text(colors.white)
- clear()
- isclicking = false
- os.reboot()
- break
- end
- end
- else
- print("Do zainstalowania DooOS wymagany jest zaawansowany")
- print("komputer. Instalacja zostanie przerwana.")
- sleep(4)
- os.reboot()
- end
Add Comment
Please, Sign In to add comment