Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stahovani = nil
- pastebincode = nil
- kod1 = ""
- filename1 = nil
- akce = nil
- local function Barvy()
- if fs.exists ("/C/system/Users/"..user.."/.Registry/colors") then
- local data = fs.open("/C/system/Users/"..user.."/.Registry/colors", "r")
- BarPoz = tonumber(data.readLine())
- BarTxt = tonumber(data.readLine())
- data.close()
- end
- if BarPoz == nil or BarTxt == nil then BarPoz = 2048 BarTxt = 1 end
- 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
- 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 /system/.core/setting/mineditor")
- minimalizace()
- end
- if fs.exists ("/C/system/RAM/"..user.."/pmanager") then
- fs.delete ("/C/system/RAM/"..user.."/pmanager")
- end
- local data = fs.open ("/C/system/RAM/"..user.."/pmanager", "w")
- data.writeLine(funkce)
- data.close ()
- local data = fs.open ("/C/system/RAM/"..user.."/prlists", "w")
- data.writeLine ("Pmanager")
- data.close ()
- shell.run ("/C/system/.core/setting/mineditor")
- end
- function ukonceni ()
- fs.delete ("/C/system/RAM/pmanager")
- shell.run("/C/system/api/closeApp")
- end
- function resus ()
- if fs.exists ("/C/system/RAM/pmanager") then
- local data = fs.open ("/C/system/RAM/pmanager", "r")
- local funkce = data.readLine ()
- data.close ()
- local myFuncs = {
- ["downinstal"] = function()
- downinstal ()
- end,
- ["download"] = function()
- download ()
- end,
- ["upload"] = function()
- upload ()
- end,
- ["update"] = function()
- update ()
- end,
- ["uinstall"] = function()
- uinstall ()
- end,
- }
- myFuncs[funkce]()
- menud ()
- end
- end
- function start ()
- Barvy()
- resus ()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.clear ()
- if not fs.exists ("/C/Programs/PepekSoft/pmanager.nft") then
- shell.run("pastebin get DUNBNhMh /C/Programs/PepekSoft/pmanager.nft")
- end
- local image = paintutils.loadImage("/C/Programs/PepekSoft/pmanager.nft")
- paintutils.drawImage(image, 18, 4)
- prc ("Programs manager", 16)
- sleep (1)
- menud ()
- end
- function update ()
- funkce = "update"
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.clear ()
- paintutils.drawLine(1, 4, 51, 4, nastaveni.barva)
- term.setBackgroundColor(colors.white)
- prc (" Program manager for Pepdroll OS ", 4)
- term.setCursorPos (5,8)
- print "Paste path file for upgrade:"
- term.setBackgroundColor(colors.lightGray)
- term.setCursorPos (5,10)
- print " "
- term.setTextColor(colors.white)
- term.setCursorPos (6,10)
- print (kod2)
- term.setBackgroundColor(colors.gray)
- term.setCursorPos (41,18)
- print " Upgrade "
- 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
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- term.setCursorPos (5,10)
- print " "
- term.setCursorPos (6,10)
- kod1 = io.read ()
- upload ()
- elseif x >= 41 and x <= 51 and y == 18 and button == 1 then
- if akce == nil then
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.red)
- term.setCursorPos(5,18)
- if kod1 == "" then
- prc ("Paste a valid path!")
- elseif kod1 == " " then
- prc ("Paste a valid path!")
- elseif not fs.exists ("/"..kod1) then
- prc ("File is not exists!")
- else
- term.setTextColor(colors.black)
- term.setCursorPos(5,12)
- ---------------------------------------------------------------zapsat------------------------------
- paintutils.drawLine(1, 17, 51, 17, colors.white)
- paintutils.drawLine(1, 18, 41, 18, colors.white)
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.gray)
- term.setCursorPos (42,18)
- print " Menu "
- akce = menu
- end
- else
- akce = nil
- menud ()
- end
- 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 ()
- elseif x == 49 and y == 1 then
- minimalizace ()
- else
- update ()
- end
- end
- end
- end
- end
- function downinstal ()
- funkce = "downinstal"
- if yPos == nil then
- yPos = 8
- end
- if filename1 == nil then
- filename1 = filename
- end
- if yf == nil then
- yf=12
- end
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.clear ()
- paintutils.drawLine(1, 4, 51, 4, nastaveni.barva)
- term.setBackgroundColor(colors.white)
- prc (" Program manager for Pepdroll OS ", 4)
- term.setCursorPos(5,12)
- print "Order: "
- term.setCursorPos(5,6)
- print "Include in the menu:"
- term.setCursorPos(5,8)
- print "Auto"
- term.setCursorPos(5,9)
- print "Manual"
- term.setCursorPos(2,yPos)
- print "->"
- term.setCursorPos(20,8)
- print "Name the file menu: "
- term.setBackgroundColor(colors.lightGray)
- term.setCursorPos(40,8)
- print " "
- term.setTextColor(colors.white)
- term.setCursorPos(40,8)
- print (filename1)
- term.setBackgroundColor(colors.gray)
- term.setCursorPos (42,18)
- print " Download "
- term.setCursorPos (1,18)
- print " Back "
- local myWindow = window.create(term.current(),16,11,13,9)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- if fs.exists ("/C/system/Users/"..user.."/lsprogram") then
- local data = fs.open ("/C/system/Users/"..user.."/lsprogram", "r")
- menu1 = data.readLine ()
- path1 = data.readLine ()
- menu2 = data.readLine ()
- path2 = data.readLine ()
- menu3 = data.readLine ()
- path3 = data.readLine ()
- menu4 = data.readLine ()
- path4 = data.readLine ()
- menu5 = data.readLine ()
- path5 = data.readLine ()
- menu6 = data.readLine ()
- path6 = data.readLine ()
- menu7 = data.readLine ()
- path7 = data.readLine ()
- data.close ()
- end
- if yPos == 8 then
- term.setTextColor(colors.lightGray)
- else
- term.setTextColor(colors.white)
- end
- term.setCursorPos(17,12)
- print (menu1)
- term.setCursorPos(17,13)
- print (menu2)
- term.setCursorPos(17,14)
- print (menu3)
- term.setCursorPos(17,15)
- print (menu4)
- term.setCursorPos(17,16)
- print (menu5)
- term.setCursorPos(17,17)
- print (menu6)
- term.setCursorPos(17,18)
- print (menu7)
- if yPos == 9 then
- term.setBackgroundColor(colors.lightBlue)
- term.setCursorPos (17, yf)
- write " "
- term.setCursorPos (17, yf)
- write (filename1)
- end
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 17 and x <= 27 and y == 12 and button == 1 then
- yf = 12
- pozice = "1"
- downinstal ()
- elseif x >= 17 and x <= 27 and y == 13 and button == 1 then
- yf = 13
- pozice = "2"
- downinstal ()
- elseif x >= 17 and x <= 27 and y == 14 and button == 1 then
- yf = 14
- pozice = "3"
- downinstal ()
- elseif x >= 17 and x <= 27 and y == 15 and button == 1 then
- yf = 15
- pozice = "4"
- downinstal ()
- elseif x >= 17 and x <= 27 and y == 16 and button == 1 then
- yf = 16
- pozice = "5"
- downinstal ()
- elseif x >= 17 and x <= 27 and y == 17 and button == 1 then
- yf = 17
- pozice = "6"
- downinstal ()
- elseif x >= 17 and x <= 27 and y == 18 and button == 1 then
- yf = 18
- pozice = "7"
- downinstal ()
- elseif x >= 5 and x <= 15 and y == 8 and button == 1 then
- yPos = 8
- downinstal ()
- elseif x >= 5 and x <= 15 and y == 9 and button == 1 then
- yPos = 9
- downinstal ()
- elseif x >= 40 and x <= 52 and y == 8 and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- term.setCursorPos (40,8)
- print " "
- term.setCursorPos (40,8)
- filename1 = io.read ()
- downinstal ()
- elseif x >= 1 and x <= 11 and y == 18 and button == 1 then
- filename1 = nil
- download ()
- elseif x >= 42 and x <= 51 and y == 18 and button == 1 then
- if fs.exists("/C/system/RAM/editmenu") then
- fs.delete ("/C/system/RAM/editmenu")
- end
- shell.run ("pastebin get",pastebincode,ulozit)
- local data = fs.open ("/C/system/RAM/editmenu", "w")
- data.writeLine (filename)
- data.writeLine (ulozit)
- data.writeLine (pastebincode)
- data.writeLine (filename1)
- data.writeLine (pozice)
- data.close ()
- if pozice == "1" then
- menu1 = filename1
- path1 = ulozit
- elseif pozice == "2" then
- menu2 = filename1
- path2 = ulozit
- elseif pozice == "3" then
- menu3 = filename1
- path3 = ulozit
- elseif pozice == "4" then
- menu4 = filename1
- path4 = ulozit
- elseif pozice == "5" then
- menu5 = filename1
- path5 = ulozit
- elseif pozice == "6" then
- menu6 = filename1
- path6 = ulozit
- elseif pozice == "7" then
- menu7 = filename1
- path7 = ulozit
- end
- local data = fs.open ("/C/system/Users/"..user.."/lsprogram", "w")
- data.writeLine(menu1)
- data.writeLine(path1)
- data.writeLine(menu2)
- data.writeLine(path2)
- data.writeLine(menu3)
- data.writeLine(path3)
- data.writeLine(menu4)
- data.writeLine(path4)
- data.writeLine(menu5)
- data.writeLine(path5)
- data.writeLine(menu6)
- data.writeLine(path6)
- data.writeLine(menu7)
- data.writeLine(path7)
- data.close ()
- menud ()
- 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 ()
- elseif x == 49 and y == 1 then
- minimalizace ()
- else
- downinstal ()
- end
- end
- end
- end
- end
- function upload ()
- funkce = "upload"
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.clear ()
- paintutils.drawLine(1, 4, 51, 4, nastaveni.barva)
- term.setBackgroundColor(colors.white)
- prc (" Program manager for Pepdroll OS ", 4)
- term.setCursorPos (5,8)
- print "Paste path file for upload:"
- term.setBackgroundColor(colors.lightGray)
- term.setCursorPos (5,10)
- print " "
- term.setTextColor(colors.white)
- term.setCursorPos (6,10)
- print (kod1)
- term.setBackgroundColor(colors.gray)
- term.setCursorPos (42,18)
- print " Upload "
- 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
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- term.setCursorPos (5,10)
- print " "
- term.setCursorPos (6,10)
- kod1 = io.read ()
- upload ()
- elseif x >= 42 and x <= 51 and y == 18 and button == 1 then
- if akce == nil then
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.red)
- term.setCursorPos(5,18)
- if kod1 == "" then
- prc ("Paste a valid path!")
- elseif kod1 == " " then
- prc ("Paste a valid path!")
- elseif not fs.exists ("/"..kod1) then
- prc ("File is not exists!")
- else
- term.setTextColor(colors.black)
- term.setCursorPos(5,12)
- shell.run ("pastebin put "..kod1)
- paintutils.drawLine(1, 17, 51, 17, colors.white)
- paintutils.drawLine(1, 18, 41, 18, colors.white)
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.gray)
- term.setCursorPos (42,18)
- print " Menu "
- akce = menu
- end
- else
- akce = nil
- menud ()
- end
- 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 ()
- elseif x == 49 and y == 1 then
- minimalizace ()
- else
- upload ()
- end
- end
- end
- end
- end
- function download ()
- funkce = "download"
- if stahovani == nil then
- defcesta = "/C/Programs"
- filename = "FileName"
- stahovani = 1
- end
- if pastebincode == nil then
- pastebincode = "Pastebin"
- end
- ulozit = (defcesta.."/"..filename)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.clear ()
- paintutils.drawLine(1, 4, 51, 4, nastaveni.barva)
- term.setBackgroundColor(colors.white)
- prc (" Program manager for Pepdroll OS ", 4)
- term.setCursorPos (5,8)
- print "Code from pastebin:"
- term.setCursorPos (5,11)
- print "File name:"
- term.setCursorPos (5,15)
- print "Paste a path for download:"
- term.setBackgroundColor(colors.lightGray)
- term.setCursorPos (25,8)
- print " "
- term.setCursorPos (5,16)
- print " "
- term.setCursorPos (25,11)
- print " "
- term.setTextColor(colors.black)
- term.setCursorPos (26,8)
- print (pastebincode)
- term.setCursorPos (6,16)
- print (ulozit)
- term.setCursorPos (26,11)
- print (filename)
- term.setBackgroundColor(colors.gray)
- term.setCursorPos (42,18)
- if instalace == nil then
- print " Download "
- else
- print " Next "
- end
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 25 and x <= 34 and y == 8 and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- term.setCursorPos (25,8)
- print " "
- term.setCursorPos (26,8)
- pastebincode = read ()
- download ()
- elseif x >= 5 and x <= 31 and y == 16 and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- term.setCursorPos (5,16)
- print " "
- term.setCursorPos (6,16)
- defcesta = read ()
- download ()
- elseif x >= 25 and x <= 34 and y == 11 and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- term.setCursorPos (25,11)
- print " "
- term.setCursorPos (26,11)
- filename = read ()
- download ()
- elseif x >= 42 and x <= 51 and y == 18 and button == 1 then
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.red)
- term.setCursorPos(5,18)
- if pastebincode == "Pastebin" then
- prc ("Paste a Pastebin code!")
- elseif pastebincode == "" then
- prc ("Paste a Pastebin code!")
- elseif pastebincode == " " then
- prc ("Paste a Pastebin code!")
- elseif fs.exists (ulozit) then
- prc ("File is exists, rename it!")
- else
- if instalace == nil then
- term.setTextColor(colors.green)
- term.setCursorPos(4,17)
- shell.run ("pastebin get",pastebincode,ulozit)
- paintutils.drawLine(1, 17, 51, 17, colors.white)
- paintutils.drawLine(1, 18, 41, 18, colors.white)
- term.setCursorPos(5,18)
- prc "Succesful!"
- sleep (0.5)
- zpet = download
- spustit ()
- else
- downinstal ()
- end
- end
- 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 ()
- elseif x == 49 and y == 1 then
- minimalizace ()
- else
- download ()
- end
- end
- end
- end
- end
- local function zapsat()
- end
- function hledat()
- if fs.exists (cestaProgramu) then
- return
- else
- cestaProgramu1 = cestaProgramu
- cestaProgramu = ("/C/Programs/"..cestaProgramu)
- if fs.exists (cestaProgramu) then
- return
- else
- cestaProgramu = ("/C/Programs/pepeksoft/"..cestaProgramu1)
- end
- if fs.exists (cestaProgramu) then
- return
- else
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.red)
- term.setCursorPos(10,12)
- write("The program could not be found.")
- cestaProgramu = ""
- sleep(0.5)
- uspech = "f"
- end
- end
- end
- function editmenu()
- funkce = "editmenu"
- function apply ()
- data = fs.open ("/C/system/Users/"..user.."/lsprogram", "w")
- data.writeLine(nmenu1)
- data.writeLine(npath1)
- data.writeLine(nmenu2)
- data.writeLine(npath2)
- data.writeLine(nmenu3)
- data.writeLine(npath3)
- data.writeLine(nmenu4)
- data.writeLine(npath4)
- data.writeLine(nmenu5)
- data.writeLine(npath5)
- data.writeLine(nmenu6)
- data.writeLine(npath6)
- data.writeLine(nmenu7)
- data.writeLine(npath7)
- data.close ()
- if ok == "0" then
- term.setCursorPos (20, 13)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.lime)
- write "Successfull"
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.lightGray)
- term.setCursorPos (25,14)
- print"OK"
- else
- term.setCursorPos (16, 17)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.lime)
- prc ("Successfull", 19)
- ok = "0"
- end
- sleep (0.5)
- editmenu ()
- end
- local data = fs.open ("/C/system/Users/"..user.."/lsprogram", "r")
- menu1 = data.readLine ()
- path1 = data.readLine ()
- menu2 = data.readLine ()
- path2 = data.readLine ()
- menu3 = data.readLine ()
- path3 = data.readLine ()
- menu4 = data.readLine ()
- path4 = data.readLine ()
- menu5 = data.readLine ()
- path5 = data.readLine ()
- menu6 = data.readLine ()
- path6 = data.readLine ()
- menu7 = data.readLine ()
- path7 = data.readLine ()
- data.close()
- nmenu1 = menu1
- npath1 = path1
- nmenu2 = menu2
- npath2 = path2
- nmenu3 = menu3
- npath3 = path3
- nmenu4 = menu4
- npath4 = path4
- nmenu5 = menu5
- npath5 = path5
- nmenu6 = menu6
- npath6 = path6
- nmenu7 = menu7
- npath7 = path7
- term.setBackgroundColor(colors.white)
- term.clear()
- local myWindow = window.create(term.current(),9,4,37,19)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.white)
- myWindow.setCursorPos (4,3)
- print "1.position"
- myWindow.setCursorPos (4,5)
- print "2.position"
- myWindow.setCursorPos (4,7)
- print "3.position"
- myWindow.setCursorPos (4,9)
- print "4.position"
- myWindow.setCursorPos (4,11)
- print "5.position"
- myWindow.setCursorPos (4,13)
- print "6.position"
- myWindow.setCursorPos (4,15)
- print "7.position"
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos (16,3)
- print" "
- myWindow.setCursorPos (16,5)
- print" "
- myWindow.setCursorPos (16,7)
- print" "
- myWindow.setCursorPos (16,9)
- print" "
- myWindow.setCursorPos (16,11)
- print" "
- myWindow.setCursorPos (16,13)
- print" "
- myWindow.setCursorPos (16,15)
- print" "
- myWindow.setCursorPos (17,3)
- print(nmenu1)
- myWindow.setCursorPos (17,5)
- print(nmenu2)
- myWindow.setCursorPos (17,7)
- print(nmenu3)
- myWindow.setCursorPos (17,9)
- print(nmenu4)
- myWindow.setCursorPos (17,11)
- print(nmenu5)
- myWindow.setCursorPos (17,13)
- print(nmenu6)
- myWindow.setCursorPos (17,15)
- print(nmenu7)
- term.setBackgroundColor(colors.red)
- term.setTextColor(colors.white)
- myWindow.setCursorPos (30,3)
- print "*"
- myWindow.setCursorPos (30,5)
- print "*"
- myWindow.setCursorPos (30,7)
- print "*"
- myWindow.setCursorPos (30,9)
- print "*"
- myWindow.setCursorPos (30,11)
- print "*"
- myWindow.setCursorPos (30,13)
- print "*"
- myWindow.setCursorPos (30,15)
- print "*"
- paintutils.drawLine(1, 4, 51, 4, nastaveni.barva)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- prc (" Program manager for Pepdroll OS ", 4)
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == 38 and y == 6 and button == 1 then
- nmenu1 = ""
- npath1 = ""
- ok = "1"
- apply ()
- elseif x == 38 and y == 8 and button == 1 then
- nmenu2 = ""
- npath2 = ""
- ok = "1"
- apply ()
- elseif x == 38 and y == 10 and button == 1 then
- nmenu3 = ""
- npath3 = ""
- ok = "1"
- apply ()
- elseif x == 38 and y == 12 and button == 1 then
- nmenu4 = ""
- npath4 = ""
- ok = "1"
- apply ()
- elseif x == 38 and y == 14 and button == 1 then
- nmenu5 = ""
- npath5 = ""
- ok = "1"
- apply ()
- elseif x == 38 and y == 16 and button == 1 then
- nmenu6 = ""
- npath6 = ""
- ok = "1"
- apply ()
- elseif x == 38 and y == 18 and button == 1 then
- nmenu7 = ""
- npath7 = ""
- ok = "1"
- apply ()
- -------------------------------------------------------------------------------------------
- elseif x >= 24 and x <= 37 and y == 6 and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- term.setCursorPos (24,6)
- print" "
- term.setCursorPos (25,6)
- print(nmenu1)
- sleep(0.1)
- local myWindow = window.create(term.current(),10,7,33,10)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),9,6,33,10)
- myWindow.setBackgroundColor(nastaveni.barva)
- myWindow.clear()
- local myWindow = window.create(term.current(),10,7,31,8)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- paintutils.drawPixel (41,6, colors.red)
- term.setCursorPos(41,6)
- print "*"
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- myWindow.setCursorPos (11,1)
- print"1. Position"
- myWindow.setCursorPos (2,2)
- print"Name"
- myWindow.setCursorPos (2,5)
- print"Path:"
- myWindow.setCursorPos (16,8)
- print"OK"
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos (2,3)
- print" "
- myWindow.setCursorPos (2,3)
- print(menu1)
- myWindow.setCursorPos (2,6)
- print" "
- myWindow.setCursorPos (2,6)
- print(path1)
- term.setBackgroundColor(colors.gray)
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 11 and x <= 24 and y == 9 and button == 1 then
- term.setBackgroundColor(colors.gray)
- myWindow.setCursorPos (2,3)
- print" "
- myWindow.setCursorPos (2,3)
- nmenu1 = read()
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos (2,3)
- print" "
- myWindow.setCursorPos (2,3)
- write(nmenu1)
- elseif x >= 11 and x <= 39 and y == 12 and button == 1 then
- term.setBackgroundColor(colors.gray)
- myWindow.setCursorPos (2,6)
- print" "
- myWindow.setCursorPos (2,6)
- cestaProgramu = read ()
- hledat()
- if uspech == "f" then
- uspech = "t"
- term.setBackgroundColor(colors.white)
- myWindow.setCursorPos (1,6)
- print" "
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors.black)
- myWindow.setCursorPos (2,6)
- print" "
- myWindow.setCursorPos (2,6)
- print(path1)
- npath1 = path1
- else
- myWindow.setCursorPos (2,6)
- npath1 = cestaProgramu
- write(cestaProgramu)
- end
- elseif x == 41 and y == 6 and button == 1 then
- editmenu ()
- elseif x >= 25 and x <= 26 and y == 14 and button == 1 then
- apply ()
- end
- end
- elseif x >= 24 and x <= 37 and y == 8 and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- term.setCursorPos (24,8)
- print" "
- term.setCursorPos (25,8)
- print(nmenu2)
- sleep(0.1)
- local myWindow = window.create(term.current(),10,7,33,10)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),9,6,33,10)
- myWindow.setBackgroundColor(nastaveni.barva)
- myWindow.clear()
- local myWindow = window.create(term.current(),10,7,31,8)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- paintutils.drawPixel (41,6, colors.red)
- term.setCursorPos(41,6)
- print "*"
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- myWindow.setCursorPos (11,1)
- print"2. Position"
- myWindow.setCursorPos (2,2)
- print"Name"
- myWindow.setCursorPos (2,5)
- print"Path:"
- myWindow.setCursorPos (16,8)
- print"OK"
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos (2,3)
- print" "
- myWindow.setCursorPos (2,3)
- print(menu2)
- myWindow.setCursorPos (2,6)
- print" "
- myWindow.setCursorPos (2,6)
- print(path2)
- term.setBackgroundColor(colors.gray)
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 11 and x <= 24 and y == 9 and button == 1 then
- term.setBackgroundColor(colors.gray)
- myWindow.setCursorPos (2,3)
- print" "
- myWindow.setCursorPos (2,3)
- nmenu2 = read()
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos (2,3)
- print" "
- myWindow.setCursorPos (2,3)
- write(nmenu2)
- elseif x >= 11 and x <= 39 and y == 12 and button == 1 then
- term.setBackgroundColor(colors.gray)
- myWindow.setCursorPos (2,6)
- print" "
- myWindow.setCursorPos (2,6)
- cestaProgramu = read ()
- hledat()
- if uspech == "f" then
- uspech = "t"
- term.setBackgroundColor(colors.white)
- myWindow.setCursorPos (1,6)
- print" "
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors.black)
- myWindow.setCursorPos (2,6)
- print" "
- myWindow.setCursorPos (2,6)
- print(path2)
- npath2 = path2
- else
- myWindow.setCursorPos (2,6)
- npath2 = cestaProgramu
- write(cestaProgramu)
- end
- elseif x == 41 and y == 6 and button == 1 then
- editmenu ()
- elseif x >= 25 and x <= 26 and y == 14 and button == 1 then
- apply ()
- end
- end
- elseif x >= 24 and x <= 37 and y == 10 and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- term.setCursorPos (24,10)
- print" "
- term.setCursorPos (25,10)
- print(nmenu3)
- sleep(0.1)
- local myWindow = window.create(term.current(),10,7,33,10)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),9,6,33,10)
- myWindow.setBackgroundColor(nastaveni.barva)
- myWindow.clear()
- local myWindow = window.create(term.current(),10,7,31,8)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- paintutils.drawPixel (41,6, colors.red)
- term.setCursorPos(41,6)
- print "*"
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- myWindow.setCursorPos (11,1)
- print"3. Position"
- myWindow.setCursorPos (2,2)
- print"Name"
- myWindow.setCursorPos (2,5)
- print"Path:"
- myWindow.setCursorPos (16,8)
- print"OK"
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos (2,3)
- print" "
- myWindow.setCursorPos (2,3)
- print(menu3)
- myWindow.setCursorPos (2,6)
- print" "
- myWindow.setCursorPos (2,6)
- print(path3)
- term.setBackgroundColor(colors.gray)
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 11 and x <= 24 and y == 9 and button == 1 then
- term.setBackgroundColor(colors.gray)
- myWindow.setCursorPos (2,3)
- print" "
- myWindow.setCursorPos (2,3)
- nmenu3 = read()
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos (2,3)
- print" "
- myWindow.setCursorPos (2,3)
- write(nmenu3)
- elseif x >= 11 and x <= 39 and y == 12 and button == 1 then
- term.setBackgroundColor(colors.gray)
- myWindow.setCursorPos (2,6)
- print" "
- myWindow.setCursorPos (2,6)
- cestaProgramu = read ()
- hledat()
- if uspech == "f" then
- uspech = "t"
- term.setBackgroundColor(colors.white)
- myWindow.setCursorPos (1,6)
- print" "
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors.black)
- myWindow.setCursorPos (2,6)
- print" "
- myWindow.setCursorPos (2,6)
- print(path3)
- npath3 = path3
- else
- myWindow.setCursorPos (2,6)
- npath3 = cestaProgramu
- write(cestaProgramu)
- end
- elseif x == 41 and y == 6 and button == 1 then
- editmenu ()
- elseif x >= 25 and x <= 26 and y == 14 and button == 1 then
- apply ()
- end
- end
- elseif x >= 24 and x <= 37 and y == 12 and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- term.setCursorPos (24,12)
- print" "
- term.setCursorPos (25,12)
- print(nmenu4)
- sleep(0.1)
- local myWindow = window.create(term.current(),10,7,33,10)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),9,6,33,10)
- myWindow.setBackgroundColor(nastaveni.barva)
- myWindow.clear()
- local myWindow = window.create(term.current(),10,7,31,8)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- paintutils.drawPixel (41,6, colors.red)
- term.setCursorPos(41,6)
- print "*"
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- myWindow.setCursorPos (11,1)
- print"4. Position"
- myWindow.setCursorPos (2,2)
- print"Name"
- myWindow.setCursorPos (2,5)
- print"Path:"
- myWindow.setCursorPos (16,8)
- print"OK"
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos (2,3)
- print" "
- myWindow.setCursorPos (2,3)
- print(menu4)
- myWindow.setCursorPos (2,6)
- print" "
- myWindow.setCursorPos (2,6)
- print(path4)
- term.setBackgroundColor(colors.gray)
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 11 and x <= 24 and y == 9 and button == 1 then
- term.setBackgroundColor(colors.gray)
- myWindow.setCursorPos (2,3)
- print" "
- myWindow.setCursorPos (2,3)
- nmenu4 = read()
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos (2,3)
- print" "
- myWindow.setCursorPos (2,3)
- write(nmenu4)
- elseif x >= 11 and x <= 39 and y == 12 and button == 1 then
- term.setBackgroundColor(colors.gray)
- myWindow.setCursorPos (2,6)
- print" "
- myWindow.setCursorPos (2,6)
- cestaProgramu = read ()
- hledat()
- if uspech == "f" then
- uspech = "t"
- term.setBackgroundColor(colors.white)
- myWindow.setCursorPos (1,6)
- print" "
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors.black)
- myWindow.setCursorPos (2,6)
- print" "
- myWindow.setCursorPos (2,6)
- print(path4)
- npath4 = path4
- else
- myWindow.setCursorPos (2,6)
- npath4 = cestaProgramu
- write(cestaProgramu)
- end
- elseif x == 41 and y == 6 and button == 1 then
- editmenu ()
- elseif x >= 25 and x <= 26 and y == 14 and button == 1 then
- apply ()
- end
- end
- elseif x >= 24 and x <= 37 and y == 14 and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- term.setCursorPos (24,14)
- print" "
- term.setCursorPos (25,14)
- print(nmenu5)
- sleep(0.1)
- local myWindow = window.create(term.current(),10,7,33,10)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),9,6,33,10)
- myWindow.setBackgroundColor(nastaveni.barva)
- myWindow.clear()
- local myWindow = window.create(term.current(),10,7,31,8)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- paintutils.drawPixel (41,6, colors.red)
- term.setCursorPos(41,6)
- print "*"
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- myWindow.setCursorPos (11,1)
- print"5. Position"
- myWindow.setCursorPos (2,2)
- print"Name"
- myWindow.setCursorPos (2,5)
- print"Path:"
- myWindow.setCursorPos (16,8)
- print"OK"
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos (2,3)
- print" "
- myWindow.setCursorPos (2,3)
- print(menu5)
- myWindow.setCursorPos (2,6)
- print" "
- myWindow.setCursorPos (2,6)
- print(path5)
- term.setBackgroundColor(colors.gray)
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 11 and x <= 24 and y == 9 and button == 1 then
- term.setBackgroundColor(colors.gray)
- myWindow.setCursorPos (2,3)
- print" "
- myWindow.setCursorPos (2,3)
- nmenu5 = read()
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos (2,3)
- print" "
- myWindow.setCursorPos (2,3)
- write(nmenu5)
- elseif x >= 11 and x <= 39 and y == 12 and button == 1 then
- term.setBackgroundColor(colors.gray)
- myWindow.setCursorPos (2,6)
- print" "
- myWindow.setCursorPos (2,6)
- cestaProgramu = read ()
- hledat()
- if uspech == "f" then
- uspech = "t"
- term.setBackgroundColor(colors.white)
- myWindow.setCursorPos (1,6)
- print" "
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors.black)
- myWindow.setCursorPos (2,6)
- print" "
- myWindow.setCursorPos (2,6)
- print(path5)
- npath5 = path5
- else
- myWindow.setCursorPos (2,6)
- npath5 = cestaProgramu
- write(cestaProgramu)
- end
- elseif x == 41 and y == 6 and button == 1 then
- editmenu ()
- elseif x >= 25 and x <= 26 and y == 14 and button == 1 then
- apply ()
- end
- end
- elseif x >= 24 and x <= 37 and y == 16 and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- term.setCursorPos (24,16)
- print" "
- term.setCursorPos (25,16)
- print(nmenu6)
- sleep(0.1)
- local myWindow = window.create(term.current(),10,7,33,10)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),9,6,33,10)
- myWindow.setBackgroundColor(nastaveni.barva)
- myWindow.clear()
- local myWindow = window.create(term.current(),10,7,31,8)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- paintutils.drawPixel (41,6, colors.red)
- term.setCursorPos(41,6)
- print "*"
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- myWindow.setCursorPos (11,1)
- print"6. Position"
- myWindow.setCursorPos (2,2)
- print"Name"
- myWindow.setCursorPos (2,5)
- print"Path:"
- myWindow.setCursorPos (16,8)
- print"OK"
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos (2,3)
- print" "
- myWindow.setCursorPos (2,3)
- print(menu6)
- myWindow.setCursorPos (2,6)
- print" "
- myWindow.setCursorPos (2,6)
- print(path6)
- term.setBackgroundColor(colors.gray)
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 11 and x <= 24 and y == 9 and button == 1 then
- term.setBackgroundColor(colors.gray)
- myWindow.setCursorPos (2,3)
- print" "
- myWindow.setCursorPos (2,3)
- nmenu6 = read()
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos (2,3)
- print" "
- myWindow.setCursorPos (2,3)
- write(nmenu6)
- elseif x >= 11 and x <= 39 and y == 12 and button == 1 then
- term.setBackgroundColor(colors.gray)
- myWindow.setCursorPos (2,6)
- print" "
- myWindow.setCursorPos (2,6)
- cestaProgramu = read ()
- hledat()
- if uspech == "f" then
- uspech = "t"
- term.setBackgroundColor(colors.white)
- myWindow.setCursorPos (1,6)
- print" "
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors.black)
- myWindow.setCursorPos (2,6)
- print" "
- myWindow.setCursorPos (2,6)
- print(path6)
- npath6 = path6
- else
- myWindow.setCursorPos (2,6)
- npath6 = cestaProgramu
- write(cestaProgramu)
- end
- elseif x == 41 and y == 6 and button == 1 then
- editmenu ()
- elseif x >= 25 and x <= 26 and y == 14 and button == 1 then
- apply ()
- end
- end
- elseif x >= 24 and x <= 37 and y == 18 and button == 1 then
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- term.setCursorPos (24,18)
- print" "
- term.setCursorPos (25,18)
- print(nmenu7)
- sleep(0.1)
- local myWindow = window.create(term.current(),10,7,33,10)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- local myWindow = window.create(term.current(),9,6,33,10)
- myWindow.setBackgroundColor(nastaveni.barva)
- myWindow.clear()
- local myWindow = window.create(term.current(),10,7,31,8)
- myWindow.setBackgroundColor(colors.white)
- myWindow.clear()
- paintutils.drawPixel (41,6, colors.red)
- term.setCursorPos(41,6)
- print "*"
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- myWindow.setCursorPos (11,1)
- print"6. Position"
- myWindow.setCursorPos (2,2)
- print"Name"
- myWindow.setCursorPos (2,5)
- print"Path:"
- myWindow.setCursorPos (16,8)
- print"OK"
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos (2,3)
- print" "
- myWindow.setCursorPos (2,3)
- print(menu7)
- myWindow.setCursorPos (2,6)
- print" "
- myWindow.setCursorPos (2,6)
- print(path7)
- term.setBackgroundColor(colors.gray)
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 11 and x <= 24 and y == 9 and button == 1 then
- term.setBackgroundColor(colors.gray)
- myWindow.setCursorPos (2,3)
- print" "
- myWindow.setCursorPos (2,3)
- nmenu7 = read()
- term.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos (2,3)
- print" "
- myWindow.setCursorPos (2,3)
- write(nmenu7)
- elseif x >= 11 and x <= 39 and y == 12 and button == 1 then
- term.setBackgroundColor(colors.gray)
- myWindow.setCursorPos (2,6)
- print" "
- myWindow.setCursorPos (2,6)
- cestaProgramu = read ()
- hledat()
- if uspech == "f" then
- uspech = "t"
- term.setBackgroundColor(colors.white)
- myWindow.setCursorPos (1,6)
- print" "
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors.black)
- myWindow.setCursorPos (2,6)
- print" "
- myWindow.setCursorPos (2,6)
- print(path7)
- npath7 = path7
- else
- myWindow.setCursorPos (2,6)
- npath7 = cestaProgramu
- write(cestaProgramu)
- end
- elseif x == 41 and y == 6 and button == 1 then
- editmenu ()
- elseif x >= 25 and x <= 26 and y == 14 and button == 1 then
- apply ()
- end
- end
- ----------------------------------------------------------------------------------
- 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 ()
- elseif x == 49 and y == 1 then
- minimalizace ()
- else
- editmenu ()
- end
- end
- end
- end
- end
- function menud()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.clear ()
- paintutils.drawLine(1, 4, 51, 4, nastaveni.barva)
- term.setBackgroundColor(colors.white)
- prc (" Program manager for Pepdroll OS ", 4)
- term.setBackgroundColor(colors.lightGray)
- term.setCursorPos(5,7)
- print "-> Download and install "
- term.setCursorPos(5,9)
- print "-> Download "
- term.setCursorPos(5,11)
- print "-> Upload "
- term.setCursorPos(5,13)
- print "-> Edit menu "
- term.setCursorPos(5,15)
- print "-> Update "
- term.setCursorPos(5,17)
- print "-> Uinstall "
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.blue)
- term.setCursorPos(20,19)
- write" Pepek"
- term.setCursorPos(28,19)
- write"Soft "
- term.setCursorPos(27,19)
- term.setTextColor(colors.lime)
- write"@"
- 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
- download ()
- elseif x >= 5 and x <= 30 and y == 9 and button == 1 then
- instalace = nil
- download ()
- elseif x >= 5 and x <= 30 and y == 11 and button == 1 then
- upload ()
- elseif x >= 5 and x <= 30 and y == 13 and button == 1 then
- editmenu()
- elseif x >= 5 and x <= 30 and y == 15 and button == 1 then
- update ()
- elseif x >= 5 and x <= 30 and y == 17 and button == 1 then
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.clear ()
- paintutils.drawLine(1, 9, 51, 9, nastaveni.barva)
- term.setBackgroundColor(colors.white)
- prc (" In progresing ", 9)
- 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
- menud ()
- end
- end
- break
- end
- end
- end
- start ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement