Advertisement
Romanok2805

Untitled

Aug 18th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.23 KB | None | 0 0
  1. local fs = component.proxy(component.list("filesystem")())
  2.  
  3. local file = fs.open("/mnt/ac6/lib/core/boot.lua", "w")
  4. fs.write(file, 'local a=..._G._OSVERSION="OpenOS 1.7.2"local component=component;local computer=computer;local unicode=unicode;local b,c="S",computer.shutdown;computer.runlevel=function()return b end;computer.shutdown=function(d)b=d and 6 or 0;if os.sleep then computer.pushSignal("shutdown")os.sleep(0.1)end;c(d)end;local e=component.list("screen",true)()for f in component.list("screen",true)do if#component.invoke(f,"getKeyboards")>0 then e=f;break end end;_G.boot_screen=e;local g=component.list("gpu",true)()local h,i;if g and e then g=component.proxy(g)g.bind(e)h,i=g.maxResolution()g.setResolution(h,i)g.setBackground(0x000000)g.setForeground(0xFFFFFF)g.fill(1,1,h,i," ")end;local j=1;local k=computer.uptime;local l=computer.pullSignal;local m=k()local function n(o)if g and e then g.set(1,j,o)if j==i then g.copy(1,2,h,i-1,0,-1)g.fill(1,i,h,1," ")else j=j+1 end end;if k()-m>1 then local p=table.pack(l(0))if p.n>0 then computer.pushSignal(table.unpack(p,1,p.n))end;m=k()end end;n("Booting ".._OSVERSION.."...")local q=function(r)n("> "..r)return a(r)end;local function s(r)local t,u=q(r)if t then local v=table.pack(pcall(t))if v[1]then return table.unpack(v,2,v.n)else error(v[2])end else error(u)end end;n("Initializing package management...")local w=s("/lib/package.lua")do _G.component=nil;_G.computer=nil;_G.process=nil;_G.unicode=nil;_G.package=w;w.loaded.component=component;w.loaded.computer=computer;w.loaded.unicode=unicode;w.loaded.buffer=assert(q("/lib/buffer.lua"))()w.loaded.filesystem=assert(q("/lib/filesystem.lua"))()_G.io=assert(q("/lib/io.lua"))()end;n("Initializing file system...")require("filesystem").mount(computer.getBootAddress(),"/")n("Running boot scripts...")local function x(y,...)return component.invoke(computer.getBootAddress(),y,...)end;local z={}for A,r in ipairs(x("list","boot"))do local B="boot/"..r;if not x("isDirectory",B)then table.insert(z,B)end end;table.sort(z)for C=1,#z do s(z[C])end;n("Initializing components...")for D,E in component.list()do computer.pushSignal("component_added",D,E)end;n("Initializing system...")computer.pushSignal("init")require("event").pull(1,"init")_G.runlevel=1')
  5. fs.close(file)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement