OC-Tsuki/extras/crescent/bootvelxloader.lua
Sam Roxanne c9c05221d9 wot
2020-06-02 01:23:58 -05:00

16 lines
384 B
Lua

local fs = component.proxy(computer.getBootAddress())
local f = fs.open("boot.velx")
fs.seek(f, "set", 14)
local psize = string.unpack("<I3", fs.read(f, 3))
fs.seek(f, "set", 27)
local rdat = psize
local dat = ""
local buf = ""
repeat
buf = fs.read(f, rdat)
if (buf) then
dat = dat .. buf
end
rdat = psize - #dat
until rdat == 0 or not buf or buf == ""
load(dat, "=boot.velx")()