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


Joined: 12 Mar 2003
Posts: 37

PostPosted: Sat Mar 22, 2003 2:54 am   

Can't use a conditional to parse the prompt
 
I know this is my problem, not zMUD's.

When I'm not hurt the prompt is:

[BP FULL Ftg 51 MP 27]

When I am hurt the prompt is:

[BP 24 Ftg 39 MP 27]

I am trying to use CPPIG to graphically monitor my Body Points, Fatigue, and Magic Points, but it's not updating. My trigger is:

~[BP (*) Ftg (%d) MP (%d)~]

and it fires when the prompt appears, but my variables are not updating. The Value I have for this trigger is:

#VA @hp %1
#VA @Ftg %2
#VA @MP %3

I get the @maxhp and other max values from a stat command, and those variables are set correctly. Where am I messing up?
Thanks
Reply with quote
Feanor
Novice


Joined: 12 Mar 2003
Posts: 37

PostPosted: Sat Mar 22, 2003 2:56 am   
 
PS Sorry about the title of this thread, I was half way into it when I realized I had a more fundamental problem here. I'll get to my conditional issue next.
Reply with quote
Feanor
Novice


Joined: 12 Mar 2003
Posts: 37

PostPosted: Sat Mar 22, 2003 3:33 am   
 
After reviewing some of my other variable triggers I changed this:

#VA @hp %1
#VA @Ftg %2
#VA @MP %3

to this:

#VA hp %1
#VA Ftg %2
#VA MP %3

It still doesn't work.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Sat Mar 22, 2003 3:36 am   
 
Syntax issue:

#VA hp %1
#VA Ftg %2
#VA MP %3

#SH The value of hp is @hp



Ton Diening
Reply with quote
Feanor
Novice


Joined: 12 Mar 2003
Posts: 37

PostPosted: Sat Mar 22, 2003 3:44 am   
 
Right. Thank you.

Now to my original problem.

When the prompt says FULL I can't seem to figure out how to use a conditional to replace that FULL with the value of maxhp. Do I use the #SH to do that? I'll give it a shot and post back.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Mar 22, 2003 3:57 am   
 
Since this is a prompt trigger, make sure you have the correct setting for Trigger on. Usually that's Prompt checked, Newline unchecked. To set hp to @maxhp when BP = FULL:

#IF (%1 = "FULL") {#VAR hp @maxhp} {#VAR hp %1}

LightBulb
Advanced Member
Reply with quote
Feanor
Novice


Joined: 12 Mar 2003
Posts: 37

PostPosted: Sat Mar 22, 2003 4:04 am   
 
That did it, thanks Lightbulb.

I must've been reading the help file wrong. I swear it said to use commas to delimit the contidions on the #IF statement......
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Mar 22, 2003 5:31 pm   
 
Commas are used to delimit the fields of the %if function, which is different from the #IF command. It provides another possible solution. In this case, #MATH is used in place of #VAR because the expression must be evaluated.
#MATH hp {%if( %1 = "FULL", @maxhp, %1)}

LightBulb
Advanced Member
Reply with quote
virtuous
Wanderer


Joined: 08 Jan 2003
Posts: 60

PostPosted: Wed Mar 26, 2003 7:27 am   
 
If you have Echo Commands on, that's fine. If you have Echo Commands off, you'll want your prompt trigger to be Prompt and Newline both, because you will get some information on the same line as the prompt instead of after it, because your MUD assumes that you have command echoing on.
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