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
saplingg
Novice


Joined: 06 Oct 2005
Posts: 31

PostPosted: Fri Nov 04, 2005 12:17 pm   

Colouring Trigger
 
I'm trying to make a trigger that colours some lines. In the MUD I play, combat messages from you are in yellow, from a person in your group are in red, and against you or your group are also in red.

I am trying to set up a trigger that colours attacks from a friendly against anyone else in blue.

This is the code I am trying to use.

Code:

#TRIGGER {%1 sneaks past} {#IF (%1 = Gob) {#CO cornflowerblue}}
#TRIGGER {%1 forces past} {#IF (%1 = Gob) {#CO cornflowerblue}}
#TRIGGER {%1 feints to the left and} {#IF (%1 = Gob) {#CO cornflowerblue}}
#TRIGGER {%1 rushes forward and} {#IF (%1 = Gob) {#CO cornflowerblue}}




However, it does not work. When another person (other than "Gob") attacks either me or a third party, it occasionally also colours that blue.


For example,

A snake-demon with green scales feints to the left and nicks your left leg with her teeth!

was coloured blue in this case.



Could anyone help to rewrite or fix up my trigger? Thank you.


Additionally, let's say I wanted the colouring trigger to work for several people, and so I create a variable @friends which contains a string of names. Would a code like

Code:

#TRIGGER {%1 sneaks past} {#IF (%1 = @friends) {#CO cornflowerblue}}



work?


Thanks!
Reply with quote
TerrellKl
Novice


Joined: 30 Aug 2005
Posts: 49

PostPosted: Fri Nov 04, 2005 1:26 pm   
 
My only guess would be that this

#TRIGGER {%1 feints to the left and} {#IF (%1 = Gob) {#CO cornflowerblue}}

Should be this

#TRIGGER {%1 feints to the left and} {#IF (%1="Gob") {#CO cornflowerblue}}

I never used %1 as a variable before.. But in the case you have you probably should use * instead
soo..

Code:
#TRIGGER {* sneaks past} {#IF (%1="Gob") {#CO cornflowerblue}}
#TRIGGER {* forces past} {#IF (%1="Gob") {#CO cornflowerblue}}
#TRIGGER {* feints to the left and} {#IF (%1="Gob") {#CO cornflowerblue}}
#TRIGGER {* rushes forward and} {#IF (%1="Gob") {#CO cornflowerblue}}


As for the second trigger

#TRIGGER {%1 sneaks past} {#IF (%1 = @friends) {#CO cornflowerblue}}

I would use

Code:
#TRIGGER {* sneaks past} {#IF (%ismember(@friends)) {#CO cornflowerblue}}


I didn't test any of the triggers so they may have mistakes..
I might be a noob and Just screwed you up more.. buuut I can try
Reply with quote
darkspot
Apprentice


Joined: 29 Jul 2002
Posts: 105

PostPosted: Fri Nov 04, 2005 4:07 pm   
 
Code:

#var friends {Gob}
#var fightList {sneaks past|forces past|feints to the left and|rushes forward and}
#TRIGGER {(*) {@fightlist}} {#IF (%ismember(%1, @friends)) {#CO cornflowerblue}} 
 


just A putting bracers around *, B making sure you had the %1 in ismember, C, adding my own personal obsession with using lists to get rid of multiple similair triggers :)
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Fri Nov 04, 2005 8:58 pm   
 
Also the %1 part should be "%1" you should always quote your strings
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
saplingg
Novice


Joined: 06 Oct 2005
Posts: 31

PostPosted: Sun Nov 06, 2005 2:40 pm   
 
Darkspot, that trigger doesn't work for me..

Should it be

#IF (%ismember(%1, @friends) > 0) or something like that?
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