 |
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Wed Jan 21, 2009 7:30 am
[3.03a] #show causing a problem with the enabling of an event |
Problem Summary:
The #show command can cause the delayed enabling of an event. This was extracted and simplified from a previous post in the general area that wasn't clear. I've also added instructions.
Instructions:
| Code: |
1) Connect to Achaea
2) Import the xml code
3) Open the Settings Editor and right click the trigger "^There is no such person, I'm afraid\.$" and select "execute script".
4) Hit enter at the command line to receive another prompt.
You should see how it should operate correctly:
1634h, 1318m, 7070e, 4895w ex-(control)
Triggered.
1634h, 1318m, 7070e, 4895w ex-(enabled)(control)
5) Now type at the command line: "honors fjdklsfj". This will cause Achaea to return the text "There is no such person, I'm afraid." which will cause the trigger to be executed.
6) Hit enter again for another prompt.
You should now see how it is in error. Enabled should have appeared on the very next line like it did above. For some reason it doesn't occur until the second prompt:
1634h, 1318m, 7070e, 4895w ex-(control)honors fjdkslfdj
There is no such person, I'm afraid.
Triggered.
1634h, 1318m, 7070e, 4895w ex-(control)
1634h, 1318m, 7070e, 4895w ex-(enabled)(control)
|
| Code: |
<class name="temp" id="1">
<trigger priority="53270" regex="true" id="2">
<pattern>^There is no such person, I'm afraid\.$</pattern>
<value>#show Triggered.
#T+ prompt1</value>
</trigger>
<event event="Prompt_test" priority="53320" name="prompt1" enabled="false" id="3">
<value>#sayp ~(enabled~)
#T- prompt1</value>
</event>
<event event="Prompt_test" priority="53430" name="prompt2" id="4">
<value>#sayp ~(control~)</value>
</event>
<trigger name="prompt_test" priority="6" case="true" trigontrig="false" regex="true" newline="false" prompt="true" id="5">
<pattern>^\d+h, \d+m, \d+e, \d+w ([cexkdb]*)\-</pattern>
<value>#RAISEEVENT Prompt_test</value>
</trigger>
</class>
|
|
|
|
|
 |
gamma_ray Magician
Joined: 17 Apr 2005 Posts: 496
|
Posted: Wed Jan 21, 2009 9:17 am |
I -think- this is a problem with your priority for the different triggers and events. Try rearranging.
|
|
|
|
 |
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Wed Jan 21, 2009 3:29 pm |
Did you notice that in the example above it works properly when the trigger is activated by right clicking on the trigger but that it malfunctions when it is called by actually text matching from the mud?
|
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Jan 21, 2009 5:36 pm |
The #SHOW command forces it's text to be moved to the top of the output queue, in front of any lines from the MUD or from other triggers that might be waiting to be displayed. This is a normal result of how #SHOW works and is intended to force text into the MUD buffer. You should probably be using #SAY instead of #SHOW.
|
|
|
|
 |
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Wed Jan 21, 2009 10:27 pm |
Here is how I see the sequence of events:
1) A line of text is received from the Mud and it matches the trigger
2) The trigger does the following:
2a) #show Trigger is executed
2b) The Event prompt1 is enabled
3) A prompt is received from the Mud and the Prompt_test event is raised
4) The event prompt2 receives the Prompt_test event and executes.
5) The event prompt1 although it should be enabled, doesn't fire until a second prompt is received.
I just don't see how the #show in #2a (above) can affect when the event1 prompt event is enabled. I could see it altering the ordering of how things are printed out, but it should be enabled when the event is raised. If I swap the order of the lines for the (#show) and (#T+ prompt), it will correctly fire on the very next prompt which I would have expected. How can the ordering of (#T+ prompt1) and (#show) in the trigger change that? |
|
|
|
 |
|
|
|
|
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
|
|