Just like you show it... though you are checking if it's "Off" there, but in the script, that's being checked with $nick... something seems strange there.

Btw, *use* parentheses. It makes things easier to read.