Password Generator
Platform: mIRC
Published Jan 03, 2011
Updated Jan 03, 2011
Generates a hexatridecimal password for you. If you don't specify a length, it defaults to 20 characters, but you can choose anything up to 100. Obviously it's not hugely secure, because it's possible using a debug output to view the password being sent, but I've attempted to make it as secure as possible by using .notice as opposed to /notice or even /msg.
Oh and also, you need to add this to your variables:
%passgen A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9
Example:
[19:33:19] <~Matt> !passgen
[19:33:19] <~JellyFish> Generating a 20 digit hexatridecimal password for Matt...
[19:33:20] -JellyFish- Password Generated: IVG70R4QNUB27RECKHIV
Or, if you choose the length:
[19:41:34] <~Matt> !passgen 40
[19:41:34] <~JellyFish> Generating a 40 digit hexatridecimal password for Matt...
[19:41:34] -JellyFish- Password Generated: SMZF3YFI3J7TF115S1U7XJ0HWFL4LH2MY4JBH2D3
on *:TEXT:!passgen*:#:{
if (!$2) {
var %inc = 0
var %pass = $gettok(%passgen,$rand(1,$numtok(%passgen,32)),32)
msg # Generating a 20 digit hexatridecimal password for $nick $+ ...
while (%inc <= 19) {
var %pass = $instok(%pass,$gettok(%passgen,$rand(1,$numtok(%passgen,32)),32),$len(%pass),15)
inc %inc 1
if (%inc == 19) {
.notice $nick Password Generated: %pass
}
}
}
if ($2) && ($2 isnum) {
if ($2 <= 100) {
var %inc = 0
var %pass = $gettok(%passgen,$rand(1,$numtok(%passgen,32)),32)
msg # Generating a $2 digit hexatridecimal password for $nick $+ ...
while (%inc <= $calc($2 - 1)) {
var %pass = $instok(%pass,$gettok(%passgen,$rand(1,$numtok(%passgen,32)),32),$len(%pass),15)
inc %inc 1
if (%inc == $calc($2 - 1)) {
.notice $nick Password Generated: %pass
}
}
}
else {
msg # A $2 character long password would crash $me $+ . Generate something under 100 characters.
}
}
}