Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- do
- local loadfile = load([[return function(file)
- local pc,cp = computer or package.loaded.computer, component or package.loaded.component
- local addr, invoke = pc.getBootAddress(), cp.invoke
- local handle, reason = invoke(addr, "open", file)
- assert(handle, reason)
- local buffer = ""
- repeat
- local data, reason = invoke(addr, "read", handle, math.huge)
- assert(data or not reason, reason)
- buffer = buffer .. (data or "")
- until not data
- invoke(addr, "close", handle)
- return load(buffer, "=" .. file, "bt", _G)
- end]], "=loadfile", "bt", _G)()
- loadfile("/lib/core/boot.lua")(loadfile)
- end
- os.execute('/autorun.lua')
- while true do
- local result, reason = xpcall(require("shell").getShell(), function(msg)
- return tostring(msg).."\n"..debug.traceback()
- end)
- if not result then
- io.stderr:write((reason ~= nil and tostring(reason) or "unknown error") .. "\n")
- io.write("Press any key to continue.\n")
- os.sleep(0.5)
- require("event").pull("key")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement