Code:
on *:text:*:#: {
  var %x = (rock)
  if (%x isin $2- && %x != $1) {
    do something
  }
}


Some notes...

If you want it to do something when that's part of $2 and on, then you want to check if it's part of $2-. You also said you don't want it to do anything if the word is in $1, so you need to also check to make sure it's not in $1. Note that this part is semi-optional. If you don't want it to ever do anything if it's in $1 even if it's in $2-, then you want to have the check preventing it from doing anything if it's in $1. If you don't care whether or not it's in $1, but only if it's in $2-, then you can leave off the $1 check and only check $2-. This depends on what exactly you want to happen with your script.

Finally, note that this example does not take into account color codes. So if someone writes (rock), it won't do anything. You can get around that by stripping control codes if you want.

EDIT: Removed the parentheses bit as it does fail after && even though it works fine as a single comparison. Basically, if you're just doing a check like if ((rock) isin $2-), then it works fine to put that directly in there, but if you're doing something like if ((rock) isin $2- && (rock) != $1), then it fails at the &&. This is due to ambiguity in the coding. The first example, mIRC can get correct, but not the second. And the first may not be correct after a new version is out somewhere down the road, so shouldn't be used.

Last edited by Riamus2; 20/11/12 12:09 AM.

Invision Support
#Invision on irc.irchighway.net