Here's an explanation... I'll explain it backwards because that will probably make the most sense.
The final parameter (40) is how we're splitting the text up. $chr(40) is (. So, this will split your $1 into parts everywhere there is a (. These parts are called tokens.
An easy way to look at it is with $gettok(this is a test,1,32)
$chr(32) is a space, so "this is a test" would be broken up at every space. That means there are 4 tokens (words).
The second parameter (1) is the token we want to use.
And, the first is the text we're examining.
So, if we look at your snotice:
[18:50:47] -chat.psionics.net- Martine(~Martine@ool-435221b7.dyn.optonline.net) is doing a /whois on you.
Then, the $1 is the actual notice (that doesn't include the timestamp or the person who noticed you).
So, $1 is:
Martine(~Martine@ool-435221b7.dyn.optonline.net) is doing a /whois on you.
If we break it apart at the $chr(40)'s, then we get 2 tokens:
~Martine@ool-435221b7.dyn.optonline.net) is doing a /whois on you.
We want token #1 (Martine).
I hope that makes sense to you.
As a final note, whatever $chr you are breaking your tokens apart at will *not* be included anywhere in your final ouput. Just like with words, you split them at the spaces and the spaces are not attached to the words after you split the sentence up... you just have words. That's why you don't see a ( on the two tokens above.