Yes, it would... you have your $rand statement to retrieve a number. Then your $nick($chan(this is now the random number to mIRC))...wont re-identify only the "regular" nicks.
It sets a random number here ~~> $rand(1,$nick($chan,0,r))) then when mIRC sees the statement as a whole like this ~~> $nick($chan,$rand(1,$nick($chan,0,r))) it is referring to that random number that was made from only the total number of registered names on the channel, then finds that line number in the
full nicklist, and returns that name. If that random number happened to be a 1 then it would return the top name in the full list... i.e. an op.
Try this:
/randnick {
:start
if ($nick($chan,0,r) > 0) {
var %a = $rand(1,$nick($chan,0))
if ($nick($chan,%a) isreg $chan) return $nick($chan,%a)
else goto start
}
}
Then where you have your call to $randnick you will want to write it so that it states...
if ($randnick) { then do this }
Otherwise, if there are no regular nicks in the channel, $randnick will be an empty string, and you will get an error.