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
ezgoezit
Newbie


Joined: 21 Jul 2006
Posts: 2

PostPosted: Fri Jul 21, 2006 7:42 pm   

Random (but not back to back) alias question
 
I am having difficulty creating an alias that calls up a random fighting technique without repeating the last one called. I have made an alias that calls up the random technique, but I am having trouble figuring out how to make sure the same technique is not called up back to back. Does anyone have any advice for this issue? My current alias follows:


#var ComboList{axekick|backfist|charge|crescentkick|disarm|elbow|firekick|flamingpunch|frostpunch|gouge|grapple|hammerfist|headbutt|hurl|icekick|jumpkick|kick|knee|knifehand|lightningkick|lunge|palmstrike|phantompunch|punch|ridgehand|rip|roundhouse|shadowkick|shockpunch|slidekick|snapkick|spearfinger|spinkick|stomp|sweep|thrustkick|trip}
%item( @ComboList, %random( 1, %numwords( @ComboList, "|"))) "%-1"
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Jul 21, 2006 10:23 pm   
 
#VAR LastSelect {@Selected}
#WHILE {@Selected=@LastSelect) {#VAR Selected {%iitem(@ComboList,%random(1,%numitems(@ComboList)))}}
#EXECUTE {@Selected %-1}

That should about handle it.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
ezgoezit
Newbie


Joined: 21 Jul 2006
Posts: 2

PostPosted: Sat Jul 22, 2006 12:36 am   
 
Thanks, I appreciate it. For some reason, I am still getting the same technique twice in a row sometimes and I am wondering if it is because I am doing sets of
15 of my alias that calls the random stance.
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