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
m59gar
Beginner


Joined: 19 Aug 2021
Posts: 14

PostPosted: Mon Dec 11, 2023 10:17 am   

How do I expand a variable within #TRIGGER's patterns and commands?
 
So, trying to use #TRIGGER to create triggers, it takes everything literally. What I want to do is something like this -

I have a variable called @PatternText and a variable called @CommandText

I want to #TRIGGER {@PatternText} {@CommandText}

But when I do this, the trigger is *literally* @PatternText, triggering literally @CommandText, which is of course useless. I want the contents of those variables to make up the pattern and commands. How do I do that?
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 168

PostPosted: Thu Dec 14, 2023 4:38 am   
 
using () should expand the variable if i recall correctly... but why you want todo this escapes me.
Reply with quote
shalimar
GURU


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

PostPosted: Thu Dec 14, 2023 5:37 pm   
 
To use a variable in the pattern just wrap the variable in an extra set of curly brackets.

#TR {test pattern looking for a member of ({@stringList})} {#SAY %1 is the specific item in the list}


You are likely experiencing an issue of the command line evaluating your variables. This can be alieviated by making/editing your triggers via the GUI.
_________________
Discord: Shalimarwildcat
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