Okay, my situation is as following: I have a plugin, PromptTweak, that omits the prompt of my mud from output and instead outputs one with several options, like a timestamp and messages from the scripts I use. Other scripts (like my plugin Curing) can use world.CallPlugin() to send information to my prompt script which will then display it.
This works all fine, unless the message is actually generated within the prompt trigger of the plugin that sends a message.
If I now cause a message to be sent, it will show one prompt 'late'. Tracing and all actual calculations don't matter, but since I tend to log these for later reference and to teach other people from, it is very confusing. A trace log where I use the TEST TRIGGER function to cause a message to be sent:
I have omitted the messages from plugins that didn't have anything to do with this problem, although I left the entire 'simulation' intact. While this precise problem may seem rather trivial since it shows directly after the cure, other things don't actually cause output to be sent at that moment. (It's just that this one is easiest to demonstrate with. :D)
Can it be made so that sequences pay attention to the order among triggers in different plugins?
This works all fine, unless the message is actually generated within the prompt trigger of the plugin that sends a message.
Prompt trigger in the promptmodifying plugin that displays the messages:
<trigger
enabled="y"
keep_evaluating="y"
name="PromptTweak"
omit_from_output="y"
regexp="y"
sequence="120"
script="PromptTweak"
match="^H\:(\d{1,4}) M\:(\d{1,4}) E\:(\d{1,3})\% W\:(\d{1,3})\% B\:(\d{1,3})\% [(\D{1,9})]((?: )?\([^()]+\) ){0,3}$"
>
</trigger>
Prompt trigger in another plugin that sends the message using world.CallPlugin():
<trigger
enabled="y"
keep_evaluating="y"
name="NormalPromptTrigger"
omit_from_output="n"
regexp="y"
sequence="95"
script="ProcessNormalPrompt"
match="^H\:(\d{1,4}) M\:(\d{1,4}) E\:(\d{1,3})\% W\:(\d{1,3})\% B\:(\d{1,3})\% [(\D{1,6} )?([e-][b-])](\([^()]+\) )?$">
</trigger>
If I now cause a message to be sent, it will show one prompt 'late'. Tracing and all actual calculations don't matter, but since I tend to log these for later reference and to teach other people from, it is very confusing. A trace log where I use the TEST TRIGGER function to cause a message to be sent:
[3783] [2323] E100 W99 [eb] 0:30.738 -
TRACE: Trace on
TRACE: Executing Plugin Curing script "OnPluginPacketReceived"
TRACE: Executing trigger script "PromptTweak" <-- too soon
[3783] [3783] E100 W100 [eb] 0:44.594 1460 -
TRACE: Executing trigger script "ProcessNormalPrompt" <-- too late
TRACE: Executing Plugin PromptTweak script "ColourMessage" <-- CallPlugin() call.
focus <-- reaction based on information
TRACE: Executing Plugin Curing script "OnPluginSend"
TRACE: Executing Plugin PromptTweak script "OnPluginSent"
TRACE: Executing Plugin Curing script "OnPluginSent"
TRACE: Executing Plugin Curing script "OnPluginPacketReceived"
TRACE: Executing trigger script "FocusEffective"
You focus your mind intently ... Expecting to cure: recklessness
TRACE: Executing trigger script "PromptTweak" <-- too soon
[3783] [2073] E100 W99 [eb] 0:44.799 -1710 < assumed recklessness, > - <-- hey, there you are. Too late.
TRACE: Executing trigger script "FocusAllCured"
Focus cured all: recklessness
TRACE: Executing trigger script "ProcessNormalPrompt" <-- too late
TRACE: Executing Plugin Curing script "OnPluginPacketReceived"
...
TRACE: Executing trigger script "PromptTweak" <-- too soon again
[3783] [2073] E100 W99 [eb] 0:45.26 -
TRACE: Executing trigger script "ProcessNormalPrompt" <-- too late.
TRACE: Trace off
I have omitted the messages from plugins that didn't have anything to do with this problem, although I left the entire 'simulation' intact. While this precise problem may seem rather trivial since it shows directly after the cure, other things don't actually cause output to be sent at that moment. (It's just that this one is easiest to demonstrate with. :D)
Can it be made so that sequences pay attention to the order among triggers in different plugins?