alias nick / network based

Release your script here.
State:
- Author
- What it does
- Perhaps a little guide.
- Also, if the snippet is of any use to the community, it has a chance of getting posted on the main page, so don't hesitate to submit/ask!

alias nick / network based

Postby Cristian » Fri May 02, 2008 10:43 pm

This script helps you selecting your nickname.
If the nick is taken, it will tell.
If you try to change your nick, into a nick that exceeds the max limited nick possible on the network, it will tell.
This works on a clean install of mIRC v6.3, please report bugs and errors here, updates will also be posted here.

Tested and works on version 6.15

Code: Select all
alias nick {
  if ($1) {
    var %nicklen = $len($1)
    if (%nicklen > $eval($+(%,::,maxnicklen.,$network),2)) {
      echo -ti2c notify $active Error: Max nick length exceeded. Max nick length is $+($chr(2),$eval($+(%,::,maxnicklen.,$network),2),$chr(2),.)
      echo -ti2c notify $active You are trying to change nick to $+($chr(2),$1,$chr(2)) which is $+($chr(2),%nicklen,$chr(2)) characters long.
      echo -ti2c notify $active Short it down with $+($chr(2),$calc(%nicklen - $eval($+(%,::,maxnicklen.,$network),2)),$chr(2)) characters.
    }
    else { .set %ison $1 | .ison $1 }
  }
}
raw 303:*: { if ($2) { echo -ti2c notify $active Error: Nickname is not available. } | else { .raw nick $+(:,%ison) } | .unset %ison | haltdef }
raw 005:*: { if ($gettok($matchtok($1-,MAXNICKLEN=,1,32),2,61)) { set %::maxnicklen. $+ $network $ifmatch } }
Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar

Return to Mirc Scripting Release

Who is online

Users browsing this forum: No registered users and 0 guests

cron