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
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Fri Dec 05, 2008 4:37 pm   

tokens
 
On the mud a play there are several classes you can change into, and can do so on they fly whenever. So my hp/mp values change alot depending on my class. I was wondering if there was a way cmud can read tokens?
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri Dec 05, 2008 6:32 pm   
 
What do you mean by "read tokens". Can you give a specific example showing the text from the MUD that you want to capture?
Reply with quote
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Sat Dec 06, 2008 3:51 am   
 
What my hpbar looks like------
HP: 12834/17220 SP: 1144/2278 TNL:49438235 AP:109375 AFF:(None)

These are the tokens i use to make it look that way-------
HP:$$tok_hp$$/$$tok_maxhp$$ SP:$$tok_sp$$/$$tok_maxsp$$ TNL:$$tok_xpfl$$ AP:$$tok_apusable$$ AFF:$$tok_shortstatus$$

Basically what i want to do is make cmud read these tokens for the current/max hp value so i don't have to change the variable every time my max hp changes.
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sat Dec 06, 2008 4:29 am   
 
Use a trigger with wildcards to read the text. Eg:

#trig {HP: (%d)/(%d) SP: (%d)/(%d) TNL:(%d) AP:(%d)} {#say I have %1 of %2 HP, %3 of %4 SP, %5 TNL and %6 AP.}
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Sat Dec 06, 2008 3:45 pm   question
 
Ok i tried reading the helpfile and i am a little confused. I understand how the wild cards are trying to work in this instance, but i will say how i am understanding so i have it right.

#trig {HP: (%d)/(%d) SP: (%d)/(%d) TNL:(%d) AP:(%d)} {#say I have %1 of %2 HP, %3 of %4 SP, %5 TNL and %6 AP.}

Basically with that trigger your telling the mud client what your hp bar looks like so basically all of this is typed how my hpbar should look like but in place of any of the number values you put %d. But as far as the 1%, 2% ect..How are those given value cause i executed the trigger and where all the percents are there's blank spaces.

Oh and thanks for the wild card link that is what i was looking for i just don't quite understand it yet, and sorry for all the questions the past few days i haven't done any of this stuff in a year or two.
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Dec 07, 2008 6:32 am   
 
The numbers come from when you actually match a line of text. If there's no text to match when the trigger is executed, all the variables will be blank.

Use a #SAY command with some practice text equal to what your prompt is. This will cause the trigger to match your #SAY prompt and this in turn will cause your trigger to print its own #SAY breaking it down for you.
_________________
EDIT: I didn't like my old signature
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sun Dec 07, 2008 2:00 pm   
 
Mmm, they're numbered from where their opening bracket is. So the first () is %1, the second () is %2 and so on.

#say "HP: 12834/17220 SP: 1144/2278 TNL:49438235 AP:109375 AFF:(None)"

Will show you the trigger working.
_________________
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