diff --git a/EFI/Full.lua b/EFI/Full.lua index 7a547ad9..c994e1de 100755 --- a/EFI/Full.lua +++ b/EFI/Full.lua @@ -2,7 +2,7 @@ -- local component, computer, unicode = require("component"), require("computer"), require("unicode") -local stringsMain, stringsBootFromURL, stringsChangeLabel, stringKeyDown, stringsInit, stringsFilesystem, componentProxy, componentList, pullSignal, uptime, tableInsert, mathMax, mathMin, mathHuge = "UEFI v2.0", "Internet boot", "Change label", "key_down", "/init.lua", "filesystem", component.proxy, component.list, computer.pullSignal, computer.uptime, table.insert, math.max, math.min, math.huge +local stringsMain, stringsBootFromURL, stringsChangeLabel, stringKeyDown, stringsInit, stringsFilesystem, componentProxy, componentList, pullSignal, uptime, tableInsert, mathMax, mathMin, mathHuge = "MineOS EFI", "Internet boot", "Change label", "key_down", "/init.lua", "filesystem", component.proxy, component.list, computer.pullSignal, computer.uptime, table.insert, math.max, math.min, math.huge local colorsTitle, colorsBackground, colorsText, colorsSelectionBackground, colorsSelectionText, eeprom, gpu, internetAddress = 1, 0, 1, 1, 0, componentProxy(componentList("eeprom")()), componentProxy(componentList("gpu")()), componentList("internet")() gpu.bind(componentList("screen")(), true) local shutdown, gpuSet, gpuFill, eepromSetData, eepromGetData, depth, screenWidth, screenHeight, curentBackground, currentForeground, NIL = computer.shutdown, gpu.set, gpu.fill, eeprom.setData, eeprom.getData, gpu.getDepth(), gpu.getResolution() diff --git a/EFI/Minified.lua b/EFI/Minified.lua index 63ff27b0..5656a9ef 100755 --- a/EFI/Minified.lua +++ b/EFI/Minified.lua @@ -1 +1 @@ -local a,b,c,d,e,f,g,h,i,j,k,l,m,n="UEFI v2.0","Internet boot","Change label","key_down","/init.lua","filesystem",component.proxy,component.list,computer.pullSignal,computer.uptime,table.insert,math.max,math.min,math.huge;local o,p,q,r,s,t,u,v=1,0,1,1,0,g(h("eeprom")()),g(h("gpu")()),h("internet")()u.bind(h("screen")(),true)local w,x,y,z,A,B,C,D,E,F,G=computer.shutdown,u.set,u.fill,t.setData,t.getData,u.getDepth(),u.getResolution()computer.getBootAddress,computer.setBootAddress=A,z;if B==4 then o,p,q,r,s=0x333333,0xFFFFFF,0x333333,0x333333,0xFFFFFF elseif B==8 then o,p,q,r,s=0x2D2D2D,0xE1E1E1,0x878787,0x878787,0xE1E1E1 end;local H,I,J,K=function(L)if L~=E then u.setBackground(L)E=L end end,function(L)if L~=F then u.setForeground(L)F=L end end,function(M)return math.floor(M+0.5)end,function(N,O,P)if#N1 then ah=ah-1 elseif ak[4]==208 and ah<#af then ah=ah+1 elseif ak[4]==28 then if af[ah].c then af[ah].c()end;if af[ah].b then return end end end end end,function(U,al)local N,am,an,ak,ao="",true;while 1 do an=al..N;y(1,U,C,1," ")x(J(C/2-#an/2),U,an..(am and"█"or""))ak={i(0.5)}if ak[1]==d then if ak[4]==28 then return N elseif ak[4]==14 then N=N:sub(1,-2)else ao=unicode.char(ak[3])if ao:match("^[%w%d%p%s]+")then N=N..ao end end;am=true elseif ak[1]=="clipboard"then N=N..ak[3]elseif not ak[1]then am=not am end end end,function(ap)local aq,aa,ac,ar,ae=function(N)_(G,b,"Internet boot failed: "..N,1)end,"",g(v).request(ap)if ac then _(G,b,"Downloading script...")while 1 do ar,ae=ac.read(n)if ar then aa=aa..ar else ac:close()if ae then aq(ae)else ar,ae=load(aa)if ar then z("#"..ap)ar,ae=pcall(ar)if ar then return else aq(ae)end else aq(ae)end end;break end end else aq("invalid URL-address")end end;_(G,a,"Hold Alt to show boot options menu")local as,ak=j()+1;while j() "or" ")..K(ax,10)..K(a9.spaceTotal()>1048576 and"HDD"or a9.spaceTotal()>65536 and"FDD"or"SYS",3)..K(ay and"R"or"R/W",3)..aw:sub(1,8).." "..K(string.format("%.2f",a9.spaceUsed()/a9.spaceTotal()*100).."%",6,1),function()local az={a5()}if not ay then k(az,1,S(c,function()a9.setLabel(a7(_(G,c)+2,"Enter new name: "))end,1))k(az,2,S("Format",function()_(G,a,"Formatting filesystem "..aw)for aA,aB in ipairs(a9.list("/"))do a9.remove(aB)end;_(G,a,"Formatting finished",1)end,1))end;if a9.exists(e)then k(az,1,S("Set as startup",function()z(aw)end,1))end;a6(ax.." ("..aw..")",az)end,1))end;a6("Select filesystem to show options",au)end),S("Shutdown",function()w()end),a5()}if v then k(at,2,S(b,function()a8(a7(_(G,b)+2,"Enter URL: "))end))end;a6(a,at)end end;local aa,a9=A()if aa:sub(1,1)=="#"then a8(aa:sub(2,-1))else a9=g(aa)if a9 then a4(a9)else for aw in h(f)do a9=g(aw)if a9.exists(e)then z(aw)a4(a9)break else a9=nil end end;if not a9 then _(G,a,"No bootable mediums found",1)end end end;w() \ No newline at end of file +local a,b,c,d,e,f,g,h,i,j,k,l,m,n="MineOS EFI","Internet boot","Change label","key_down","/init.lua","filesystem",component.proxy,component.list,computer.pullSignal,computer.uptime,table.insert,math.max,math.min,math.huge;local o,p,q,r,s,t,u,v=1,0,1,1,0,g(h("eeprom")()),g(h("gpu")()),h("internet")()u.bind(h("screen")(),true)local w,x,y,z,A,B,C,D,E,F,G=computer.shutdown,u.set,u.fill,t.setData,t.getData,u.getDepth(),u.getResolution()computer.getBootAddress,computer.setBootAddress=A,z;if B==4 then o,p,q,r,s=0x333333,0xFFFFFF,0x333333,0x333333,0xFFFFFF elseif B==8 then o,p,q,r,s=0x2D2D2D,0xE1E1E1,0x878787,0x878787,0xE1E1E1 end;local H,I,J,K=function(L)if L~=E then u.setBackground(L)E=L end end,function(L)if L~=F then u.setForeground(L)F=L end end,function(M)return math.floor(M+0.5)end,function(N,O,P)if#N1 then ah=ah-1 elseif ak[4]==208 and ah<#af then ah=ah+1 elseif ak[4]==28 then if af[ah].c then af[ah].c()end;if af[ah].b then return end end end end end,function(U,al)local N,am,an,ak,ao="",true;while 1 do an=al..N;y(1,U,C,1," ")x(J(C/2-#an/2),U,an..(am and"█"or""))ak={i(0.5)}if ak[1]==d then if ak[4]==28 then return N elseif ak[4]==14 then N=N:sub(1,-2)else ao=unicode.char(ak[3])if ao:match("^[%w%d%p%s]+")then N=N..ao end end;am=true elseif ak[1]=="clipboard"then N=N..ak[3]elseif not ak[1]then am=not am end end end,function(ap)local aq,aa,ac,ar,ae=function(N)_(G,b,"Internet boot failed: "..N,1)end,"",g(v).request(ap)if ac then _(G,b,"Downloading script...")while 1 do ar,ae=ac.read(n)if ar then aa=aa..ar else ac:close()if ae then aq(ae)else ar,ae=load(aa)if ar then z("#"..ap)ar,ae=pcall(ar)if ar then return else aq(ae)end else aq(ae)end end;break end end else aq("invalid URL-address")end end;_(G,a,"Hold Alt to show boot options menu")local as,ak=j()+1;while j() "or" ")..K(ax,10)..K(a9.spaceTotal()>1048576 and"HDD"or a9.spaceTotal()>65536 and"FDD"or"SYS",3)..K(ay and"R"or"R/W",3)..aw:sub(1,8).." "..K(string.format("%.2f",a9.spaceUsed()/a9.spaceTotal()*100).."%",6,1),function()local az={a5()}if not ay then k(az,1,S(c,function()a9.setLabel(a7(_(G,c)+2,"Enter new name: "))end,1))k(az,2,S("Format",function()_(G,a,"Formatting filesystem "..aw)for aA,aB in ipairs(a9.list("/"))do a9.remove(aB)end;_(G,a,"Formatting finished",1)end,1))end;if a9.exists(e)then k(az,1,S("Set as startup",function()z(aw)end,1))end;a6(ax.." ("..aw..")",az)end,1))end;a6("Select filesystem to show options",au)end),S("Shutdown",function()w()end),a5()}if v then k(at,2,S(b,function()a8(a7(_(G,b)+2,"Enter URL: "))end))end;a6(a,at)end end;local aa,a9=A()if aa:sub(1,1)=="#"then a8(aa:sub(2,-1))else a9=g(aa)if a9 then a4(a9)else for aw in h(f)do a9=g(aw)if a9.exists(e)then z(aw)a4(a9)break else a9=nil end end;if not a9 then _(G,a,"No bootable mediums found",1)end end end;w() \ No newline at end of file