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


Joined: 21 Nov 2001
Posts: 2
Location: France

PostPosted: Wed Nov 21, 2001 1:37 pm   

question on random selection from a list
 
I am trying to generate at random different ways to speak.
I dont want to scrumble the content, neither color it, but use different emotes.
So I want to choose from a list (say, sing, whisper, announce,...) randomly one each time I type say xxx
I did the aliases for each command of the list and the following for the random generation:

%case(%random( 4) , "say" , "sing" , "whisper" , "announces" )

The problem is, randomly it sents only the string I want to say to the mud without the command before (which of course generates the mud error response)

where is my command wrong?
Reply with quote
Acaila
Apprentice


Joined: 30 Aug 2001
Posts: 187
Location: Netherlands

PostPosted: Wed Nov 21, 2001 2:09 pm   
 
The following should work:

First create a list of the type of says you want to choose from:

#VAR List {say|whisper|yell|mutter|sing|announce}

Then use an alias to replace your speech:

#ALIAS randomsay {%item( @List, %random(1, %numwords( @List, "|"))) "%-1"}

This my 100th post btw!

Acaila
Reply with quote
thalura
Newbie


Joined: 21 Nov 2001
Posts: 2
Location: France

PostPosted: Wed Nov 21, 2001 4:25 pm   
 
works fine, thanks a lot
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