Note that you don't use /var with "as". The syntax is: /var %varname = value

If you want it to work regardless of parentheses, just remove them altogether.

on *:text:*:#: {
  if (rock isin $strip($2-) && rock !isin $strip($1)) {
    do something

That will do what you want if rock is anywhere in the line as long as it isn't part of the first word. If it's part of the first word, it won't do anything even if it's found somewhere else in the line. This ignores the ()'s completely as you stated, so it doesn't matter if it's written as rock or (rock).

The one thing to note... this is a basic match. It would also match any word that has rock in it, such as crock. There aren't many words like that, so this probably won't matter. However, if it is an issue, you'd need to do some extra work. You can use $istok() to see if it's the only thing in the word, but that doesn't ignore punctuation characters or other symbols. So using $istok() by itself would match the word rock but not rock. (with the period after it). To do that you either need to $remove() all punctuation characters and symbols, or use regex to match text without punctuation. That starts to be more complicated, so you'll probably want to see how this works first and learn how it's set up before trying to make use of something like that.

Invision Support
#Invision on