Replace nick with correct case

By TMFKSOFT on Jun 28, 2011

This is a simple snippet for your bot,
It will output the user nick in the correct casing.
If the user is not in the channel it will return as requested.

Example:
The users IlkoTech, User and Bot are in the channel

!slap UseR * Bot slaps User The bot would simply need this snippet loaded and in its script on *:TEXT:!slap *:#:{ describe slaps $nickc($2) } No matter what casing the user uses it will always return the correct casing. If a user isnt in the channel it will just return the normal text, Same example as above: The users IlkoTech, PersON and Bot are in the channel !slap PersOn * Bot slaps PersON I hope that helps. ```mirc alias nickc { if ( $1 ison $chan ) { var %times $nick(#,0) var %i = 1 while (%i <= %times) { if ( $nick(#,%i) == $1 ) { var %nick $nick(#,%i) } inc %i } return %nick } else { return $1 } } ```

Comments

Sign in to comment.
[Plornt]   -  Jun 29, 2011

Also like to point out your last example is wrong :P

but nice snippet none the less (Even though I did come here to say what jaytea had said with the $nick alias xD)

 Respond  
jaytea   -  Jun 29, 2011

a unique idea, but keep in mind that $nick() itself can resolve ordinals (values of N it takes as input) from nicknames case sensitively, so to get the correct casing you can simply use $nick(#, $nick(#, $1))

 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.