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
LEit
Novice


Joined: 27 Jul 2002
Posts: 38
Location: USA

PostPosted: Sun Jul 28, 2002 12:38 am   

Trigger on a variable
 
I want to execute a trigger on a string I've collected in a variable. Is there some way to do that?

Here's an example of the string:
It improves intelligence and wisdom slightly. However, it worsens armor considerably.

Here's the trigger:
({enhances|improves|worsens|hampers}) (*) ({slightly|somewhat|considerably|strongly|incredibly})

#if ("%2" =~ "intelligence") {#ADDKEY Item {IntBonus=%1 %2}}
#if ("%2" =~ "wisdom") {#ADDKEY Item {WisBonus=%1 %2}}
#if ("%2" =~ "armor") {#ADDKEY Item {ACBonus=%1 %2}}


What I want to do is catch the amount, and direction and what it helps/hurts.
Reply with quote
LEit
Novice


Joined: 27 Jul 2002
Posts: 38
Location: USA

PostPosted: Sun Jul 28, 2002 12:40 am   
 
It's in a variable because the acutal mud output will span several lines, so I've gathered them all into one variable.
Reply with quote
LEit
Novice


Joined: 27 Jul 2002
Posts: 38
Location: USA

PostPosted: Sun Jul 28, 2002 1:09 am   
 
I found a way to do it:
#echo @specials

I needed to make a few changes to the trigger to get it to work
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