mIRC Homepage
I have figured it out mostly, but I'm only wondering if there's a command that makes my script NOT reply when person x is in the channel.

Person x runs the script as well, and it should only reply when person x is not in the channel because there's no use for people to receive 2 of the same replies.

Thanks in advance.
Add this to your ON *:XXX event used to reply or other event handler. Since you are light on details, that's about all I can do for the moment.

if ( $nick !ison $chan ) { reply }
Another possibility in case each event has many lines of code. Add this line to the beginning of each event:

if ($nick ison $chan) return

-genius_at_work
That won't work for the on NICK and on QUIT events, because $chan is not defined then.
Ok, lets say I want my script to say "Hi" in response to !hi when personx is not on #channel.

Would this work:

on *:TEXT:!hi *:#:
{ if ( personx !ison #channel ) {
msg #channel hi
}
}
Yes, that will work, but if you are BOTH on that channel, using the same script, excluding each other, nothing will happen smile
Yes, I know that. wink

I am the only one running it with the exclude. smile

Edit: Wouldn't this mean that it only does it when the person is in the channel? If not, something else must be wrong with it.. because it's not working. frown
Posted By: Crap Re: In need of some help with my reply-script - 14/01/06 10:35 AM
the ' ! ' before the 'ison' operator makes the operator 'isNOTon'.

I would use the
Code:
on *:text:*:#channel: {
  if (X ison $chan) { return }
  else { commands}

return is like /halt. it just exits the script.
Or even simpler:

if (X !ison $chan) {
commands
}
on *:text:*:!report *:#: {
if (Killingscream ison #trade-report) { return }
else { msg $chan Thanks $nick }
}

I don't seem to be able to find out what's wrong. I'm sure I'm missing something stupid. Also, I want it to only respond if they say: !report http://forums.whatever.com/<inserttopic here>

The last part has to be random of course. Maybe I can just do:
on *:text:*:!report http://forums.whatever.com/ *:#: {

But I'm not sure about that either.

Thanks for all the help so far. smile
You cannot use : directly in the matchtext part because that character is preserved as a delimiter for events.

on *:text:$($+(!report http,$chr(58),//forums.whatever.com/&)):#channel: {
if (killingscream !ison #trade-report) msg # Thanks $nick
}

Change #channel to the name of the channel where you want this to trigger in.
The & in the matchtext requires for there to be a topic appended to the url, without any text after this topic, not even a space or any other character.

Alternatively you can use a regex as matchtext like this:

on $*:text:/^!report http\72\Q//forums.whatever.com/\E\S+$/i:#channel: {
if (killingscream !ison #trade-report) msg # Thanks $nick
}
Used the last one and it works flawless. How do I make it give the same response if someone does:

!report http://forums.whatever.com/showtopic=1 text

That's my last question, thanks everyone once again and FiberOPtics in particular. wink
So the url will always end in "showtopic=<digits>" ?

on $*:text:/^!report http\72\Q//forums.whatever.com/\Eshowtopic=\d+$/i:#channel: {
© mIRC Discussion Forums