# $EPIC: redirect.txt,v 1.4 2006/08/29 18:33:16 sthalik Exp $ ======Synopsis:====== __redirect__ |*||%|= ======Description:====== Redirect sends a copy of all of the output sent to any windows connected to the current server to any place you can send a [[MSG]] to (ie, an irc nickname, a channel, an [[exec command|EXEC]] process, a [[DCC CHAT]], etc) The first argument is a [[MSG]] list and it can contain any number of targets and it's formatted like like a [[MSG]] would be. __REDIRECT__ing to the special target 0 (zero) acts as a sink and throws away all output. Because __REDIRECT__ uses [[MSG]] to send the messages, redirected output will sometimes be PRIVMSGs and sometimes be NOTICEs. This is all handled by the protocol enforcement and is not directly under anyone's control. __REDIRECT__ will execute , and any immediate output from will directly be sent to the target(s). If sends any data to the server, __REDIRECT__ assumes it is a server request and will CONTINUE TO FORWARD YOUR OUTPUT to the targets until a full PING cycle to the server completes. This can be VERY BAD especially since it is possible (and likely) that things other than just the output of will be forwarded to your target(s). YOU HAVE BEEN WARNED! __REDIRECT__ is synchronous. It will not return until has completed. However, if launches a server request, then __REDIRECT__ will return immediately but will continue redirecting output to the target(s) for a full PING cycle afterwards. You cannot stop a __REDIRECT__ in progress! It is possible to set up two clients to get into a __REDIRECT__ loop with each other, if you try hard enough. This is really bad, and you should try not to allow this to happen. It is VERY possible that you could accidentally flood yourself off of irc or annoy others by __REDIRECT__ing them something with a lot of output, such as the [[lastlog command|LASTLOG]] command. All output that is redirected with this command is hooked through the [[ON REDIRECT]] hook, and you can suppress redirected lines by hooking them silently. It is probably a good idea not to send (or recieve) any msgs while a __REDIRECT__ is going on, as those messages will be forwarded on to whoever your __REDIRECT__ target is. This is not a bug in EPIC, it's just one of the problems with using __REDIRECT__. You cannot use __REDIRECT__ in a window that is not connected to a server, even if you are going to run a command that does not need a server connection and you are not going to send the output to a target over irc. ======Examples:====== To send the output of a WHOIS to channel #blah: /redirect #blah whois foobar To send the output of a USERHOST to a running subprocess: /redirect %finger userhost foobar To send the current topic to JoeBob and JimBob: /redirect joebob,jimbob topic #blah