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


Joined: 23 May 2001
Posts: 68
Location: Sweden

PostPosted: Wed May 21, 2003 3:40 pm   

Colour trigger: getting an underline...
 
When a player (or a mob) begins casting a spell I want a trigger to check if that player is on my enemylist (@pk_enemy_list). If so I want the name in the pattern "(%w) begins casting a spell..." to be underlined, and the whole pattern (regardless of a positive match in enemy_list) to be coloured "lightblue".

Example:
Darkforce begins casting a spell...
(Assuming Darkforce is in my @pk_enemy_list), else;
Darkforce begins casting a spell...

(if it is possible to have the underline in a different colour from the word that is even better :)

This is what I have come up with so far:

Pattern: (%w) begins casting a spell...$
Value: [blue]#IF (%ismember( %1, @pk_enemy_list)) {
#CW lightblue, underline The question is what code I should replace the fictive "lightblue, underline" with
} {
#Color lightblue
#VAR spell_caster ""
}
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed May 21, 2003 6:54 pm   
 
#TR {{%w} (begins casting a spell...)$} {#IF (%ismember( %1, @pk_enemy_list)) {#PCOL {underline,aqua} %x1;#PCOL {lightblue} %x2}}

LightBulb
Advanced Member
Reply with quote
nostra
Wanderer


Joined: 23 May 2001
Posts: 68
Location: Sweden

PostPosted: Sat May 24, 2003 1:54 pm   
 
I'm afraid the trigger doesn't work as intended.

If the player casting a spell ismember of the variable list (pk_enemy_list) the line is coloured lightblue but the player name is not underlined and coloured aqua.

Indeed, if the player is NOT a member of the variable list the line is not coloured at all ("%w begins casting a spell").

Please advice
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat May 24, 2003 2:48 pm   
 
It's a fairly simple typo, you could probably have found it yourself. Likewise, it's fairly simple to add a second command for the false result of #IF.
#TR {(%w) (begins casting a spell...)$} {#IF (%ismember( %1, @pk_enemy_list)) {#PCOL {underline,aqua} %x1;#PCOL {lightblue} %x2} {#COL lightblue}}

%ismember is case-sensitive. This will underline Darkforce but it won't underline darkforce (assuming Darkforce is in the list).

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