Another simple script, /genpass will generate a random password of random length(length between 8 and 64) and send it to the mkpasswd command, which is handy for oper blocks.
randgen just makes the random string, and I use it for a variety of functions.
Edit: added the nsreg alias. Replace "YOUR_EMAIL@EMAIL.COM" with your email.
nsreg: Generates a random password, passes the random password to NickServ, and prints an auto-identify script for lazy people, which goes in your " on *:connect: { " event. :p
alias genpass {
if ($1 == $null) echo Syntax: /genpass [password length [encryption method [mkpasswd to server?]]]
var %pw $randgen($1)
var %mkp
if ($3 == -n) %mkp = 0
else %mkp = 1
echo -g Random password: %pw
if ($2 == $null) {
echo -g sha1 hash: $sha1(%pw)
if (%mkp == 1) mkpasswd sha1 %pw
}
elseif ($2 == sha1) {
echo -g sha1 hash: $sha1(%pw)
if (%mkp == 1) mkpasswd sha1 %pw
}
elseif ($2 == md5) {
echo -g md5 hash: $md5(%pw)
if (%mkp == 1) mkpasswd md5 %pw
}
else {
echo Unsupported hash/encryption method specified.
if (%mkp == 1) mkpasswd $2 %pw
}
}
alias nsreg {
if ($1 == $null) echo Syntax: /nsreg [password length]
var %pw $randgen($1)
echo Random password: %pw
msg NickServ register %pw YOUR_EMAIL@EMAIL.COM
echo -g if ( $+ $chr(36) $+ server == $server $+ ) $chr(123)
echo -g msg NickServ identify %pw
echo -g $chr(125)
}
alias randgen {
var %x $iif($1 == $null,$rand(8,64),$1)
var %y
while (%x) {
%y = %y $+ $iif($rand(1,34) <= 24, $iif($rand(1,0) == 1, $rand(A,Z), $rand(a,z)), $rand(0,9))
dec %x
}
return %y
}