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
coldcut
Beginner


Joined: 09 Apr 2003
Posts: 17
Location: USA

PostPosted: Wed Apr 09, 2003 6:35 am   

need variables in a chat script
 
I have a chat script as follows..I want to modify it so that the color of
the hp and mana variables in my chat changes with range...so if my hp or
mana is 1-250 it displays the value as red in chat...yellow for
251-550...and green for 551+
The prompt for the hp and mana variables looks like this. Mv and Br are movement and breath stats...not really important for this script.

xxxhp xxxm xxxmv xxxbr

The CPK NPK LPK are variables for player-killing areas..they work ok...this is designed for use on Medievia btw.

#class {ogreschat}
#trigger {~<(%d)hp (%d)m } {#var CurrentMana %2;#var CurrentHP %1}
#trigger {NOTICE: You are leaving a PLAYER KILLING Area.} {#var PKType
{%ansi( high, green)LPK}}
#trigger {WARNING! You HAVE ENTERED a CHAOTIC PLAYER KILLING Area!} {#var
PKType {%ansi( high, red)CPK}}
#trigger {WARNING! You HAVE ENTERED a NEUTRAL PLAYER KILLING Area!} {#var
PKType {%ansi( high, yellow)NPK}}
#trigger {WARNING! You HAVE LEFT a CHAOTIC PLAYER KILLING AREA and ENTERED a
NEUTRAL} {#var PKType {%ansi(high, yellow)NPK}}

#alias {ch} {#var chattext {%-1};#chatall %ansi(bold,1)HP
%ANSI(green,bold)@currenthp"/"%ansi(bold,1)Mana
%ansi(green,bold)@currentmana%ansi(1)%ansi(red,bold)-%ansi(red,bold)O%ansi(7
,bold)@chattext%ansi(red,bold)O%ansi(red,bold)-%ansi(high,yellow)"["@PKType%
ansi(high,yellow)"]"}
#alias {pch} {#var chatname {%w};#var chattext {%*};#chat %1 %ansi(bold,1)HP
%ANSI(green,bold)@currenthp"/"%ansi(bold,1)Mana
%ansi(green,bold)@currentmana%ansi(1)%ansi(red,bold)-%ansi(red,bold)O%ansi(7
,bold)%-2%ansi(red,bold)O%ansi(red,bold)-%ansi(high,yellow)"["@PKType%ansi(h
igh,yellow)"]"}
#alias {gch} {#var chatname {%w};#var chattext {%*};#chatgroup %1
%ansi(bold,1)HP %ANSI(green,bold)@currenthp"/"%ansi(bold,1)Mana
%ansi(green,bold)@currentmana%ansi(1)%ansi(red,bold)-%ansi(red,bold)O%ansi(7
,bold)%-2%ansi(red,bold)O%ansi(red,bold)-%ansi(high,yellow)"["@PKType%ansi(h
igh,yellow)"]"}
#class 0



The slice of ice with xtra spice ;)
Reply with quote
HariKari
Wanderer


Joined: 16 Feb 2001
Posts: 57

PostPosted: Wed Apr 09, 2003 9:07 am   
 
Eh. I posted about this a few weeks back.. but I didn't get too much of a response.
(The ansi colors aren't sent to MudMaster.. not sure if they get sent to other zChat users tho)
You'll have to use the escape colors to have them sent to other chat programs.
%e[#;##m
Reply with quote
coldcut
Beginner


Joined: 09 Apr 2003
Posts: 17
Location: USA

PostPosted: Wed Apr 09, 2003 3:31 pm   
 
ansi colors SHOULD be sent to mm....i know my pktype variable changes colors..and it goes to mm correctly...nm the color preference..i need a way to alter the color based on the hp and mana variable..so basically i just need to know how to get my chat script to capture those variables and set a trigger based on the range(1-250,251-551,551+)

The slice of ice with xtra spice ;)
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Apr 09, 2003 5:28 pm   
 
Sending different codes can be done with #IF commands or %if functions. %if would probably be the better choice for this application.

#alias {ch} {#var chattext {%-1};#chatall %ansi(bold,1)HP
%ansi(yellow,bold)%if( @currenthp < 251, %ansi(red,bold))%if( @currenthp > 550, %ansi(green,bold))@currenthp"/"%ansi(bold,1)Mana
%ansi(green,bold)@currentmana%ansi(1)%ansi(red,bold)-%ansi(red,bold)O%ansi(7
,bold)@chattext%ansi(red,bold)O%ansi(red,bold)-%ansi(high,yellow)"["@PKType%
ansi(high,yellow)"]"}

LightBulb
Advanced Member
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