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
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Thu Apr 26, 2007 7:29 pm   

[1.30] #ONINPUT makes triggers "notrig" by default
 
I used the following test code to figure out why my events weren't firing, and I narrowed it down to the command input triggers being created with "trigger on trigger" off by default. If I open my Package Editor and check the box, the event suddenly starts working as intended. Since there is no explicit option to turn "trigger on trigger" ON with a trigger, only OFF, I thought it important to mention the problem.

Code:
#ONINPUT {^\s*tevt\s*$} {
#SAY Raising test event
#RAISE TestEvent
#NOINPUT
} "" {regex}

#EVENT TestEvent {
#SAY Test event fired
}
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Apr 26, 2007 10:04 pm   
 
Yes, this is done on purpose to prevent nasty trigger loops in oninput triggers. Normally you wouldn't want to trigger on the results of OnInput since the result is supposed to be sent to the MUD as a command, and not to the screen.

In any case, I'll see about adding a way to turn the option on in the command line definition.

Actually, looking at your example...is it just the Event that doesn't get triggered? I should probably change it so that you can still raise events, even if Trigger on Trigger is turned off.
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Fri Apr 27, 2007 1:02 am   
 
The command input trigger fires when I do "tevt" to test it, but it doesn't raise the event because of the trigger on trigger option, it seems. It should be safe to allow triggers to raise events independently of the trigger on trigger option. Events are just triggers, right? So, I can understand that this is a sort of side effect going on.

Either way this goes for the fix, thanks in advance!
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