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
Jughead
Newbie


Joined: 07 Oct 2004
Posts: 5

PostPosted: Thu Jan 06, 2005 3:39 pm   

Hitpoint monitor
 
heyo folks,

I've had a look through the help files and given it my best shot, but I've completely failed to work out how to get zMUD to give me a damage readout.

I've seen logs online that have people getting a message from zMUD telling them how much damage an attack has given them. The MUD I play has a constant Hitpoint monitor during combat that looks like this:

Hp: 1583 (1605) Gp: 280 (280) Xp: 164072

Where the '(1605)' is my maximum hitpoints.

What I'm talking about is setting zMUD to display the 'damage' I've received since the last round of attacks, between monitor outputs.

for example:

Hp: 1583 (1605) Gp: 280 (280) Xp: 164072
Damage - 22

Is anyone able to help me out with this?

Jughead
Reply with quote
misterbalrog
Apprentice


Joined: 26 Oct 2004
Posts: 108

PostPosted: Thu Jan 06, 2005 4:14 pm   
 
#tr {Hp: &hp ~(&hpmax~) Gp: (%d) ~((%d)~) Xp: (%d)} #echo Damage: %eval( @hp-@oldhp) (at %eval( (@hp*100)/@hpmax)~%)
;#var oldhp @hp}

Code:

Hp: 183 (1605) Gp: 280 (280) Xp: 164072
Damage: 0 (at 11%)
Hp: 153 (1605) Gp: 280 (280) Xp: 164072
Damage: -30 (at 9%)
Hp: 123 (1605) Gp: 280 (280) Xp: 164072
Damage: -30 (at 7%)
Hp: 83 (1605) Gp: 280 (280) Xp: 164072
Damage: -40 (at 5%)
Reply with quote
Jughead
Newbie


Joined: 07 Oct 2004
Posts: 5

PostPosted: Thu Jan 06, 2005 4:25 pm   
 
I've saved that into zMUD, it doesn't, however, appear to be working. I get a black line under my hitpoint monitor and that's it.
Reply with quote
Jughead
Newbie


Joined: 07 Oct 2004
Posts: 5

PostPosted: Thu Jan 06, 2005 4:35 pm   
 
Wait, sorry. I'm getting the message like 'Damage: (at 100%)' but even when I've received damage, I'm not getting a readout as to how much. eg: Damage: -30 (at 9%)


What am I missing?

Jughead
Reply with quote
misterbalrog
Apprentice


Joined: 26 Oct 2004
Posts: 108

PostPosted: Thu Jan 06, 2005 5:34 pm   
 
That's very weird. The only reason it wouldn't display anything would be if the neither of the variables hp or oldhp would be set. But if it triggers off the pattern, then hp will be automatically set, and then it should display atleast a value.

Thus, could you check if the variables hp, oldhp and hpmax are set?

If not, you could change the &hp and &hpmax into (%d)'s and in the code prior to the #echo type out:
#var hp %1
#var hpmax %2

If it still is not firing off, but only showing the "Damage: ". I don't really know.. I can't reproduce it.
Reply with quote
Jughead
Newbie


Joined: 07 Oct 2004
Posts: 5

PostPosted: Thu Jan 06, 2005 5:44 pm   
 
Hmm, none of those variables are set that I can see. What do they need to be?
Reply with quote
misterbalrog
Apprentice


Joined: 26 Oct 2004
Posts: 108

PostPosted: Thu Jan 06, 2005 5:55 pm   
 
oki, change the trigger pattern then as I recommended above.

Cuz the variables hp and hpmax should be set automatically through the trigger, but apparently, smth's not set correctly for that to work.

So try with (%d)'s instead of the &hp and &hpmax in the pattern, etc. etc.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Fri Jan 07, 2005 5:00 am   
 
I Recently posted a script to the finished scripts forum that does pretty much exactly this.
copy and paste one of these version into your command line and hit enter

#NOOP ECHO Version
#TR {Hp: (%d) ~(%d~) Gp: %d} {
prompt.hpc=%eval(@prompt.hp-%1)
prompt.hp=%1
#ECHO Damage @prompt.hpc
} "" {prompt|nocr}


#NOOP Inline Prompt version
#TR {Hp: (%d) ~(%d~) Gp: %d} {
prompt.hpc=%eval(@prompt.hp-%1)
prompt.hp=%1
#PSUB {%1/@prompt.hpc} %x1
} "" {prompt|nocr}
_________________
Zmud Support Library
Zmud Knowledge Base
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