 |
jtown84 Novice
Joined: 09 Oct 2007 Posts: 36
|
Posted: Fri Mar 28, 2008 11:40 am
Triggering on Expanded Variables |
Hey all, I have a simple alias that i used to sub mobs, so i can turn
| Quote: |
A squid torn apart floats motionless in the water.
|
into
| Quote: |
A bloody squid [14]
|
or Whatever the case may be.
the alias simply did
| Code: |
| #prompt MobPattern "Instructs";#prompt NewSub "Instructs" |
etc.. the alias would expand those variables and create a trigger from it..
| Code: |
#tr <@MobPattern> {#sub <@newsub>}
|
Is there a way to do the same thing in CMud?
Variables wont expand via <> and i cant find the setting like it was in zMud. |
|
|
|
 |
Larkin Wizard

Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Fri Mar 28, 2008 12:59 pm |
Put the string in a local variable and use that to create your new trigger. It's been documented in the CMUD vs zMUD changes list, I believe.
Something like this should work:
| Code: |
$MobPattern = "stuff goes here"
$NewSub = "other stuff here"
#TRIGGER {$MobPattern} {#SUB {$NewSub}} |
|
|
|
|
 |
jtown84 Novice
Joined: 09 Oct 2007 Posts: 36
|
Posted: Fri Mar 28, 2008 2:40 pm |
That worked great.. I swore i thought of that.. but i guess i never tried it.
anyways.. The only part i cant get working correctly.. is the class folder part..
Perhaps i could figure it out if i slept.. but Not in the mood yet..
| Code: |
#Prompt newmobpattern "Enter the name, EXACTLY from copy/paste"
#PROMPT mobinfo "Enter the addmob info (i.e addmob level keyword)"
#PROMPT subinfo "Enter the sub info you want to see"
#PROMPT classfolderinfo "Enter the class folder you want to add mob to or New class folder you want to put trigger into"
$newmobpattern = @newmobpattern
$mobinfo = @mobinfo
$subinfo = @subinfo
$classfolderinfo = @classfolderinfo
#trigger {$newmobpattern} {
#sub {$subinfo}
$mobinfo
} "MobSubs|$classfolderinfo"
newmobpattern = ""
mobinfo = ""
subinfo = ""
classfolderinfo = ""
|
The problem is, it creates a folder $classfolder info, I know why it does it, I cant figure out how to expand that var for it to work.. I suppose i could do #class MobSubs|$classfolderinfo, then do the trig, and then close it.. Thats 1 alternative.. if there is another let me know? |
|
|
|
 |
Larkin Wizard

Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Fri Mar 28, 2008 5:03 pm |
Try "MobSubs|"$classfolderinfo, moving the last quote so the variable is outside the quotes.
|
|
|
|
 |
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Fri Mar 28, 2008 8:00 pm |
Larkin, isn't that implicit concatenation, to be avoided? Would %concat("MobSubs|", $classfolderinfo) be better?
|
|
|
|
 |
Larkin Wizard

Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Fri Mar 28, 2008 8:36 pm |
I use it in many places, and it works fine for me. Your mileage may vary.
|
|
|
|
 |
|
|
|