Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
elektrisk
Novice


Joined: 06 May 2008
Posts: 38

PostPosted: Sat Dec 20, 2008 11:06 pm   

Could someone help with this trigger?
 
Ok, I have a trigger to "gsay" (grouptell/groupsay/tell my group) when a certain spell has been casted and who the target is.

The pattern is as follows:

%1 stares at %2 and utters the words, 'oculoihp haeqp'.

then the response is:

#IF (%2 != you) {#IF (%2 = you ) {gs %1 is DEATH TOUCHING ME!} {gs %1 is DEATH TOUCHING %2}}

Because my problem is, if I just leave it to "gs %1 is DEATH TOUCHING %2." then if I am the target, it'll groupsay "%1 is DEATH TOUCHING you." because the line would be:

%1 stares at you and utters the words, 'oculoihp haeqp'.

The problem with that is it makes my groupies think THEY are the target, so I tried making an #if statement to change it to "%1 is DEATH TOUCHING ME!!" if %2 = "you", but for some reason it isn't working. Does anyone have any idea why my statement isn't wokring?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Dec 21, 2008 12:07 am   
 
Erm... I'm not at all sure how %2 can equal "you" after you already tested if it doesn't equal "you". The two tests are contradictory.

First, check to see what the value of %2 is. You should really be using proper wildcards rather than %1-%99 in the pattern to make sure your variables contain what you want them to. Make sure it doesn't have any extra spaces or anything like that. Once you're sure it's only got "you" or someone else's name in there, you can do:

#if (%2="you") {gs %1 is death touching me} {gs %1 is death touching %2}

You don't need to check it twice, because once you know that %2 isn't "you", there's no way it could be "you" after all.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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