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


Joined: 11 Oct 2002
Posts: 29
Location: Sweden

PostPosted: Sun Aug 09, 2020 10:35 am   

Need help to trigger this line
 
Hi

I want to trigger on following line:

Takke [party]: Hp: 4198/(4242) [-44] Sp: 971/(971) [+0] Ep: 4336/(4380) [-6]

I want to store the values in variables. I have a problem with the [-44]. I want to store that in a variable, lets say

#var minusregen

and change the color to hi-green

and the if it's a positive value i want to store it in a variable, lets say

#var plusregen.

Can anyone help me with this? The Hp, Sp and Ep values i can trigger but not the values in the []

Thanks in advance.
Reply with quote
shalimar
GURU


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

PostPosted: Mon Aug 10, 2020 4:13 pm   
 
%n will capture signed (+/-) numbers.

~[(%n)~]

If it can be either signed or unsigned you will need something like:

~[({%d|%n})~]
_________________
Discord: Shalimarwildcat
Reply with quote
takke
Beginner


Joined: 11 Oct 2002
Posts: 29
Location: Sweden

PostPosted: Mon Aug 10, 2020 6:55 pm   
 
Thanks, worked like a charm. Have never seen %n anywhere.

If i now want to change the color of that [] value, how would you go about that?
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 167

PostPosted: Mon Aug 10, 2020 8:39 pm   
 
Like green for + value and red for - to reflect dmg vs healing?

#CW
%color()

are the things to use.
Reply with quote
shalimar
GURU


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

PostPosted: Mon Aug 10, 2020 9:26 pm   
 
#TR {~[(%n)~]} {#IF (%1>0) {#CW green} {#CW red}}

You would want to enter that on the command line, then go into the settings editor and make sure the 'repeat within line' option is checked on the bottom panel of the trigger.
_________________
Discord: Shalimarwildcat
Reply with quote
takke
Beginner


Joined: 11 Oct 2002
Posts: 29
Location: Sweden

PostPosted: Tue Aug 11, 2020 9:26 am   
 
Thank you guys :)
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