> "GETCHANNEL"  <-- to get active window.
> 
> You cannot put ECHO to a query window if thats what ya want.. But I have

Hmm, seems the little entry in AmIRC.ReadMe re. the ECHO command
is not noticed by many people ;)

Ok, some 'docs' on the new options of ECHO then :^)

echo P=PREFIX/K,C=COL/K/N,N=NICK/K,CH=CHANNEL/K,STRICT/S,TEXT/F/A

NICK
   allows outputting to query window of <nick> if it exists,
   otherwise it outputs to the CHANNEL, if specified. If
   CHANNEL is not specified or is invalid, it'll just output
   in the usual fashion: to the default window.

CHANNEL
   allows outputting to specified channelwindow, if it exists,
   otherwise the default channel. (Note that NICK has higher
   priority if both CHANNEL and NICK are used)

STRICT
   when using NICK and/or CHANNEL and you specify this, then
   nothing will be output if no specified target window could be found


ECHO returns RC=5 if using the STRICT option and no target
window could be found.

Some examples:

This outputs to query window for MegaLamer, or doesn't output
at all if that window does not exist:

  ECHO N=MegaLamer STRICT T=This is the text

This tries to output to MegaLamer's window first, then to
&Lameness if query window doesn't exist, and if that fails,
to the default window:

  ECHO N=MegaLamer CH=&Lameness T=This is the text

These features might be handy in conjunction with the
ISICONIFIED command. You can abuse this to see if
the channel/dialog window you want to output to is
there, like this:

"ISICONIFIED NICK=MegaLamer"
IF RC~=5 THEN DO
   [Query window exists]
END; ELSE DO
   [Query window does not exist]
END

(ISICONIFIED returns RC=0 if window is open, RC=1 if it's
iconified to windowlist, and RC=5 if the window is not found)

Finally, we have the GETTARGET command, which is also handy
in this case, as it gives the current window you're talking in (it
being a channel or query window) in RESULT.

Let's say If you need to dump a load of text into the current channel
window, but don't want the output to 'follow' you if you activate
a different channelwindow (/WHO 0, anyone? ;^), you could do:

"GETTARGET"; target = RESULT

and then subsequently use

"ECHO CH=" || target "T=Blahblah"

for all lines you want to output (perhaps with STRICT too)

Ok, this is enough for now ;^)

--
Jamie
__________________________________________________________
AmIRC Mailing List - Info & Archive: http://www.vapor.com/
For Listserver Help: <[EMAIL PROTECTED]>, "HELP"
To Unsubscribe: <[EMAIL PROTECTED]>, "UNSUBSCRIBE"

Reply via email to