Generates a random password with options like the amount of characters and inclusion of lowercase, uppercase, and numeric characters.
syntax: /newpass <y/n for lowercase> <y/n for uppercase> <y/n for numbers>
stop by #Savage_CL on SwiftIRC and let me know what you think :)
;Random password generator
;By Savage_CL
;support found on swiftIRC in #Savage_CL
;connect command: /server -m irc.swiftirc.net -j #savage_CL
alias newpass {
if ($1 !isnum) || ($4 == $null) { echo -a you must specify a number of characters and character params. | echo -a Syntax: /newpass <characters> [y/n for lowercase letters] [y/n for Uppercase letters] [y/n for numbers] | return }
if ($left($$2,1) != y) && ($left($$3,1) != y) && ($left($$4,1) != y) { echo -a You can't have a $$1 character password without any available characters! | return }
var %temp 1
while (%temp <= $$1) {
var %thing $rand(1,3)
if (%thing == 1) && ($left($$2,1) != n) { var %pass %pass $+ $rand(a,z) | inc %temp }
elseif (%thing == 2) && ($left($$3,1) != n) { var %pass %pass $+ $rand(A,Z) | inc %temp }
elseif (%thing == 3) && ($left($$4,1) != n) { var %pass %pass $+ $rand(0,9) | inc %temp }
}
echo -a Your $$1 character password is: %pass
}
thank you. I would add a limit, Jethro_, but most people are going to actually follow the rules given. This isn't something the avarage user is going to need, so I figured the ones that are going to use it are going to be smart enough to not do something like that. :P
Thanks guys for the accolades, by the way.
Oh. just thought of a fix for you, jethro_. instead of == y for the condition, i'll replace it with != n
I was fiddling around with the code and entered this:> /newpass 5 abakjsdfh akjsdfh jkasdfhand I got an endless loop 'til I broke it up. lol
Well, don't get me wrong. You could redo any script that's been done before over and over with your "colorful imagination," it'd still be great to think up something new, not generic...so that your code won't appear dull and ordinary.
So true Jethro_ it has been done many times before. It was not too long ago that a few different people posted random pass gens one after the other.
Most msl snippets have been done many times over an that is a good thing. You have to love the different takes people have on the same idea.
hmm I wonder who scored this a 10 =/ not that i am saying it is a bad snippet, but someone is way too giving to score this a 10. Maybe a 5 or a 6