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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Izulien
Newbie


Joined: 24 Jul 2012
Posts: 9
Location: United States

PostPosted: Sat Aug 11, 2012 9:17 pm   

Pulling a single string from a String List Variable
 
This should be a super simple option but I'm apparently just missing it completely.

I would like to pull a simple string out of my string list variable to send to the mud in a triggered event.

In this case I would like to have a randomized yell in certain events.

I could do this as a simple trigger using #CASE and manually putting my yells in but I will most likely be constantly adding/removing yell options/phrases and thus using a variable will make things easier.

#var AmazingYell {Oh yeah|Boo-yah|I am the best around}
#trigger {You do something amazing}{yell %random(@AmazingYell)}

Then when I do something amazing I'll simply yell one of my amazing yells.

Obviously the above doesn't function properly but it is the basics of what I would like to do.

Currently I would have to use
#trigger {You do something amazing}{yell #case %random {Oh Yeah} {Boo-yah} {I am the best around}}
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4671
Location: Pensacola, FL, USA

PostPosted: Sat Aug 11, 2012 9:35 pm   
 
%item(@amazingyell, %random(1, %numitems(@amazingyell)))
You can access the help file with:
#help %random
_________________
Discord: Shalimarwildcat
Reply with quote
Izulien
Newbie


Joined: 24 Jul 2012
Posts: 9
Location: United States

PostPosted: Sat Aug 11, 2012 10:11 pm   
 
Item! Gah I couldn't figure that out. This is why you my friend are the Wizard and I am yet a newb. I shall attempt this and will get back to you if this doesn't work out ;)

Edit:

After testing this worked perfectly. I'm also glad you thought of the item number as well so I can continually add/remove items from the list!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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