Originally Posted By: Tomao
My bad. I wasn't aware that the $cc will only return the first common channel. I was trying to address the scenario when you reply to a nickname in your PM. There is no $chan in the PM. I thought by using a loop through the common channels would get that matter resolved.


@Tomao: The loop would be fine except that you use RETURN, which breaks you out of the loop and returns you to the calling script. There isn't a small change to resolve that issue, but you could store the channels in a variable and return the entire list and then work from that in the script. The problem there is variable length and it probably won't be that efficient.

In the case of handling queries, I typically do this: msg $iif($chan,$chan,$nick) some text. That will work as long as your input event is limited to channel and query. In this script, you can put the $iif() into a variable and then use the variable everywhere that you'd need to save space in the script. $active and/or $target may also be valid, but I'd need to double check to make sure as I don't use them too often.

The code Wims posted could easily be adjusted to work with queries by changing the event from # to #,? and replacing \1 ison $chan with \1 ison $chan || $nick and then using the $iif() as mentioned above in the /msg.

As far as input events, he can have 2 if the other is in a separate file. That's probably what happened. Afaik, HALT should be used with input events even though you'd normally use HALTDEF for other events.

@drb: Make sure you don't have the original script still. Check under the View menu in each file to make sure it's not listed there.

Also, if you use any other scripts, they may also be echoing the text. If that's the case, you'd need to either combine this script with what you already have or else remove your other script(s).

Last edited by Riamus2; 13/06/11 07:42 PM.

Invision Support
#Invision on irc.irchighway.net