Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ot=term
- local nt={}
- local mod=peripheral.find("modem")
- mod.open(545)
- local function call_remote(k,...)
- args={...}
- mod.transmit(555,545,{"NSA",k,args})
- end
- for k,v in pairs(term) do
- nt[k]=function(...) call_remote(k,...) return ot[k](...) end
- print("Hooked: "..k)
- os.sleep(0)
- end
- _G.term=nt
- nt.clear()
- nt.setCursorPos(1,1)
- local oldf=_G.os.pullEventRaw
- _G.os.pullEventRaw=function()
- local name,a,b,c,d,e=oldf()
- if name=="modem_message" then
- if b==545 then
- if d[3]~=_G.tmp then
- _G.tmp=d[3]
- os.queueEvent(d[1],d[2])
- end
- end
- end
- return name,a,b,c,d,e
- end
- shell.run("sh")
- _G.term=ot
- _G.os.pullEventRaw=oldf
- print("exited")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement