Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Fyllo Theos
Newbie


Joined: 11 Apr 2005
Posts: 1

PostPosted: Mon Apr 11, 2005 8:53 pm   

Help with exec command
 
I am making an alias to create a random password using all alpha and numeric values. The password is between 5 and 8 characters long, this is what I have so far:

The list of alpha and numeric characters:
#VAR list_alphadigit {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|1|2|3|4|5|6|7|8|9|0}

The alias to create a random digit from the above list:
#ALIAS random_character {%item( @list_alphadigit, %random( 1, %numitems( @list_alphadigit)))}

The alias to create a new password:
#ALIAS create_password {#VAR new_password {%repeat( %exec( random_character), %random( 5, 8))}}

The problem with what I currently have is that the %repeat command will only repeat the value of the random_character alias. This causes me to get values such as "aaaaa" and "4444444". I cannot seem to figure out how to make it execute the alias 'random_character' each time it repeats it, instead of just repeating the same value.

Any ideas or suggestions?
Reply with quote
Kiasyn
Apprentice


Joined: 05 Dec 2004
Posts: 196
Location: New Zealand

PostPosted: Mon Apr 11, 2005 9:10 pm   
 
#ALIAS create_password {new_password = "";#loop %random(5,8) {new_password = %concat(@new_password,%random(1,%numitems(@list_alphadight)))}}

didnt test this i hope it helps
_________________
Kiasyn
Owner of Legends of Drazon
Coder on Dark Legacy
Check out Talon, an easy IMC connection.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Mon Apr 11, 2005 10:21 pm   
 
Couple of fixes
#ALIAS create_password {new_password = "";#loop %random(5,8) {new_password = %concat(@new_password,%item(@list_alphadigit,%random(1,%numitems(@list_alphadigit))))}}
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net