Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local w, h = term.getSize()
- if verzelist == nil then
- shell.run ("pastebin get a50Y0TaF /verze")
- verzelist = 1
- end
- local data = fs.open ("/verze", "r")
- local os1 = data.readLine()
- local os2 = data.readLine()
- local os3 = data.readLine()
- local os4 = data.readLine()
- local os5 = data.readLine()
- local os6 = data.readLine()
- local cos1 = data.readLine()
- local cos2 = data.readLine()
- local cos3 = data.readLine()
- local cos4 = data.readLine()
- local cos5 = data.readLine()
- local cos6 = data.readLine()
- data.close ()
- local function bgc(barvaP) term.setBackgroundColor(barvaP) end
- local function txc(barvaP) term.setTextColor(barvaP) end
- local function curs(xi,yi) term.setCursorPos(xi,yi) end
- local function prc(text, y)
- local w = term.getSize()
- local _, cy = term.getCursorPos()
- term.setCursorPos(math.ceil((w-#text)/2), y or cy)
- write(text)
- end
- function instalace ()
- if oss == nil then
- oss = 1
- end
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.blue)
- term.clear ()
- prc ("Installation of Pepdroll OS",2)
- term.setTextColor(colors.black)
- prc ("+------------------------------------------+",8)
- prc ("| |",9)
- prc ("| |",10)
- prc ("| |",11)
- prc ("| |",12)
- prc ("| |",13)
- prc ("| |",14)
- prc ("+------------------------------------------+",15)
- term.setBackgroundColor(colors.red)
- term.setTextColor(colors.white)
- prc(" Install ", 17)
- local myWindow = window.create(term.current(),(w/2)-21,9,42,6)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- term.setBackgroundColor(colors.lightBlue)
- term.setTextColor(colors.black)
- myWindow.setCursorPos (1,oss)
- write ">"
- myWindow.setCursorPos (42,oss)
- write "<"
- if oss == 1 then bgc(colors.lightBlue) else bgc(colors.white) end
- myWindow.setCursorPos (2,1)
- write(" ")
- myWindow.setCursorPos (2,1)
- write (os1)
- if oss == 2 then bgc(colors.lightBlue) else bgc(colors.white) end
- myWindow.setCursorPos (2,2)
- write(" ")
- myWindow.setCursorPos (2,2)
- write (os2)
- txc(colors.lightGray)
- if oss == 3 then bgc(colors.lightBlue) else bgc(colors.white) end
- myWindow.setCursorPos (2,3)
- write(" ")
- myWindow.setCursorPos (2,3)
- write (os3)
- if oss == 4 then bgc(colors.lightBlue) else bgc(colors.white) end
- myWindow.setCursorPos (2,4)
- write(" ")
- myWindow.setCursorPos (2,4)
- write (os4)
- if oss == 5 then bgc(colors.lightBlue) else bgc(colors.white) end
- myWindow.setCursorPos (2,5)
- write(" ")
- myWindow.setCursorPos (2,5)
- write (os5)
- if oss == 6 then bgc(colors.lightBlue) else bgc(colors.white) end
- myWindow.setCursorPos (2,6)
- write(" ")
- myWindow.setCursorPos (2,6)
- write (os6)
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- if x >= (w/2)-21 and x <= (w/2)+20 and y == 9 and button == 1 then
- oss = 1
- instalace ()
- elseif x >= (w/2)-21 and x <= (w/2)+20 and y == 10 and button == 1 then
- oss = 2
- instalace ()
- elseif x >= (w/2)-21 and x <= (w/2)+20 and y == 11 and button == 1 then
- oss = 3
- instalace ()
- elseif x >= (w/2)-21 and x <= (w/2)+20 and y == 12 and button == 1 then
- oss = 4
- instalace ()
- elseif x >= (w/2)-21 and x <= (w/2)+20 and y == 13 and button == 1 then
- oss = 5
- instalace ()
- elseif x >= (w/2)-21 and x <= (w/2)+20 and y == 14 and button == 1 then
- oss = 6
- instalace ()
- elseif x >= (w/2)-4 and x <= (w/2)+4 and y == 17 and button == 1 then
- fs.delete ("/verze")
- verzelist = nil
- instalaceos ()
- end
- end
- end
- function instalaceos ()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.blue)
- term.clear ()
- prc ("Starting installation, please wait",8)
- if oss == 1 then
- code = cos1
- elseif oss == 2 then
- code = cos2
- elseif oss == 3 then
- code = cos3
- elseif oss == 4 then
- code = cos4
- elseif oss == 5 then
- code = cos5
- elseif oss == 6 then
- code = cos6
- end
- if code == "" then
- instalace ()
- elseif code == "" then
- instalace ()
- elseif code == nil then
- instalace ()
- else
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.white)
- term.setCursorPos (1,17)
- fs.delete ("/instalace")
- shell.run("pastebin run", code)
- end
- end
- function start ()
- if fs.exists ("/system/RAM/pep-ins") then
- install ()
- end
- print("Booting from media.")
- print ""
- sleep(1)
- instalace ()
- end
- start ()
Add Comment
Please, Sign In to add comment