Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- verze = "24.0914.R1"
- shell.exit()
- shell.run( "set shell.allow_disk_startup false" )
- shell.setPath(shell.path() .. ":/C/system/api/")
- shell.setPath(shell.path() .. ":/C/system/.core/desktop.lua")
- if fs.exists("/C/system/.core/logon") then --docasna oprava chyby prihlaseni
- fs.delete("/C/system/.core/logon")
- end
- local tArgs = { ... }
- local w,h = term.getSize()
- local ADC = false
- local localAD = false
- local displayload = false
- local idPC = os.getComputerID()
- local anim = 0.1
- local edice = "Standard"
- local sound = false
- local modem = nil
- local pass = ""
- logoPD = {
- " bbbbbbb 888888 ",
- " bb bb88 88",
- " bb bb88dddd88",
- " bb55555588 d88",
- " bb55bbb 88 d 88",
- " bb55555588 d 88",
- " bb 5588 d 88",
- " 55555555888888"}
- local function bgc(barvaP) term.setBackgroundColor(barvaP) end
- local function txc(barvaP) term.setTextColor(barvaP) end
- local function curs(xi,yi) term.setCursorPos(xi,yi) end
- 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()
- curs(math.ceil((w-#text)/2), y or cy)
- write(text)
- end
- local function logo()
- bgc(colors.white)
- txc(colors.blue)
- curs(w/2-5,h-1)
- write" Pepek"
- curs(w/2+3,h-1)
- write"Soft "
- curs(w/2+2,h-1)
- txc(colors.lime)
- write"@"
- end
- function downloading(kod, cestaP)
- bgc(colors.white)
- txc(colors.white)
- curs(1,1)
- shell.run("/C/system/api/stahni.api get "..kod.." "..cestaP)
- end
- function checkModem()
- if fs.exists("/C/system/.core/defmodem") then
- local data = fs.open ("/C/system/.core/defmodem","r")
- modemPos = data.readLine()
- data.close()
- if peripheral.isPresent(modemPos) and peripheral.getType(modemPos)=="modem" then
- modem = peripheral.wrap(modemPos)
- modem.open(idPC)
- else
- fs.delete("/C/system/.core/defmodem")
- modemPos = "offline"
- end
- else
- modemPos = "offline"
- end
- end
- function song(type)
- if sound and not fs.exists("/C/system/Users/"..user.."/.Registry/.disableSound") then shell.run("/C/system/api/sound.api "..type) end
- end
- function sit()
- 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
- end
- function vypnout()
- bgc(colors.lightGray)
- term.clear()
- sleep (0.1)
- bgc(colors.gray)
- term.clear()
- sleep (0.1)
- bgc(colors.white)
- txc(colors.black)
- term.clear()
- curs(w-28, h/2-2)
- prc "Shutting down..."
- logo()
- song("shutdown")
- sleep (1)
- fs.delete("/C/system/RAM/logout")
- if not ServerMode then
- fs.delete("/C/system/RAM")
- end
- local data = fs.open ("/C/system/RAM/vypnuto", "w")
- data.close ()
- bgc(colors.black)
- term.clear()
- os.shutdown ()
- end
- function restart ()
- bgc(colors.lightGray)
- term.clear()
- sleep (0.1)
- bgc(colors.gray)
- term.clear()
- sleep (0.1)
- bgc(colors.black)
- txc(colors.black)
- term.clear()
- bgc(colors.white)
- txc(colors.black)
- term.clear()
- curs(w-28, h/2-2)
- prc "Restarting..."
- logo()
- song("shutdown")
- sleep (1)
- fs.delete("/C/system/RAM/logout")
- local data = fs.open ("/C/system/RAM/vypnuto", "w")
- data.close ()
- bgc(colors.black)
- term.clear()
- os.reboot ()
- end
- function hotrezimy ()
- local myWindow = window.create(term.current(),1,16,12,19)
- myWindow.setBackgroundColor(colors.gray)
- myWindow.clear()
- txc(colors.white)
- bgc(colors.gray)
- curs(2,17)
- write "Restart"
- curs(2,18)
- write "Shut down"
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x == 1 and y == 18 and button == 1 then
- heslo ()
- elseif x >= 2 and x <= 11 and y == 17 and button == 1 then
- local data = fs.open ("/C/system/RAM/RES", "w")
- data.close()
- restart()
- elseif x >= 2 and x <= 11 and y == 18 and button == 1 then
- local data = fs.open ("/C/system/RAM/VYP", "w")
- data.close()
- vypnout()
- else
- heslo ()
- end
- end
- end
- local function service()
- Update()
- if fs.exists("/C/service/") then
- si = 0
- sluzba = {}
- local FileList = fs.list("/C/service/")
- for _, file in ipairs(FileList) do
- si = si + 1
- sluzba[si] = file
- end
- local sa = 1
- repeat
- shell.openTab("/C/service/"..sluzba[sa])
- sa = sa + 1
- until sa == si+1
- end
- end
- function kontrola ()
- if not term.isColor() then
- curs(5,9)
- write "Sorry, you must have a Advanced computer"
- sleep (5)
- os.shutdown ()
- end
- boot()
- end
- function checkonline()
- txc(colors.white)
- shell.run("pastebin run LiwNqcDW /C/system/RAM/online")
- if not fs.exists("/C/system/RAM/online") then shell.run("wget run https://devbin.dev/raw/r8ez7cvc") end
- end
- function uvod()
- bgc(colors.white)
- txc(colors.black)
- term.clear()
- logo()
- txc(colors.lightGray)
- curs(1, h-1)
- write (verze)
- bgc(colors.white)
- txc(colors.black)
- prc ("Pepdroll Seven "..edice,h-3)
- APIS.loadLogo(logoPD, w/2-8,h/2-7)
- end
- function boot ()
- if fs.exists ("/C/system/RAM/versions.tmp") then fs.delete("/C/system/RAM/versions.tmp") end
- local v = fs.open("/C/system/RAM/versions.tmp","w") v.writeLine(verze) v.close()
- if fs.exists("/C/system/RAM/online") then
- local data = fs.open("/C/system/RAM/online", "r")
- local Conser = data.readLine()
- if (Conser == "pastebin.com") then PastebinMode = true DevbinMode = false
- elseif (Conser == "devbin.dev") then DevbinMode = true PastebinMode = false
- else DevbinMode = false PastebinMode = false end
- data.close()
- else DevbinMode = false PastebinMode = false end
- if not fs.exists("/C/system/api/stahni.api") then
- shell.run("pastebin get GssKCexp /C/system/api/stahni.api")
- end
- if PastebinMode or DevbinMode then
- if fs.exists("/C/system/api/emuCheck.lua") then curs(1,-10) shell.run("/C/system/api/emuCheck.lua")
- else downloading("XRfNZpEy", "/C/system/api/emuCheck.lua") boot() end
- if fs.exists("/C/system/api/device.api") then shell.run("/C/system/api/device.api")
- else downloading("x", "/C/system/api/device.api") boot() end
- if not fs.exists("/C/system/api/dns_check.api") then
- downloading("XZYYRSPy", "/C/system/api/dns_check.api")
- local data = fs.open("/C/system/.core/.Registry/defdns.cfg", "w") data.writeLine("0") data.close()
- boot() end
- checkModem()
- if not fs.exists("/C/system/api/sound.api") and fs.exists("/C/system/RAM/devices/speaker.tmp") then
- downloading("Td7gSZZq", "/C/system/api/sound.api")
- boot()
- end
- if not fs.exists("/C/system/api/print.api") and fs.exists("/C/system/RAM/devices/printer.tmp") then
- downloading("VEfwuEHM", "/C/system/api/print.api")
- boot()
- end
- if not fs.exists("/C/system/api/APIS.lua") then
- downloading("rt2e0GLX", "/C/system/api/APIS.lua")
- boot()
- end
- if not fs.exists("/C/system/api/smbc.lua") then
- downloading("gQVYieMJ", "/C/system/api/smbc.lua")
- boot()
- end
- if not fs.exists("/C/system/api/crypt.lua") then
- downloading("ZmrnX1Cu", "/C/system/api/crypt.lua")
- boot()
- end
- if not fs.exists("/C/system/api/decrypt.lua") then
- downloading("hTBwuXKz", "/C/system/api/decrypt.lua")
- boot()
- end
- if fs.exists("/C/system/RAM/devices/speaker.tmp") then
- sound = true
- end
- end
- os.loadAPI("/C/system/api/APIS.lua")
- dofile("/C/system/api/decrypt.lua")
- uvod()
- APIS.loadingS(w/2-2,h-9, 2, 1, 2048)
- if ServerMode or edice == "Workstation" then service() uvod() w,h = term.getSize() end
- APIS.loadingS(w/2-2,h-9, 2, 1, 2048)
- bgc(colors.lightGray)
- term.clear()
- sleep (0.1)
- bgc(colors.gray)
- term.clear()
- Update()
- if fs.exists("/C/system/.core/logon") then
- stavlog = true
- local na=fs.open("/C/system/.core/defuser","r")
- user = na.readLine ()
- na.close()
- data = fs.open("/C/system/Users/"..user.."/.data","r")
- user = data.readLine ()
- pass = data.readLine ()
- data.close()
- login ()
- else
- stavlog = false
- heslo()
- end
- error()
- end
- function Update()
- if not fs.exists("/C/system/api/update.lua") then downloading("KV6zGsz0", "/C/system/api/update.lua") end
- shell.run("/C/system/api/update.lua nogui")
- end
- function ADClogin(ADuser)
- modem.transmit(tonumber(ADServer),554,idPC)
- modem.transmit(tonumber(ADServer),555,ADuser)
- end
- function UserExist()
- if not fs.exists("/C/system/Users/"..user) then
- bgc(colors.white)
- txc(colors.red)
- curs(5,13)
- prc ("Login failed: User not exists!", 2)
- passI = ""
- sleep (1)
- login = 0
- heslo ()
- end
- if fs.isDir("/C/system/Users/"..user) then
- if fs.exists("/C/system/Users/"..user.."/.data") then
- shell.run("/C/system/api/crypt.lua "..idPC.." /C/system/Users/"..user.."/.data true")
- end
- if fs.exists("/C/system/Users/"..user.."/.data.pcr") then
- shell.run("/C/system/api/crypt.lua "..idPC.." /C/system/Users/"..user.."/.data.pcr true")
- local data = fs.open("/C/system/Users/"..user.."/.data","r")
- userO = data.readLine()
- passO = data.readLine()
- if (passO == "nil") then passO = "" end
- data.close()
- end
- if user == userO and pass == passO then
- if not stavlog then
- logWin.setBackgroundColor(BarPoz)
- logWin.setTextColor(colors.lime)
- logWin.setCursorPos(9,3)
- logWin.write " Login successful! "
- userDir = "/C/system/Users/"..user
- success = true
- sleep ((anim)*10)
- data = fs.open ("/C/system/.core/defuser", "w")
- data.writeLine (user)
- data.close ()
- end
- vitejte ()
- else
- if stavlog then
- stavlog = false
- heslo()
- end
- logWin.setBackgroundColor(BarPoz)
- logWin.setTextColor(colors.red)
- logWin.setCursorPos(9,2)
- logWin.write " Login failed! "
- logWin.setCursorPos(8,3)
- logWin.write "Wrong name or password."
- pass = ""
- sleep ((anim)*20)
- heslo ()
- end
- end
- os.exit()
- end
- function ADuserCopy()
- local Levent, side, freq, rfreq, message = os.pullEvent('modem_message')
- if (rfreq == 1) then
- nameUser = message
- end
- if (rfreq == 2) then
- passUser = message
- end
- if (rfreq == 3) then
- Fname = message
- end
- if (rfreq == 4) then
- Lname = message
- end
- if (rfreq == 5) then
- IsAdmin = message
- local file = fs.open("/C/system/Users/"..nameUser.."/.data","w")
- file.writeLine(nameUser)
- file.writeLine(passUser)
- file.writeLine(Fname)
- file.writeLine(Lname)
- file.writeLine(IsAdmin)
- file.close()
- end
- if (rfreq == 571) then
- if not (message == "fail") then
- local file = fs.open("/C/system/Users/"..nameUser.."/.Registry/bar.nfp","w")
- file.write(message)
- file.close()
- end
- end
- if (rfreq == 572) then
- if not (message == "fail") then
- local file = fs.open("/C/system/Users/"..nameUser.."/.Registry/colors","w")
- file.write(message)
- file.close()
- end
- end
- if (rfreq == 575) then
- if not (message == "fail") then
- local file = fs.open("/startup.lua","w")
- file.write(message)
- file.close()
- updateBar = true
- end
- end
- if (rfreq == 576) then
- if not (message == "fail") then
- local file = fs.open("/C/system/.core/desktop.lua","w")
- file.write(message)
- file.close()
- updateBar = true
- end
- end
- if (rfreq == 577) then
- if not (message == "fail") then
- local file = fs.open("/C/system/api/setting.lua","w")
- file.write(message)
- file.close()
- updateBar = true
- end
- end
- if (rfreq == 580) then
- cReg = tonumber(message)
- end
- end
- function ADImportRegistry()
- local Levent, side, freq, rfreq, message = os.pullEvent('modem_message')
- if (rfreq == 581) then
- registerPath = ("/C/system/Users/"..user.."/.Registry/"..message)
- end
- if (rfreq == 582) then
- if message == "true" then
- if not fs.exists(registerPath) then
- local file = fs.open(registerPath, "w")
- file.close()
- end
- elseif message == "false" then
- if fs.exists(registerPath) then fs.delete(registerPath) end
- end
- end
- end
- function AD_dotazy()
- modem.transmit(tonumber(ADServer),570,"bar")
- ADuserCopy()
- modem.transmit(tonumber(ADServer),570,"Bcol")
- ADuserCopy()
- local data = fs.open("/startup.lua", "r")
- obsah = data.readLine()
- data.close()
- modem.transmit(tonumber(ADServer),575, obsah)
- modem.transmit(tonumber(ADServer),570,"updateStart")
- ADuserCopy()
- if fs.exists("/C/system/.core/desktop.lua") then
- data = fs.open("/C/system/.core/desktop.lua", "r")
- obsah = data.readLine()
- data.close()
- end
- modem.transmit(tonumber(ADServer),576, obsah)
- modem.transmit(tonumber(ADServer),570,"updateDesk")
- ADuserCopy()
- if fs.exists("/C/system/api/setting.lua") then
- data = fs.open("/C/system/api/setting.lua", "r")
- obsah = data.readLine()
- data.close()
- modem.transmit(tonumber(ADServer),577, obsah)
- modem.transmit(tonumber(ADServer),570,"updateSett")
- ADuserCopy()
- end
- end
- function Logovat(textLog)
- local file = fs.open("/log.txt","w")
- file.write(textLog)
- file.close()
- end
- function ADCprijem()
- timerRX = os.startTimer(1)
- while true do
- local event,p1,p2,p3,p4 = os.pullEvent()
- if event == ("modem_message") then
- if (p3 == 556) then
- if (p4 == "true") then
- for i=1,6 do
- ADuserCopy()
- end
- if cReg > 0 then
- modem.transmit(tonumber(ADServer),570,"Reg")
- for i=1,cReg*2 do
- ADImportRegistry()
- end
- end
- nazevUser = ""
- obsahuser = ""
- AD_dotazy()
- UserExist()
- elseif (p4 == "block") then
- fs.delete("/C/system/Users/"..user.."/.data")
- UserExist()
- else
- UserExist()
- end
- end
- elseif event == "timer" then
- if p1 >= timerRX then
- logWin.setBackgroundColor(BarPoz)
- logWin.setTextColor(colors.red)
- logWin.setCursorPos(9,2)
- logWin.write "Connection not found!"
- logWin.setCursorPos(9,3)
- logWin.write " Go offline mode. "
- sleep(1.5)
- logWin.setCursorPos(9,2)
- logWin.write " "
- UserExist()
- end
- end
- end
- end
- function login()
- checkModem()
- if (ADServer == idPC) then
- os.reboot()
- end
- if not fs.exists("/C/system/Users/"..user.."/.data") then
- novaplocha = true
- else
- novaplocha = false
- end
- if localAD then
- if fs.exists ("/C/system/server/rules/AD/Users/"..user.."/.data") then
- fs.delete("/C/system/Users/"..user.."/.data")
- fs.copy("/C/system/server/rules/AD/Users/"..user.."/.data", "/C/system/Users/"..user.."/.data")
- end
- end
- if ADC and not fs.exists ("/C/system/server/rules/AD/Users/") and not (modemPos == "offline") then
- ADClogin(user)
- ADCprijem()
- else
- UserExist()
- end
- end
- function samotny()
- local q = 0
- local jmenoP = {}
- local FileList = fs.list("/C/system/Users")
- for _, file in ipairs(FileList) do
- q = q + 1
- jmenoP[q] = file
- end
- if q == 1 then
- user = jmenoP[1]
- if fs.exists ("/C/system/Users/"..user.."/.data") then
- local f=fs.open("/C/system/Users/"..user.."/.data","r")
- user=f.readLine()
- pass=f.readLine()
- Fname=f.readLine()
- Lname=f.readLine()
- f.close()
- end
- if pass == "" then
- vitejte()
- end
- end
- end
- function heslo()
- if fs.exists("/C/system/.core/ucet") or fs.exists("/C/system/Users") then else
- downloading("McRCnrpM", "/C/system/RAM/AccountCreate.lua")
- local Loader = os.loadAPI("/C/system/RAM/AccountCreate.lua")
- if (Loader) then
- AccountCreate.account()
- if fs.exists("/C/system/RAM/NewUser") then local data = fs.open("/C/system/RAM/NewUser", "r") nUser = data.readLine() data.close()
- if not ServerMode then downloading("ZQ8BBcVQ","/C/system/Users/"..nUser.."/.Registry/bar.nfp") end
- end
- else os.shutdown() end
- local ucet = fs.open("/C/system/.core/ucet","w")
- ucet.close()
- end
- if not ADC and not fs.exists("/C/system/RAM/logout") and not ServerMode then
- samotny()
- end
- sit()
- function LogAccess()
- logWin.setBackgroundColor(colors.lightGray)
- logWin.setTextColor(colors.white)
- logWin.setCursorPos(14,9)
- logWin.write " Login "
- sleep(anim)
- login()
- end
- function PassAccess()
- logWin.setBackgroundColor(colors.lightBlue)
- bgc(colors.lightBlue)
- logWin.setTextColor(colors.black)
- logWin.setCursorPos(14,7)
- logWin.write " "
- logWin.setCursorPos(15,7)
- pass = read(string.char(7))
- logWin.setBackgroundColor(colors.white)
- bgc(colors.white)
- logWin.setCursorPos(14,7)
- logWin.write " "
- logWin.setCursorPos(15,7)
- for i=1,#pass do
- write(string.char(7))
- end
- end
- if user == nil then
- if fs.exists ("/C/system/.core/defuser") then
- local na=fs.open("/C/system/.core/defuser","r")
- user = na.readLine ()
- na.close()
- else
- user = ""
- end
- end
- if displayload then
- monitor.setBackgroundColor(colors.white)
- monitor.setCursorPos(e/2-12,j/2+4)
- monitor.setTextColor(colors.gray)
- monitor.write("Waiting for user login...")
- end
- if fs.exists ("/C/system/RAM/startuplog") then
- local data = fs.open ("/C/system/RAM/startuplog", "r")
- login = data.readLine ()
- data.close ()
- end
- bgc(colors.white)
- txc(colors.lightGray)
- term.clear()
- if (ADC) then
- curs(1,1)
- print ("AD server: "..ADServer)
- print ("My adress: "..idPC)
- end
- if pocket then
- Xl = 1
- else
- Xl = w/2-15
- end
- if fs.exists("/C/system/Users/"..user.."/.Registry/colors") then
- Barvy()
- else
- BarPoz = 2048
- BarTxt = 1
- end
- logWin = window.create(term.current(),Xl,5,30,10)
- logWin.setBackgroundColor(BarPoz)
- logWin.clear()
- logo()
- if not ServerMode then
- curs(1,18)
- bgc(colors.gray)
- txc(colors.white)
- write " Power "
- pass=""
- end
- logWin.setTextColor(colors.lightBlue)
- logWin.setCursorPos(29,5)
- logWin.write "V"
- logWin.setTextColor(BarTxt)
- logWin.setCursorPos(2,3)
- logWin.write "Login"
- logWin.setCursorPos(2,5)
- logWin.write("User name: ")
- logWin.setCursorPos(2,7)
- logWin.write("Password:")
- logWin.setBackgroundColor(colors.white)
- logWin.setTextColor(colors.black)
- logWin.setCursorPos(14,5)
- logWin.write " "
- logWin.setCursorPos(14,7)
- logWin.write " "
- logWin.setCursorPos(14,9)
- logWin.write " Login "
- logWin.setCursorPos(15,5)
- logWin.write (user)
- while true do
- x,y = term.getSize()
- os.startTimer(1)
- if ServerMode and fs.exists("/C/system/RAM/shutdown.pdr") then
- vypnout()
- end
- local event,p1,p2,p3, p4 = os.pullEvent()
- button = p1
- x = p2
- y = p3
- key = p1
- if event == "mouse_click" and x >= 1 and x <= 7 and y == 18 and button == 1 and not ServerMode then
- hotrezimy ()
- elseif x == math.floor(Xl+28) and y == 9 and button == 1 then
- if fs.exists ("/C/system/Users") then
- txc(colors.black)
- curs(Xl+28,9)
- write "V"
- i = 0
- jmeno = {}
- local FileList = fs.list("/C/system/Users") --Table with all the files and directories available
- for _, file in ipairs(FileList) do
- i = i + 1
- jmeno[i] = file
- end
- if (i>9) then
- i = 9
- end
- end
- local myWindow = window.create(term.current(),Xl+13,10,14,i)
- myWindow.setBackgroundColor(colors.lightBlue)
- myWindow.clear()
- local a = 1
- repeat
- myWindow.setCursorPos(2,a)
- myWindow.write(jmeno[a])
- a = a + 1
- until a == i+1
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= Xl+12 and x <= Xl+26 and y >= 10 and y <= 18 and button == 1 then
- user = jmeno[y-9]
- heslo()
- else
- heslo()
- end
- end
- elseif event == "mouse_click" and x >= Xl+12 and x <= Xl+26 and y == 9 and button == 1 then
- logWin.setBackgroundColor(colors.lightBlue)
- bgc(colors.lightBlue)
- logWin.setTextColor(colors.black)
- logWin.setCursorPos(14,5)
- logWin.write " "
- logWin.setCursorPos(15,5)
- user = read()
- logWin.setBackgroundColor(colors.white)
- logWin.setTextColor(colors.black)
- logWin.setCursorPos(14,5)
- logWin.write " "
- logWin.setCursorPos(15,5)
- logWin.write (user)
- elseif (event == "mouse_click" and x >= Xl+12 and x <= Xl+26 and y == 11 and button == 1) or event == "key" then PassAccess() LogAccess()
- elseif event == "mouse_click" and x >= Xl+12 and x <= Xl+19 and y == 13 and button == 1 then LogAccess()
- elseif event == "key" and p1 == keys.enter then LogAccess()
- elseif event == "key" and p1 == keys.numEnter then LogAccess()
- end
- end
- end
- function vitejte ()
- if fs.exists ("/C/system/Users/"..user.."/.data") then
- local f=fs.open("/C/system/Users/"..user.."/.data","r")
- user=f.readLine()
- pass=f.readLine()
- Fname=f.readLine()
- Lname=f.readLine()
- f.close()
- shell.run("/C/system/api/crypt.lua "..idPC.." /C/system/Users/"..user.."/.data true")
- end
- if fs.exists("/C/system/Users/"..user.."/.Registry/.disableSound") then
- sound = false
- end
- if novaplocha then
- local data = fs.open("/C/system/Users/"..user.."/Desktop/This PC.src", "w")
- data.close()
- end
- if (novaplocha) then
- downloading("ZQ8BBcVQ", "/C/system/Users/"..user.."/.Registry/bar.nfp")
- local data = fs.open("/C/system/Users/"..user.."/Desktop/This PC.src", "w")
- data.close()
- novaplocha = false
- end
- if displayload then
- monitor.setBackgroundColor(colors.white)
- monitor.setCursorPos(e/2-12,j/2+4)
- monitor.setTextColor(colors.gray)
- monitor.write("Connecting... ")
- end
- bgc(colors.lightGray)
- term.clear()
- sleep (0.1)
- bgc(colors.gray)
- term.clear()
- sleep (0.1)
- bgc(colors.black)
- txc(colors.black)
- term.clear()
- bgc(colors.white)
- txc(colors.black)
- term.clear ()
- data = fs.open ("/C/system/RAM/user", "w")
- data.writeLine (user)
- data.writeLine (pass)
- data.close ()
- if not fs.exists("/C/system/RAM/logout") then
- if updateBar then
- prc ("Please wait", 9)
- sleep(0.4)
- prc ("Working on updates", 9)
- prc ("Don't turn off your computer", 11)
- updt = 0
- repeat
- txc(colors.black)
- bgc(colors.white)
- prc (updt.."% complete", 10)
- updt = updt + 20
- curs(1,12)
- txc(colors.white)
- bgc(colors.white)
- if updt == 20 then
- if pastebinUpdate then fs.delete("/C/system/api/stahni.api") downloading("GssKCexp", "/C/system/api/stahni.api") end
- if soundUpdate then fs.delete("/C/system/api/sound.api") downloading("Td7gSZZq", "/C/system/api/sound.api") end
- elseif updt == 40 then
- if BSODUpdate then fs.delete("/C/system/api/bluescreen.lua") downloading("DSNcZuMZ", "/C/system/api/bluescreen.lua") end
- if SMBUpdate then fs.delete("/C/system/api/smbc.lua") downloading("gQVYieMJ", "/C/system/api/smbc.lua") end
- elseif updt == 60 then
- if CMDUpdate then fs.delete("/C/system/api/commands.lua") downloading("r18V4xrG", "/C/system/api/commands.lua") end
- if APIUpdate then fs.delete("/C/system/api/APIS.lua") downloading("GssKCexp", "/C/system/api/APIS.lua") end
- elseif updt == 80 then
- if printUpdate then fs.delete("/C/system/api/print.api") downloading("VEfwuEHM", "/C/system/api/print.api") end
- end
- sleep(0.4)
- until updt == 120
- prc (" ", 9)
- prc (" ", 10)
- prc (" ", 11)
- end
- end
- txc(colors.black)
- if not (Fname == "") and not (Lname == "") and not (Fname == nil) and not (Lname == nil) and not (Fname == " ") and not (Lname == " ") then
- prc ("Welcome "..Fname.." "..Lname, h/2-2)
- else
- prc ("Welcome "..user, h/2-2)
- end
- if fs.exists("/C/system/Users/"..user.."/bar.nfp") and not fs.exists("/C/system/Users/"..user.."/.Registry/bar.nfp") then fs.move("/C/system/Users/"..user.."/bar.nfp", "/C/system/Users/"..user.."/.Registry/bar.nfp") end
- logo()
- curs(1,10)
- if fs.exists("/C/system/RAM/logout") then
- shell.exit()
- fs.delete("/C/system/RAM/logout")
- if fs.exists("/C/system/RAM/devices/speaker.tmp") then
- sound = true
- end
- song("login")
- else
- song("startup")
- end
- if not sound then sleep(0.5) end
- sleep (0.1)
- bgc(colors.gray)
- term.clear()
- if fs.exists("/C/desktop.lua") then
- fs.delete("/C/desktop.lua")
- end
- if not fs.exists ("/C/system/api/bluescreen.lua") then
- downloading("DSNcZuMZ", "/C/system/api/bluescreen.lua")
- end
- os.unloadAPI("/C/system/api/APIS.lua")
- fs.delete("/C/system/RAM/bluescreen")
- local data = fs.open ("/C/system/RAM/FirstLogin", "w") data.close ()
- shell.run ("/C/system/api/bluescreen.lua")
- error()
- end
- if fs.exists("/C/system/RAM/logout") then
- heslo()
- end
- if fs.exists("/C/system/RAM/displayreboot") then
- if ServerMode then
- service()
- end
- fs.delete("/C/system/RAM/displayreboot")
- if fs.exists("/C/system/.core/display") then
- local f=fs.open("/C/system/.core/display","r")
- monitor=f.readLine()
- f.close()
- bgc(colors.black)
- term.clear()
- prc("Connected to an external monitor",h/2-2)
- txc(colors.black)
- shell.run("monitor "..monitor.." /C/system/.core/desktop.lua")
- else
- shell.run ("/C/system/.core/desktop.lua")
- end
- shell.run("/C/system/.core/desktop.lua")
- end
- if fs.exists("/C/system/.core/display") then
- if fs.exists("/C/system/.core/display") then
- local f=fs.open("/C/system/.core/display","r")
- monitor=f.readLine()
- f.close()
- if peripheral.isPresent(monitor) and peripheral.getType(monitor)=="monitor" then
- monitor = peripheral.wrap(monitor)
- displayload = true
- else
- fs.delete("/C/system/.core/display")
- boot()
- end
- e,j = monitor.getSize()
- monitor.setBackgroundColor(colors.white)
- monitor.clear()
- monitor.setTextColor(colors.blue)
- monitor.setCursorPos(e/2-5,j-1)
- monitor.write" Pepek"
- monitor.setCursorPos(e/2+3,j-1)
- monitor.write"Soft "
- monitor.setCursorPos(e/2+2,j-1)
- monitor.setTextColor(colors.lime)
- monitor.write"@"
- monitor.setBackgroundColor(colors.white)
- monitor.setTextColor(colors.black)
- monitor.setCursorPos(e/2-11,j/2)
- monitor.write("Pepdroll Seven "..edice)
- monitor.setCursorPos(e/2-12,j/2+4)
- monitor.setTextColor(colors.gray)
- monitor.write("Waiting for connection...")
- monitor.setCursorPos(e/2-11,j/2)
- monitor.setBackgroundColor(colors.blue)
- textutils.slowPrint " "
- end
- end
- sit()
- if fs.exists ("/server") then
- local data = fs.open ("/C/system/.core/system", "w")
- data.writeLine("Server")
- data.close()
- fs.delete("/server")
- os.reboot()
- end
- if fs.exists ("/stahni.lua") then
- fs.delete("/stahni.lua")
- end
- if fs.exists("/C/system/.core/system") then
- local data = fs.open ("/C/system/.core/system", "r")
- edice = data.readLine()
- data.close()
- else
- local data = fs.open ("/C/system/.core/system", "w")
- edice = "Standard"
- data.writeLine(edice)
- data.close()
- 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
- if (edice == "Server") then
- ServerMode = true
- if fs.exists ("/C/system/.core/AD") then
- localAD = true
- end
- end
- if not fs.exists("/C/system/.core/colors") then
- local f=fs.open("/C/system/.core/colors","w")
- local text={barva=colors.blue}
- f.write(textutils.serialize(text))
- f.close()
- end
- BarPoz = 2048 BarTxt = 1
- if not fs.exists("/C/system/api/closeApp") then
- downloading("EEVJPR7F", "/C/system/api/closeApp")
- end
- if fs.exists ("/C/system/RAM/startuplog") then
- fs.delete ("/C/system/RAM/startuplog")
- heslo ()
- end
- if #tArgs > 0 then
- if (tArgs[1] == "shutdown") then
- vypnout()
- elseif (tArgs[1] == "reboot") then
- restart()
- end
- else
- if not ServerMode then fs.delete("/C/system/RAM") end
- checkonline()
- boot()
- end
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement