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
snatch.xx
Beginner


Joined: 09 Jun 2007
Posts: 19

PostPosted: Sun Apr 06, 2008 10:31 pm   

Help with trigger/gauge please
 
I'm playing on 3-k and just switched over from portal to Cmud and I am having trouble setting up Hpbar gauges..

Sample text - Standard out of combat hpbar

HP: 268/268 PP: 266/266 Chi: 42/53 G2:2489 Mind: 0 AE:0/63% CF:N

Ok HP, PP, and Chi usual HP/SP stuff G2 is Guild xp to next lvl and mind is another combat stat.. Now AE: (0 is how many uses of the power I have and 63% is how close it is until reset ie @ 100% I get my uses back). Now CF is my chi focus and it is just represented by N|T|S, N= normal, T= thought and S= static.

Here is one part that really keeps messing me up

Sample text - When I turn on Crit and stun attacks it adds a (*) for crits and (&) for stuns at the start of my Hpbar

*&HP: 268/268 PP: 266/266 Chi: 42/53 G2:2489 Mind: 0 AE:0/8% CF:N

And the last part of my hpbar that changes is when I am in combat.

Sample text - Active combat

*&HP: 206/268 PP: 238/266 Chi: 29/53 G2:2098 Mind: 151 AE:0/54% CF:N T: Dea

At the end it adds the mob's status (T:Dea) per = perfect, bru = bruises, ble = bleeding, eme = emergency, dea = death

I would like to capture each section of the hpbar and return true values like per as perfect and on my HP would love to add the % to the gauge ...
Display something like this ( HP: 54/268 20% )

I would greatly appreiciate help with this. I have been trying a bunch of patterns trying to match this up right and having no success at all.

Thanks
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Apr 06, 2008 11:11 pm   
 
I love when people post with this amount of detail. Makes it a piece of piss to write a trigger for it:

^\*?\&?HP: (\d+)/(\d+) PP: (\d+)/(\d+) Chi: (\d+)/(\d+) G2:(\d+) Mind: (\d+) AE:(\d+)/(\d+)% CF:(N|T|S)(?: T: (Dea|Eme|Ble|Bru|Per))?$

This regex matches all the example lines you have there. If you create a new trigger in the package editor, check the Regular Expression box and paste that into the pattern, you'll be able to go onto the trigger tester tab, paste in one of those test patterns, and press "test trigger". That'll show you which of the %nn variables is which, though it should be pretty obvious - they're numbered depending on where they came in the pattern. You can then do things like:

curhp=%1
maxhp=%2

and then use the @curhp and @maxhp variables to make a HP gauge.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
snatch.xx
Beginner


Joined: 09 Jun 2007
Posts: 19

PostPosted: Mon Apr 07, 2008 12:17 am   
 
Thank you Fang I really do appreiciate it a lot. Now there are 2 small issues maby you will understand.

1 - The trigger does not fire when the (>) prompts on the line first. Some of my powers deminish over time so after wondering around I just hit hp to update my gauge but sometimes it wont because of the prompt. But in combat it is working perfectly.

2 - In the G2: 12345 that is my guild exp to next level now when it hits zero it switches from numeric to a (-) and when that happens the trigger wont fire because it is looking for a number?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Apr 07, 2008 12:38 am   
 
You didn't mention anything about a > - lines sometimes start with that? Okay, remove the ^ from the start of the pattern.

For the second bit, change G2:(\d+) to G2:([\d\-]+)
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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