Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- verze = "23.0401.R1"
- local w, h = term.getSize()
- local register = 0
- local login = 0
- local deleteusers = 0
- local cestaProgramu = ""
- local f=fs.open("/C/system/RAM/user","r")
- user=f.readLine()
- f.close()
- if fs.exists("/C/system/RAM/devices/speaker.tmp") then
- sound = true
- end
- 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
- function song(type)
- if sound then shell.run("/C/system/api/sound.api "..type) end
- end
- if fs.exists("/C/system/.core/defmodem") then
- local data = fs.open ("/C/system/.core/defmodem","r")
- modemPos = data.readLine()
- data.close()
- idPC = os.getComputerID()
- modem = peripheral.wrap(modemPos)
- modem.open(idPC)
- if not modemPos then
- fs.delete("/C/system/.core/defmodem")
- modemPos = "offline"
- end
- else
- modemPos = "offline"
- end
- if fs.exists ("/C/system/.core/AD") then
- ADC = true
- local f=fs.open("/C/system/.core/AD","r")
- ADServer=f.readLine()
- f.close()
- end
- 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 dialog(nadpis,dtext1,dtext2,autoclose)
- if nadpis == nil then nadpis = "" end
- if dtext1 == nil then dtext1 = "" end
- if dtext2 == nil then dtext2 = "" end
- if autoclose == nil then autoclose = "close" end
- myWindow = window.create(term.current(),w/2-8,h/2-2,20,7)
- myWindow.setBackgroundColor(colors.white)
- myWindow.setTextColor(BarTxt)
- myWindow.clear()
- myWindow.setBackgroundColor(colors.red)
- myWindow.setCursorPos (20, 1)
- myWindow.write"×"
- myWindow.setCursorPos (1, 1)
- myWindow.setBackgroundColor(BarPoz)
- myWindow.setTextColor(BarTxt)
- myWindow.write(" ")
- myWindow.setCursorPos (2, 1)
- myWindow.write(nadpis)
- myWindow.setBackgroundColor(colors.white)
- myWindow.setTextColor(colors.black)
- myWindow.setCursorPos (2, 3)
- myWindow.write(dtext1)
- myWindow.setCursorPos (2, 4)
- myWindow.write(dtext2)
- myWindow.setTextColor(colors.black)
- myWindow.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos (9, 6)
- myWindow.write" OK "
- if autoclose == "close" then sleep (1) error() end
- if autoclose == "return" then return end
- function ok()
- myWindow.setBackgroundColor(colors.gray)
- myWindow.setCursorPos (9, 6)
- myWindow.write" OK "
- sleep(0.1)
- error()
- end
- while true do
- local event, button, x, y = os.pullEvent()
- if event == "mouse_click" and x == math.floor(w/2+11) and y == math.floor(h/2-2) and button == 1 then
- error()
- elseif event == "mouse_click" and x >= math.floor(w/2) and x <= math.floor(w/2+3) and y == math.floor(h/2+3) and button == 1 then
- ok()
- elseif event == "key" and (button == keys.enter or button == keys.numEnter) then
- ok()
- end
- end
- end
- function prikazy()
- local prikazdoc = fs.open ("/C/system/RAM/command", "r")
- prikaz = prikazdoc.readLine()
- verze = prikazdoc.readLine()
- prikazdoc.close ()
- if prikaz == "cmd" or prikaz == "shell" or prikaz == "terminal" or prikaz == "commander" then
- term.setCursorPos(1,1)
- if not fs.exists("/C/system/api/commander.lua") then
- downloading("LY8cUArW", "/C/system/api/commander.lua")
- end
- shell.run ("cd /C")
- shell.run ("/C/system/api/commander.lua")
- elseif prikaz == "id" or prikaz == "ID" then
- if os.getComputerLabel() == nil or os.getComputerLabel() == "" then
- dtext = ""
- else
- dtext = ("Label: "..(os.getComputerLabel()))
- end
- dialog(" Identify ","ID: "..os.getComputerID(),dtext,"")
- elseif prikaz == "opt" then
- shell.run("/C/system/api/setting.lua")
- elseif prikaz == "reload os" then
- shell.run ("/C/system/.core/desktop.lua")
- elseif prikaz == "oldwin" then
- local data = fs.open("/C/system/Users/"..user.."/colors", "w") data.writeLine("256") data.writeLine("32768") data.close ()
- downloading("41j27xwq", "/C/system/Users/"..user.."/bar.nfp")
- shell.run ("/C/system/.core/desktop.lua")
- elseif prikaz == "defcol" then
- local data = fs.open("/C/system/Users/"..user.."/colors", "w")
- data.writeLine("2048")
- data.writeLine("1")
- data.close ()
- downloading("ZQ8BBcVQ", "/C/system/Users/"..user.."/bar.nfp")
- shell.run ("/C/system/.core/desktop.lua")
- elseif prikaz == "cls list" then
- if fs.exists ("/C/system/Users/"..user.."/.Registry/lsprogram") then
- fs.delete ("/C/system/Users/"..user.."/.Registry/lsprogram")
- end
- elseif prikaz == "cls ram" then
- if fs.exists ("/C/system/RAM/bluescreen.lua") then
- fs.move ("/C/system/RAM/bluescreen.lua", "/C/system/RAM_temp/bluescreen.lua")
- end
- if fs.exists ("/C/system/RAM/user") then
- fs.move ("/C/system/RAM/user", "/C/system/RAM_temp/user")
- end
- fs.delete ("/C/system/RAM")
- if fs.exists ("/C/system/RAM_temp/bluescreen.lua") then
- fs.move ("/C/system/RAM_temp/bluescreen.lua", "/C/system/RAM/bluescreen.lua")
- end
- if fs.exists ("/C/system/RAM_temp/user") then
- fs.move ("/C/system/RAM_temp/user", "/C/system/RAM/user")
- end
- fs.delete ("/C/system/RAM_temp")
- elseif prikaz == "anim off" then
- data = fs.open("/C/system/Users/"..user.."/.Registry/.disableAnim", "w") data.close()
- shell.run("/C/system/.core/desktop.lua")
- elseif prikaz == "anim on" then
- if fs.exists ("/C/system/Users/"..user.."/.Registry/.disableAnim") then
- fs.delete ("/C/system/Users/"..user.."/.Registry/.disableAnim")
- end
- shell.run("/C/system/.core/desktop.lua")
- elseif prikaz == "pmanager" then
- if not fs.exists("/Programs/PepekSoft/pmanager") then
- downloading("5eSpGpGa", "/Programs/PepekSoft/pmanager")
- end
- shell.run("/Programs/PepekSoft/pmanager")
- elseif prikaz == "" then
- menu()
- elseif prikaz == "vyvoj" then
- if not fs.exists("/C/system/Users/"..user.."/vyvoj") then
- local data = fs.open("/C/system/Users/"..user.."/vyvoj", "w")
- data.close()
- else
- fs.delete ("/C/system/Users/"..user.."/vyvoj")
- end
- shell.run("/C/system/.core/desktop.lua")
- elseif prikaz == "label" then
- local data = fs.open ("/C/system/RAM/setting/"..user.."/setdata", "w")
- data.writeLine ("label")
- data.close ()
- shell.run("/C/system/api/setting.lua")
- elseif prikaz == "update" then
- shell.run("/C/system/api/update.lua noface")
- elseif prikaz == "update -all" then
- shell.run("pastebin run kVTbg59d")
- elseif prikaz == "update run" then
- downloading("r18V4xrG", "/C/system/api/commands.lua")
- menu()
- elseif prikaz == "update start" then
- downloading("0xh6jEx1", "/startup.lua")
- menu()
- elseif prikaz == "update local" then
- if fs.exists("/C/system/server/rules/Update/") then
- if fs.exists("/C/system/server/rules/Update/desktop.lua") then
- fs.delete ("/C/system/.core/desktop.lua")
- shell.run("copy /C/system/server/rules/Update/desktop.lua /C/system/.core/desktop.lua")
- end
- if fs.exists("/C/system/server/rules/Update/startup.lua") then
- fs.delete ("/startup.lua")
- shell.run("copy /C/system/server/rules/Update/startup.lua /startup.lua")
- end
- end
- menu()
- elseif prikaz == "sync" then
- if not (modemPos == "offline") then
- modem.transmit(tonumber(ADServer),555, user)
- if fs.exists("/C/system/Users/"..user.."/bar.nfp") then
- local f=fs.open("/C/system/Users/"..user.."/bar.nfp","r")
- sync_object=f.readAll()
- f.close()
- modem.transmit(tonumber(ADServer),560, sync_object)
- end
- if fs.exists("/C/system/Users/"..user.."/colors") then
- local f=fs.open("/C/system/Users/"..user.."/colors","r")
- sync_object=f.readAll()
- f.close()
- modem.transmit(tonumber(ADServer),561, sync_object)
- end
- else
- song("error")
- dialog(" Error ","Computer is Offline","","")
- end
- elseif prikaz == "monitor" then
- local names = {}
- local function filter(name)
- table.insert(names, name)
- local f=fs.open("/C/system/.core/display","w") f.writeLine(name) f.close()
- local data = fs.open ("/C/system/RAM/displayreboot", "w") data.close ()
- term.setBackgroundColor(colors.black)
- term.clear()
- os.reboot()
- end
- peripheral.find("monitor", filter)
- elseif prikaz == "help" then
- term.setBackgroundColor(colors.lightGray)
- term.clear()
- sleep (0.1)
- term.setBackgroundColor(colors.gray)
- term.clear()
- sleep (0.1)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.clear()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.clear()
- term.setCursorPos(0, h-12)
- prc "Downloading current catalog"
- term.setCursorPos(0, h-10)
- prc "Please wait"
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.blue)
- term.setCursorPos(w/2-5,h-1)
- print" Pepek"
- term.setCursorPos(w/2+3,h-1)
- print"Soft "
- term.setCursorPos(w/2+2,h-1)
- term.setTextColor(colors.lime)
- print"@"
- if not fs.exists("/C/system/RAM/help") then
- downloading("WBE35q0m", "/C/system/RAM/help")
- end
- shell.run("/C/system/RAM/help")
- elseif prikaz == "ADPD" then
- shell.run("pastebin run iAAc0GNS")
- else
- if shell.resolveProgram(prikaz) == nil then
- song("error")
- dialog(" Error ","No such program","sought: "..prikaz,"")
- else
- shell.run(prikaz)
- end
- end
- end
- function downloading(kod, cesta)
- dialog(" Downloading ",cesta,"","return")
- if fs.exists(cesta) then fs.delete(cesta)end
- shell.run("/C/system/api/stahni.api get "..kod.." "..cesta)
- end
- prikazy ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement