Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local a;do local b=component.invoke;local function c(d,e,...)local f=table.pack(pcall(b,d,e,...))if not f[1]then return nil,f[2]else return table.unpack(f,2,f.n)end end;local g=component.list("eeprom")()computer.getBootAddress=function()return c(g,"getData")end;computer.setBootAddress=function(d)return c(g,"setData",d)end;do local h=component.list("screen")()gpu=component.list("gpu")()if gpu and h then c(gpu,"bind",h)else error("GPU required",0)end end;local function i(j)local k=0;for l in pairs(j)do k=k+1 end;return k end;local function m(d)local n,o=c(d,"open","/init.lua")if not n then return nil,o end;local p=""repeat local q,o=c(d,"read",n,math.huge)if not q and o then return nil,o end;p=p..(q or"")until not q;c(d,"close",n)return load(p,"=init")end;local o;local r={}if computer.getBootAddress()~=""then table.insert(r,computer.getBootAddress())end;for d in component.list("filesystem")do if d~=computer.getBootAddress()then table.insert(r,d)end end;local function s(d)if c(d,"getLabel")~=nil and c(d,"getLabel")~=""then return c(d,"getLabel")else return"NO LABEL"end end;local function t(u,v,w)v=v or""c(component.list("gpu")(),"set",1,w,w..": "..v.."["..s(u).."] "..u)end;local function x()for w,d in ipairs(r)do t(d,"",w)end end;x()while true do local y,u,z,A,B=computer.pullSignal()if y=="key_up"then local C=tonumber(unicode.char(z))if C~=nil then if C>=1 and C<=i(r)then t(r[C],"[TRYING] ",C)a,o=m(r[C])if a then t(r[C],"[BOOTING] ",C)computer.setBootAddress(r[C])break else computer.beep(500,0.2)t(r[C],"[INVALID] ",C)end end end end end end;computer.beep(1000,0.2)a()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement