Alright, so I figured out something that could be done...
You can create a trigger of the GMCP style with the trigger pattern being:
so that every time the vitals gmcp package is received, the webclient will run your trigger.
Beware, though....this can get VERY spammy and you have to build in some really explicit triggers or you can spam yourself. An example:
Code: Select all
Pattern:
char.vitals
Script:
if (gwc.gmcp.data.character.vitals.health == 'feeling very well')
{
gwc.connection.send('say I am healthy!');
}
Result:
> say I am healthy!
say I am healthy!
say I am healthy!
say I am healthy!
say I am healthy!
say I am healthy!
You say: I am healthy!
>
You say: I am healthy!
>
You say: I am healthy!
>
You say: I am healthy!
>
You say: I am healthy!
>
You say: I am healthy!
>
So this can be done, but generally the vitals package has several different components, but when I tried using
for the pattern, nothing happened. It might be worth using the
function to disable the trigger once it fires, then re-enable it a few seconds later after a timeout of a few seconds (or even a minute, depending on the action you are triggering).
A couple of things are happening here. I don't have a complete understanding of how this gmcp trigger is working (which is at least part of the issue), plus a lot of the more complicated code/trigger/script people use something other than the official webclient.
Anyway, I am always glad to try and troubleshoot! Feel free to respond here or hop on over to the most popular Discord server (
https://discord.gg/UBVbBrY)and check out the #code-stuff channel where you can get faster responses from a variety of helpful players.