FFGFlash

install

Sep 28th, 2021 (edited)
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.32 KB | None | 0 0
  1. local drive = peripheral.find("drive") if drive then drive.ejectDisk() end
  2. local e,u=textutils.urlEncode,textutils.unserialize
  3. local c,t,w,h=0,0,term.getSize()
  4. local l,m="///nekOS///","edb00000bde"
  5. local function get(c,p) local r=http.get("http://pastebin.com/raw.php?i="..e(c)) if not r then return false,"Failed to get paste." end local d=r.readAll() r.close() fs.delete(p) local f=fs.open(p,"w") f.write(d) f.close() return true end
  6. local function load(p) if not fs.exists(p) then return {} end local f=fs.open(p,"r") local t=u(f.readAll()) f.close() return t or {} end
  7. local function progress(m) local p=c/t local j=math.floor(p*w) local s=""..(math.floor(p*1000)/10).."%" term.setCursorPos(1,h-1) term.clearLine() term.write(m) term.setCursorPos(w-string.len(s)+1,h-1) term.write(s) term.setCursorPos(1,h) term.clearLine() for i=1,j do term.blit("#","8","7") end end
  8.  
  9. term.setTextColor(colors.white)
  10. term.setBackgroundColor(colors.gray)
  11. term.clear()
  12. term.setCursorPos(math.floor((w-string.len(l))/2),math.floor(h/2))
  13. for i=1,string.len(l) do term.blit(string.sub(l,i,i),string.sub(m,i,i),"7") sleep(1/5) end
  14. get("3uUQRK59","nekOS/main.manifest")
  15. local m=load("nekOS/main.manifest")
  16. for k,v in pairs(m.Files) do t=t+1 end
  17. for k,v in pairs(m.Files) do progress("Downloading "..k.."...") get(v.Code,k) c=c+1 sleep(1/t) end
  18. os.reboot()
Add Comment
Please, Sign In to add comment