Shouldn't that be
if $($+(%,varcheck,.,$nick($1,%i)),2) {
?
I assume you want %varcheck.nickname
Since you are using $nick($1,%i) several times in the while loop, I'd be tempted to make it a var:
while () {
var %nick = $nick($1,%i)
...
}
and then use %nick anywhere you have that $nick() construct. Makes it slightly more self-documenting, too
