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


Joined: 13 Jul 2002
Posts: 51
Location: Malaysia

PostPosted: Mon Jul 15, 2002 11:44 am   

Whiner Help.
 
A bit messy but cope with me please.

#pattern
^<(%1)hp (%2)ma (%3)mv

#command
#var mana_variable %2
#var mv_variable %3
#math need_hp @maximum_hp-%1
#math need_mana @maximum_mana-%2
#math percent_hp 100*%1/@maximum_hp
#if @whiner_variable=1 {#if (%1 < @hp_variable) {#math delta %1-@hp_variable
#math whiner_hp @maximum_hp-%1
grouptell d02@delta c11Oc15uc04cc06hc08!c02 [~Hp: %1 c11/ @maximum_hpc02~] To Full-->:~(c06@whiner_hpc02~) d02Gd04ld06oc15wc02 : a06a02c15@char_sanc_counta01 }
#if (%1 > @hp_variable) {#math delta %1-@hp_variable
#math whiner_hp @maximum_hp-%1
grouptell c11~+@delta c15Ac11hc08hc06hc04!c02 [~Hp: %1 /c11 @maximum_hpc02~] To Full-->:~(c06@whiner_hpc02~) d02Gd04ld06oc15w : a06a02c15@char_sanc_counta01 }}
#var hp_variable %1


OK here's what i want to do.
Lets say i got 1200 hp.
I want whiner to go like this
if %1 is like 20% of max hp, colour it red
if 21-40% colour yellow
41-60 - colour green
if 61-80 - colour purple
if 81-100% - colour cyan.

Can anyone help out?

Cameth
Saweth
Fledeth my asseth offeth
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Jul 15, 2002 4:11 pm   
 
I can't see any explanation of the color coding, so I'll just guess. You should be able to integrate this into your existing script.

#IF ((%1 * 5) < @maximum_hp) {grouptell ~c04HP: %1}
#IF (((%1 * 5) > @maximum_hp) AND ((%1 * 5) < (@maximum_hp * 2)) {grouptell ~c06HP: %1}
#IF (((%1 * 5) > (@maximum_hp * 2)) AND ((%1 * 5) < (@maximum_hp * 3)) {grouptell ~c02HP: %1}
#IF (((%1 * 5) > (@maximum_hp * 3)) AND ((%1 * 5) < (@maximum_hp * 4)) {grouptell ~c05HP: %1}
#IF ((%1 * 5) > (@maximum_hp * 4)) (grouptell ~c03HP: %1}

LightBulb
Senior Member
edited to change forward slash (/) to backslash ()
Reply with quote
Death
Apprentice


Joined: 25 Jun 2002
Posts: 109
Location: USA

PostPosted: Mon Jul 15, 2002 6:06 pm   
 
Is this for a prompt? To tell people? To put in a visual bar?
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