TravisT commented on a Page, INPUT  -  Jan 07, 2009

lol, actually $iif is a bit slower than using if.

I was going to suggest not checking the comparison twice.

if (!$2) mode $chan +o $me
else { mode $chan +o $2 }

but safer to say ...

if ($2 ison $chan) { mode $chan +o $2 }
else { mode $chan +o $me }

I, however, prefer the method stated with the regex. One line that handles all modes. :)

on *:input:#:{
if ($1 == .m) { var %m2 = $iif($3 ison $chan,$3,$me) | mode $chan $2 %m2 }
elseif ($1 == .k) && ($2 ison $chan) { kick $chan $2 $3- }
}

example:
.m +v nickname

Does require more to type though.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.