Penggrin

MineOS Flame Installer

Sep 5th, 2021 (edited)
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.61 KB | None | 0 0
  1. local component = require("component")
  2. local computer = require("computer")
  3.  
  4. if not component.isAvailable("eeprom") then
  5.     error("EEPROM component is required for installation")
  6. end
  7.  
  8. local handle, data, chunk = component.internet.request("https://raw.githubusercontent.com/penggrin12/MineOSFlame/master/Installer/BIOS.lua"), ""
  9.    
  10. while true do
  11.     chunk = handle.read(math.huge)
  12.    
  13.     if chunk then
  14.         data = data .. chunk
  15.     else
  16.         break
  17.     end
  18. end
  19.  
  20. handle.close()
  21.  
  22. local result, reason = load(data, "=installer")
  23. if result then
  24.     component.eeprom.set(data)
  25.     computer.shutdown(true)
  26. else
  27.     error(reason)  
  28. end
Add Comment
Please, Sign In to add comment