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


Joined: 25 Apr 2001
Posts: 4
Location: USA

PostPosted: Fri May 03, 2002 10:53 am   

Question with multiple random randoms
 
Basically, I'm trying to set up a random trigger, and it works well except that it occasionally uses the same line multiple times.

Is there anyway to set a if or something to check if its used a certain part of an alias? Or am i going about this all wrong.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Fri May 03, 2002 1:28 pm   
 
One way to go about this is to create a copy of the possible lines. Then, when the trigger fires, you randomly select one, do whatever you need with it, and then delete it from the list of copies. Next time the trigger fires, you do the same thing again, but all lines that have already been selected, are not eligible since they have been deleted from the list. Once the list of copies goes empty, you fill it once more from the original. If you want some lines to appear more than once in each "cycle", just put it more than once in the list of possibilities.

Notice that this is all very general, since I don't know any specifics about your script, but this should get you going.

Kjata
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