Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ProgramName = "Jmeno programu" ------------------- zamenit
- local IconName = "Jmenoprogramu" ------------------- nesmí tam byt mezery
- local CodeIcon = "V1qsgrpj" ------------------- Stazeni obrazku
- local anime = 0.2 ------------------- Délka animace
- ---------------------------------------------------------------------------------
- local w, h = term.getSize()
- local RamCesta = ("/C/system/RAM/"..ProgramName)
- local nastaveni={barva=colors.blue}
- local f=fs.open("/C/system/.core/colors","r")
- local cnt=f.readAll()
- f.close()
- local nastaveni=textutils.unserialize(cnt)
- local f=fs.open("/C/system/.core/textcol","r")
- local tnt=f.readAll()
- f.close()
- local text=textutils.unserialize(tnt)
- 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
- local f=fs.open("/C/system/RAM/user","r")
- user=f.readLine()
- f.close()
- function minimalizace ()
- if not fs.exists ("/C/system/.core/setting/mineditor") then
- shell.run ("pastebin get EiKMubhV /C/system/.core/setting/mineditor")
- minimalizace()
- end
- if fs.exists ("/C/system/RAM/"..user.."/"..ProgramName) then
- fs.delete ("/C/system/RAM/"..user.."/"..ProgramName)
- end
- local data = fs.open ("/C/system/RAM/"..user.."/"..ProgramName, "w")
- data.writeLine(funkce)
- data.close ()
- local data = fs.open ("/C/system/RAM/"..user.."/prlists", "w")
- data.writeLine (ProgramName)
- data.close ()
- shell.run ("/C/system/.core/setting/mineditor")
- end
- function ukonceni ()
- fs.delete (RamCesta)
- shell.run("/C/system/api/closeApp")
- end
- function resus ()
- if fs.exists ("/C/system/RAM/"..ProgramName) then
- local data = fs.open ("/C/system/RAM/"..ProgramName, "r")
- local funkce = data.readLine ()
- data.close ()
- local myFuncs = {
- ["funkce1"] = function()
- funkce1 ()
- end,
- }
- myFuncs[funkce]()
- menu ()
- end
- end
- function logoPepek()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.blue)
- term.setCursorPos(w/2-5,h-1)
- write " Pepek"
- term.setCursorPos(w/2+3,h-1)
- write "Soft "
- term.setCursorPos(w/2+2,h-1)
- term.setTextColor(colors.lime)
- write "@"
- end
- ---------------------------- Vlastní kod ----------------------------------------
- function start ()
- resus ()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.clear ()
- prc (ProgramName, 16)
- term.setTextColor(colors.white)
- term.setCursorPos(1,17)
- if not fs.exists ("/C/Programs/PepekSoft/"..IconName..".nft") then
- shell.run("pastebin get "..CodeIcon.." /C/Programs/PepekSoft/"..IconName..".nft")
- end
- local image = paintutils.loadImage("/C/Programs/PepekSoft/"..IconName..".nft")
- paintutils.drawImage(image, 18, 4)
- sleep (1)
- menu ()
- end
- function menu()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.clear ()
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors.black)
- term.setCursorPos(5,7)
- write " funkce1 "
- logoPepek()
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 5 and x <= 13 and y == 7 and button == 1 then
- term.setCursorPos(5,7)
- write " funkce1 "
- sleep(anime)
- funkce1()
- elseif x >= 5 and x <= 16 and y == 9 and button == 1 then
- else
- paintutils.drawLine(1, 1, 51, 1, colors.black)
- paintutils.drawPixel (51,1, colors.red)
- term.setCursorPos (51,1)
- term.setTextColor(text.barva)
- print "*"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == 51 and y == 1 then
- ukonceni ()
- else
- menu() -------- stejne jako nazev funkce
- end
- end
- break
- end
- end
- end
- function editmenu()
- logoPepek()
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 5 and x <= 28 and y == 7 and button == 1 then
- instalace = 1
- else
- paintutils.drawLine(1, 1, 51, 1, colors.black)
- paintutils.drawPixel (51,1, colors.red)
- term.setTextColor(colors.white)
- term.setCursorPos (51,1)
- print "*"
- paintutils.drawPixel (50,1, colors.lightGray)
- term.setCursorPos (50,1)
- print "<"
- paintutils.drawPixel (49,1, colors.lightGray)
- term.setCursorPos (49,1)
- print "_"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == 51 and y == 1 then
- ukonceni ()
- elseif x == 50 and y == 1 then
- menud () -------- predchozi stranka
- elseif x == 49 and y == 1 then
- minimalizace ()
- else
- editmenu() -------- stejne jako nazev funkce
- end
- end
- end
- end
- end
- function funkce1()
- funkce = "funkce1"
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.clear ()
- term.setCursorPos(2,2)
- write "Stranka 2"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 5 and x <= 45 and y == 10 and button == 1 then
- elseif x >= 41 and x <= 51 and y == 18 and button == 1 then
- else
- paintutils.drawLine(1, 1, 51, 1, colors.black)
- paintutils.drawPixel (51,1, colors.red)
- term.setTextColor(colors.white)
- term.setCursorPos (51,1)
- print "*"
- paintutils.drawPixel (50,1, colors.lightGray)
- term.setCursorPos (50,1)
- print "<"
- paintutils.drawPixel (49,1, colors.lightGray)
- term.setCursorPos (49,1)
- print "_"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == 51 and y == 1 then
- ukonceni ()
- elseif x == 50 and y == 1 then
- menu () -- predchozi stranka
- elseif x == 49 and y == 1 then
- minimalizace ()
- else
- funkce1()
- end
- end
- end
- end
- end
- start ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement