Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Skroty do komend --
- local function s(...) return sleep(...) end
- local function w(...) return write(...) end
- local function p(...) return print(...) end
- local function tw(...) return term.write(...) end
- local function scp(...) return term.setCursorPos(...) end
- local function sbc(...) return term.setBackgroundColor(...) end
- local function stc(...) return term.setTextColor(...) end
- local function tc(...) return term.clear(...) end
- local function tcl(...) return term.clearLine(...) end
- local function r(...) return shell.run(...) end
- local function sp(...) return textutils.slowPrint(...) end
- local function sw(...) return textutils.slowWrite(...) end
- local function fse(...) return fs.exists(...) end
- local function pul(...) return paintutils.loadImage(...) end
- local function pud(...) return paintutils.drawImage(...) end
- local function pfb(...) return paintutils.drawFilledBox(...) end
- local function su(...) return os.shutdown(...) end
- local function re(...) return os.reboot(...) end
- local function pdp(...) return paintutils.drawPixel(...) end
- function logobraz()
- pfb(1, 1, 51, 5, colors.blue)
- pfb(1, 6, 51, 14, colors.lightBlue)
- pfb(1, 15, 51, 19, colors.blue)
- pfb(15, 7, 17, 9, colors.gray)
- scp(1,1)
- p("Logowanie MineCore")
- scp(1,2)
- p("Wybierz uzytkownika, a nastepnie wpisz haslo.")
- end
- -- Funkcja do otrzymywania rozmiaru folderu/pliku --
- function getSize(path)
- local size = 0
- for _, file in ipairs(fs.list(path)) do
- if fs.isDir(fs.combine(path, file)) then
- size = size + getSize(fs.combine(path, file))
- else
- size = size + fs.getSize(fs.combine(path, file))
- end
- end
- return size
- end
- local data = os.day()
- -- Odczytywanie wersji systemu --
- function wersja()
- local ver = fs.open("/os/ver/.ver", "r")
- wer = ver.readLine(1)
- end
- -- Funkcja wyswietlania pulpitu --
- function obraz()
- tc()
- pfb(1, 1, 51, 1, colors.brown)
- pfb(2, 2, 50, 17, colors.black)
- pfb(1, 1, 1, 18, colors.brown)
- pfb(1, 18, 51, 18, colors.brown)
- pfb(51, 1, 51, 18, colors.brown)
- pfb(1, 19, 5, 19, colors.green)
- pfb(6, 19, 49, 19, colors.blue)
- pdp(50, 19, colors.red)
- pdp(51, 19, colors.orange)
- sbc(colors.green)
- stc(colors.white)
- scp(1,19)
- w("Start")
- sbc(colors.brown)
- stc(colors.white)
- scp(1,1)
- p("Informacje")
- time = os.time()
- time = textutils.formatTime(time, true)
- sbc(colors.blue)
- stc(colors.white)
- scp(45,19)
- write(time)
- scp(30,19)
- w("Dzien: ", data)
- end
- -- Odczytywanie danych do logowania --
- function pliki()
- local u = fs.open("/os/.log1", "r")
- user = u.readLine(1)
- u.close()
- local h = fs.open("/os/.log2", "r")
- pass = h.readLine(1)
- h.close()
- end
- -- Logowanie --
- function log()
- sbc(colors.lightBlue)
- stc(colors.white)
- scp(18,7)
- p(user)
- scp(18,8)
- w("")
- haslo = read()
- if haslo == pass then ok = 1 else scp(18,9) stc(colors.red) p("Bledne haslo") s(2) re() end
- end
- -- Menu Start
- function start()
- pfb(1, 15, 10, 18, colors.white)
- pfb(1, 14, 10, 14, colors.blue)
- scp(1,14)
- stc(colors.white)
- p("Start")
- stc(colors.black)
- sbc(colors.white)
- scp(1,15)
- p("Ustawienia")
- scp(1,16)
- p("Programy")
- scp(1,17)
- p("CraftOS")
- scp(1,18)
- p("/run")
- point2()
- end
- function pc()
- pfb(2, 2, 50, 26, colors.white)
- pfb(4, 4, 8, 8, colors.blue)
- if fs.exists("/disk/") and fs.exists("/disk/minecore/") then pfb(12, 4, 16, 8, colors.brown) stc(colors.black) sbc(colors.white)
- scp(12,9) p("MineCore Disk") minecore = 1
- elseif fs.exists("/disk/") then pfb(12, 4, 16, 8, colors.brown) stc(colors.black) sbc(colors.white) scp(12,9) p("Dyskietka")
- end
- stc(colors.black)
- sbc(colors.white)
- scp(2,2)
- p("Ten komputer")
- scp(4,9)
- p("CC PC")
- local event, click, x, y = os.pullEvent("mouse_click")
- -- Zakladka informacje --
- function info()
- pfb(1, 2, 20, 6, colors.gray)
- stc(colors.white)
- sbc(colors.lightGray)
- scp(1,2)
- p("MineCore May Update")
- p("Wolne miejsce:")
- p(fs.getFreeSpace("/")/1024, "KB")
- p("Kompilacja: 1102D")
- p("17.07.2019")
- local event, click, x, y = os.pullEvent("mouse_click")
- end
- -- Wykrywanie wcisniecia --
- function point()
- local event, click, x, y = os.pullEvent("mouse_click")
- if x>0 and x<6 and y == 19 then start() end
- if x == 50 and y == 19 then su() end
- if x == 51 and y == 19 then re() end
- if x>0 and x<11 and y == 1 then info() end
- if x == 51 and y == 1 then pc()
- end
- -- to co wyzej, ale jeszcze raz --
- function point2()
- local event, click, x, y = os.pullEvent("mouse_click")
- if x>0 and x<9 and y == 16 then programy() end
- if x>0 and x<9 and y == 17 then error("Opuszczono MineUI 4.1") end
- if x>0 and x<11 and y == 15 then set() end
- if x>0 and x<9 and y == 18 then scp(2,2)
- stc(colors.white)
- sbc(colors.black)
- w("Wpisz nazwe pliku: ")
- plik = read()
- if fs.exists(plik) then r(plik) else error("Brak oczekiwanego pliku.") end
- end
- end
- -- Menu Programy --
- function programy()
- pfb(11, 14, 19, 16, colors.white)
- scp(12,14)
- p(">2048")
- scp(12,15)
- p("LuaIDE")
- scp(12,16)
- p("Snake")
- local event, click, x, y = os.pullEvent("mouse_click")
- if x>10 and x<20 and y == 14 then r("/os/.2048") end
- if x>10 and x<20 and y == 15 then scp(2,2) sbc(colors.black) stc(colors.white) w("Wpisz nazwe pliku: ") plik = read() r("edit", plik) end
- if x>10 and x<20 and y == 16 then r("worm") end
- end
- -- Komenda run --
- -- Ustawienia --
- function set()
- tc()
- pfb(1, 1, 51, 1, colors.blue)
- pfb(1, 2, 51, 19, colors.white)
- scp(1,1)
- sbc(colors.blue)
- stc(colors.white)
- p("Ustawienia")
- sbc(colors.white)
- stc(colors.black)
- scp(1,2)
- p("MineCore Hybrid OS")
- p("Wolne miejsce na dysku:")
- wolne = math.ceil(fs.getFreeSpace("/")/1024)
- p(wolne, "KB")
- zajete = getSize("/os/")
- lacznie = fs.getFreeSpace("/") + zajete
- print(math.ceil(zajete/1024), "KB uzyte z ", lacznie, "KB")
- p("Nazwa komputera: ")
- p(os.getComputerLabel())
- p("Zmien nazwe komputera")
- local ver = fs.open("/os/ver/.ver", "r")
- wer = ver.readLine(1)
- p("Wersja: ", wer)
- p("Nazwa uzytkownika:", user)
- p("Aktualizuj system")
- p("Zainstaluj wersje testowa")
- local event, click, x, y = os.pullEvent("mouse_click")
- if x>0 and x<20 and y == 8 then scp(1,8) sbc(colors.white) stc(colors.black) w("Wpisz nowa nazwe: ") nazwa = read() os.setComputerLabel(nazwa) end
- if x>0 and x<20 and y == 11 then r("/os/.update") end
- if x>0 and x<20 and y == 12 then r("/os/.tupdate") end
- end
- -- Kolejnosc funkcji --
- logobraz()
- pliki()
- log()
- while true do
- obraz()
- point()
- end
Add Comment
Please, Sign In to add comment