Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 start()
- pfb(1, 11, 20, 18, colors.white)
- scp(1,10)
- stc(colors.white)
- sbc(colors.black)
- p("NextUI Start ")
- scp(1,11)
- p("Zainstaluj z dysku ")
- p("Paint ")
- p("2048 ")
- p("Snake ")
- p("Edytor ")
- p("Powrot do CraftOS ")
- p("Ustawienia ")
- p("Ikony pulpitu ")
- sbc(colors.white)
- stc(colors.black)
- scp(1,10)
- p("NextUI Start ")
- local event, click, x, y = os.pullEvent("mouse_click")
- if x>0 and x<21 and y == 11 then dysk() end
- if x>0 and x<21 and y == 18 then ikony() end
- if x>0 and x<21 and y == 16 then error("Opuszczono NextUI 1.0. Aby powrocic wpisz /os/.next") end
- if x>0 and x<21 and y == 14 then sbc(colors.black) r("worm") end
- if x>0 and x<21 and y == 12 then r("/os/.paint") end
- if x>0 and x<21 and y == 17 then ust() end
- if x>0 and x<21 and y == 13 then r("/os/.2048") end
- if x>0 and x<21 and y == 15 then r("/os/.luaide")
- end
- end
- 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
- function obraz()
- sbc(colors.black)
- tc()
- sbc(colors.black)
- pfb(6, 19, 49, 19, colors.blue)
- sbc(colors.green)
- stc(colors.white)
- scp(1,19)
- w("Start")
- pdp(50,19, colors.red)
- pdp(51,19, colors.orange)
- pfb(1, 1, 51, 1, colors.blue)
- scp(1,1)
- sbc(colors.blue)
- stc(colors.white)
- p("Zarzadzanie aplikacjami")
- pfb(3, 3, 5, 3, colors.gray)
- pdp(3, 3, colors.lightGray)
- scp(6,3)
- stc(colors.white)
- sbc(colors.black)
- miejsce = math.ceil(fs.getFreeSpace("/")/1024)
- p("Dysk twardy Wolne miejsce: ", miejsce, "KB")
- scp(1,6)
- p("Aplikacje:")
- scp(6,8)
- stc(colors.white)
- sbc(colors.black)
- if fs.exists("/nshop/") then rozmiar = math.ceil(getSize("/nshop/")/1024) else
- scp(1,7) sbc(colors.black) stc(colors.white) p("Brak dostepnych aplikacji") end
- if fs.exists("/nshop/.exp") then pfb(3, 8, 5, 8, colors.blue) scp(6,8) stc(colors.white) sbc(colors.black) p("Eksplorator Rozmiar na dysku: ", rozmiar, "KB") scp(1,8) stc(colors.white) sbc(colors.red) p("X") end
- end
- while true do
- obraz()
- local event, click, x, y = os.pullEvent("mouse_click")
- if x>0 and x<6 and y == 19 then start() end
- if x == 1 and y == 8 then fs.delete("/nshop/.exp") end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement