There are probably many Defname or RSN scripts on Hawkee, but that doesn't bother me.
I just got my computer back, and felt like scripting on mIRC again, so I brushed up what I still remembered and made this script for my RuneScape Classic bot.
You can also use this script for WoW or CoD if you switch around the text a little.
My code entirely, if that means anything anymore.
Edit(3 minutes after post:) I saved the RSN's under $nick instead of $address so you could look up RSN's for nicks with !rsn
PS: I smoke a lot of pot.
;;Alias for Colors, Logo, and Bold text (Need this for script to work!!)
Alias c1 return $+($chr(3),01,$1-)
Alias c2 return $+($chr(3),02,$1-)
Alias B return $+($chr(2),$1-)
Alias logo return $+($c1($chr(40)),$c2($1-) $+ $c1($chr(153)),$c1($chr(41)))
;;Start of Defname script.
On $*:Text:/^[!.](Defname)/Si:#: {
if (!$2) && (!$readini(Defnames.ini,RSNs,$nick)) { notice $nick $logo(Error) $c1(Missing argument. Proper syntax:) $+($c1([),$c2(!.),$c1(]),$c2(Defname)) $c1($b(Username) $+ .) | halt }
if (!$2) && ($readini(Defnames.ini,RSNs,$nick)) {
notice $nick $logo(Defnames) $+($c1("),$c2($replace($readini(Defnames.ini,RSNs,$nick),_,$chr(32))),$c1(")) $c1(has been) $c2(deleted) $c1(from your nick) $+($c1("),$c2($nick),$c1(. $+ "))
remini Defnames.ini RSNs $nick
halt
}
Else {
if ($count($1-,$,%,#,^,&,*) > 0) { notice $nick $logo(Error) $c1(Illegal Characters.) halt }
if ($len($2-) <= 12) && ($len($2-) >= 1) {
writeini Defnames.ini RSNs $nick $replace($2-,$chr($chr(32)),$chr(95))
notice $nick $logo(Defnames) $+($c1("),$c2($replace($readini(Defnames.ini,RSNs,$nick),_,$chr(32))),$c1(")) $c1(has been registered to your nick) $+($c1("),$c2($nick),$c1(")) $c1(as your) $c2(RuneScape Classic) $c1(username.)
halt
}
Else { notice $nick $logo(Error) $c2(RuneScape) $c1(usernames can hold a maximum of only) $c2(12) $c1(characters.) }
}
}
;;Start of the Privacy option of the script.
On $*:Text:/^[!.](Privacy On)/Si:*: {
if ($readini(Defnames.ini,RSNs,$nick)) {
writeini Defnames.ini RSNs $nick Private
notice $nick $logo(Defnames) $c1(Your) $c2(RuneScape Classic) $c1(username is now) $c2(Private.) $c1(To undo this, type) $+($c1([),$c2(!.),$c1(]),$c2(Defname)) $c1($b(Username) $+ .)
}
}
;;Start of the RSN portion of the script.
On $*:Text:/^[!.@](Rsn)/Si:#: {
if (!$2) && (!$readini(Defnames.ini,RSNs,$nick)) { notice $nick $logo(Error) $c1(You do not have a registered) $c2(RuneScape Classic) $c1(username. To register one, type) $+($c1([),$c2(!.),$c1(]),$c2(Defname)) $c1($b(Username)) | halt }
if (!$2) && ($readini(Defnames.ini,RSNs,$nick)) { $iif($left($1,1) == @,msg $chan,notice $nick) $logo(Defnames) $+($c1("),$c2($replace($readini(Defnames.ini,RSNs,$nick),_,$chr(32))),$c1(")) $c1(is your registered) $c2(RuneScape Classic) $c1(username.) | halt }
if ($len($2-) <= 12) && ($len($2-) >= 1) && ($count($1-,$,%,#,^,&,*) == 0) {
if ($readini(Defnames.ini,RSNs,$2-)) {
$iif($left($1,1) == @,msg $chan,notice $nick) $logo(Defnames) $c1(The) $c2(RuneScape Classic) $c1(username for) $+($c1("),$c2($2-),$c1(")) $c1(is) $+($c1("),$c2($replace($readini(Defnames.ini,RSNs,$2-),_,$chr(32))),$c1(. $+ ")) | halt }
elseif (!$readini(Defnames.ini,RSNs,$2-)) {
$iif($left($1,1) == @,msg $chan,notice $nick) $logo(Error) $c1(There is no) $c2(RuneScape Classic) $c1(username stored for) $+($c1("),$c2($2-),$c1(. $+ ")) | halt }
}
}