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


Joined: 21 Nov 2002
Posts: 85
Location: USA

PostPosted: Mon Feb 24, 2003 7:39 am   

Displaying HMV percentage on prompt
 
Hello!

I have a trigger that when I type score, it automatically shows me my HMV stats in percentages.

I want to set it to display this WITHIN the prompt.

When I type score, the line that shows my stats:
You have 1232(1811) hit, 795(1752) mana and 1558(1599) movement points.

The prompt is like:

| 1232H 795M 1557V >

| 1232H 795M 1557V >


What I want is a percentage trigger that alters my prompt to:
| 1232H (100%) 795M (100%) 1557V(100%) >

And it can update my max hmv from the line in my score.

Can anyone please offer any help?

Muchos thanks,


Edwub the Mage

edit: I have one set up that responds when I type score, but I want the percentages viewable and updated everytime anything happens/scrolls on screen.
I already have color code too for it (ie, 100% is blue, 33 or lower is red, etc)
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Feb 24, 2003 1:05 pm   
 
#TRIGGER {You have %d~(&%d{maxhp}~) hit, %d~(&%d{maxmana}~) mana and %d~(&%d{maxmove}~) movement points.} {}
#TRIGGER {~| (%d)H (%d)M %d(V) ~>} {#SUB {%concat("| ", %1, "(", %eval((%1 * 100)/@maxhp), "%) ", %2, "(", %eval((%2 * 100)/@maxmana), "%) ", %3, "(", %eval((%3 * 100)/@maxmove), "%) >")}} "" {nocr|prompt}

Kjata
Reply with quote
Edwub
Wanderer


Joined: 21 Nov 2002
Posts: 85
Location: USA

PostPosted: Mon Feb 24, 2003 10:49 pm   
 
Kjata - You rock.
'nuff said.

=)

Thanks!



Edwub the Mage
Reply with quote
Edwub
Wanderer


Joined: 21 Nov 2002
Posts: 85
Location: USA

PostPosted: Mon Feb 24, 2003 11:22 pm   
 
Er, actually having some trouble now =(
At first I was trying my own mud color coding for a good 20 mins, wondering why it didn't work, til I remembered it's a sub.

Now I'm trying to work with colorization and having problems with I suppose the proper format.

right now i see
| 1523H(85%) 120M(6%) 1653V(98%) >
trying to make it so that all the numbers are colored.
Cyan for 100%, normal standard green for 99% to 67%.
66% to 34% is dull yellow/brown
and 33% downwards to be dark red.

I was trying to replace the mud color codes with the zmud color codes, but it doesn't work right for how i had it set up before.

Edwub the Mage
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue Feb 25, 2003 3:41 am   
 
Change the prompt trigger to decide the colors before doing the #SUB then do the #SUB with the colors:
#TRIGGER {~| (%d)H (%d)M %d(V) ~>} {#VAR hpperc {%eval(%1 * 100)/@maxhp)};#VAR manaperc {%eval(%2 * 100)/@maxmana)};#VAR moveperc {%eval(%3 * 100)/@maxmove)};#VAR hpcol {%if(@hpperc < 34, 4, %if(@hpperc < 67, 6, %if(@hpperc < 100, 2, 11)))};#VAR manacol {%if(@manaperc < 34, 4, %if(@manaperc < 67, 6, %if(@manaperc < 100, 2, 11)))};#VAR movecol {%if(@moveperc < 34, 4, %if(@moveperc < 67, 6, %if(@moveperc < 100, 2, 11)))};#SUB {%concat("| ", %ansi(@hpcol), %1, "(", @hpperc, "%) ", %ansi(@manacol), %2, "(", @manaperc, "%) ", %ansi(@movecol, %3, "(", @moveperc, "%)", %ansi(def)" >")}} "" {nocr|prompt}

Kjata
Reply with quote
Edwub
Wanderer


Joined: 21 Nov 2002
Posts: 85
Location: USA

PostPosted: Tue Feb 25, 2003 4:50 am   
 
I'm getting syntax errors and the new one isn't working.

veperc, "%)", %ansi(def)" >")}
^ syntax error

Edwub the Mage

edit:
prompt appears as:
| 1781(178100/1818)%) 1651(165100/1754)%) >

currently, and all in red
edit 2:
using zmud 6.16
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Feb 25, 2003 5:55 am   
 
It's just a few typos. Usually I'm the one making them and Kjata's the one to catch them.

#TRIGGER {~| (%d)H (%d)M (%d)V ~>} {#VAR hpperc {%eval((%1 * 100)/@maxhp)};#VAR manaperc {%eval((%2 * 100)/@maxmana)};#VAR moveperc {%eval((%3 * 100)/@maxmove)};#VAR hpcol {%if(@hpperc < 34, 4, %if(@hpperc < 67, 6, %if(@hpperc < 100, 2, 11)))};#VAR manacol {%if(@manaperc < 34, 4, %if(@manaperc < 67, 6, %if(@manaperc < 100, 2, 11)))};#VAR movecol {%if(@moveperc < 34, 4, %if(@moveperc < 67, 6, %if(@moveperc < 100, 2, 11)))};#SUB {%concat("| ", %ansi(@hpcol), %1, "(", @hpperc, "%) ", %ansi(@manacol), %2, "(", @manaperc, "%) ", %ansi(@movecol), %3, "(", @moveperc, "%)", %ansi(def)" >")}} "" {nocr|prompt}

LightBulb
Advanced Member
Reply with quote
Edwub
Wanderer


Joined: 21 Nov 2002
Posts: 85
Location: USA

PostPosted: Tue Feb 25, 2003 6:27 am   
 
You both REALLy rock =)
Thank's so much, this thing is way cool.


Edwub the Mage
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