Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local addr, invoke = computer.getBootAddress(), component.invoke
- local function loadfile(file)
- local handle = assert(invoke(addr, "open", file))
- local buffer = ""
- repeat
- local data = invoke(addr, "read", handle, math.maxinteger or math.huge)
- buffer = buffer .. (data or "")
- until not data
- invoke(addr, "close", handle)
- return load(buffer, "=" .. file, "bt", _G)
- end
- loadfile("<file>")(loadfile)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement