I'm trying to write a set of triggers for a MUD. MUD sends status prompt after each event, and the problem is that prompt is not newline-terminated (I suppose; triggers won't process prompt until line complete, or new line appears). So, sometimes I recieve a text like this:
100h, 100m eb-You eat a chunk of meat.
That was tasty meat!
100h, 100m eb-
And sometimes like that:
100h, 100m eb-
You eat a chunk of meat.
That was tasty meat!
100h, 100m eb-
For a reason, I need to set triggers to react "You eat a chunk of meat." as a string, that begins at the start of line, 'cause I can recieve fake strings like
100h, 100m eb-
Someone says, "You eat a chunk of meat."
100h, 100m eb-
and must ignore them.
I use regular exressions and "^" and "$" symbols, to be sure I don't get fake strings. Now, I'm forced not to use "^", what is a bad idea.
So, I wonder, if there is a way to call triggers processing sequence from the script? So I can set up one trigger which will separate status prompt from the rest of string, and then call triggers sequence again, for the right portion of that line.
Or, maybe, there is another solution to the problem?
100h, 100m eb-You eat a chunk of meat.
That was tasty meat!
100h, 100m eb-
And sometimes like that:
100h, 100m eb-
You eat a chunk of meat.
That was tasty meat!
100h, 100m eb-
For a reason, I need to set triggers to react "You eat a chunk of meat." as a string, that begins at the start of line, 'cause I can recieve fake strings like
100h, 100m eb-
Someone says, "You eat a chunk of meat."
100h, 100m eb-
and must ignore them.
I use regular exressions and "^" and "$" symbols, to be sure I don't get fake strings. Now, I'm forced not to use "^", what is a bad idea.
So, I wonder, if there is a way to call triggers processing sequence from the script? So I can set up one trigger which will separate status prompt from the rest of string, and then call triggers sequence again, for the right portion of that line.
Or, maybe, there is another solution to the problem?