mIRC Home    About    Download    Register    News    Help

Print Thread
#185259 07/09/07 05:40 AM
Joined: Apr 2006
Posts: 464
O
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
I found this snippet on one of the scripting sites.
All credits for it go to the original author.

Code:
; simple alias that introduces a technique of $regsubex :)
; $rpass(N,A,Z) returns a random password of length N from a range of characters A to Z
; eg $rpass(10,c,z) gives ccrfxmnted

alias rpass return $regsubex($str(a,$1),/a/g,$r( [ $2, $3 ] ))


And it's working briljantly.
But I would like to add numeric support, so include 0-9.
Does anyone know how that can be done?

Thx in advance!

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Code:
alias rpass return $regsubex($str(a,$1),/a/g,$+($r( [ $2, $3 ] ),$r( [ 0, 9 ] )))

Joined: Apr 2006
Posts: 464
O
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
Wonderfull smile

Thanks a lot!

Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
ooh i remember that laugh


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde

Link Copied to Clipboard