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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Thinjon100
Apprentice


Joined: 12 Jul 2004
Posts: 190
Location: Canada

PostPosted: Mon Dec 11, 2006 4:51 pm   

[1.22] Disable Trigger Condition
 
OK, I'm not certain whether this is a bug, or not... but perhaps someone can give me some insight.

I have a trigger that captures channel output. Depending on who sends it, it captures to one of two windows... one of them results in a #GAG on the main window, while the other does not. As most lines in the mud are followed by a blank line (but not always), I added a conditional to gag a blank line occurring after the capture trigger. I'd prefer, however, if this did NOT fire if I didn't #GAG the main line. Here's what I attempted:
First trigger ID:"capchan"
Code:

#T+ "gagcapchan"
#IF (%ismember(%1,@friendlist)) {
 #T- "gagcapchan"
 #CAP capfriend
} {
 #CAP capother
 #GAG
}

Conditional trigger ID:"gagcapchan" Trigger:"^$"
Code:

#GAG


What I /hoped/ would happen would be that the conditional trigger would be enabled when the first trigger fired, but be disabled if the %1 was in my friendlist. I cannot do #GAG 2 in the "capother" section, as there is not /always/ a blank line...

What actually happens, it seems, in CMud, instead of enabling/disabling the conditional trigger "gagcapchan", is that it creates a "gagcapchan" class, and enables/disables that instead. I know I used #T+/#T- in zMud on triggers... has this changed in CMUD? If not, does this not affect conditionals? Is there something I'm missing?

As an aside, it might be nice if there was some simple way to disable processing further conditionals in a trigger set... or perhaps allow a local variable to pass between conditionals? (I'd REALLY like to avoid my old #VAR tempdisablegag 1 / #IF (@tempdisablegag) {} {#GAG} programming style, if at all possible)
Reply with quote
crycry
Apprentice


Joined: 24 Jun 2006
Posts: 169
Location: UK - South Coast

PostPosted: Mon Dec 11, 2006 5:07 pm   
 
im wondering whether the client is fast enough to cope with both lines coming at once, normally after i turn off/on a trigger i allow a small amount of time for it to catch up with the output before expecting it to catch. might be why its not firing, the blank line has already passed by the time the trigger actually activates.
_________________
'Life is what happens, when your too busy doing something else'

_________________

XP Pro SP2
cMud 1.24
_________________
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Mon Dec 11, 2006 5:16 pm   
 
I'm not sure if that's the proper way to enable or disable trigger states, Thinjon. The way I would do it is to have a class that's disabled and disable on startuped, and put the second trigger in there. Then you can enable the class only when you want to. You could also have the state set to manual and use the #state command.

Multistate triggers are capable of many things, but conditionally moving to different states is one of the things that can make them get REALLY complicated. It's often much easier just to use the class method above.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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