Would someone give me an example of an AND/OR trigger? I'd like to know how they work so I can set them up in specific triggers if I want the entire thing to depend on the first sequence going through successfully.
Also, would someone be able to explain how to work a counting script in? Something that could track each time a message appears and keeps track of the count while adding more for each successful message.
AND and OR Triggers + Counting Script
Re: AND and OR Triggers + Counting Script
OR trigger: just input multiple patterns into it, if either matches, the script runs. AND trigger: enable the AND checkbox, set the delta for how many lines would you like to have all patterns matched by (ie, you want all lines to match within 5 lines of the first one - set the delta to be 5).
Re: AND and OR Triggers + Counting Script
I've honestly never found a great use for AND triggers.
Re: AND and OR Triggers + Counting Script
That's a pity. I did - besides the necessity of matching precision, I also use them as a convenient way to shield things.
Re: AND and OR Triggers + Counting Script
regex shielding is really the only reason I use them at all. I've rewritten all of my multi line match triggers to a different system of late, as well.
Re: AND and OR Triggers + Counting Script
AND triggers become very important if you play MUDs where you cannot disable server line wrap (= most MUDs that I know) or if you want to reduce complexity by condensing multiple triggers into a single AND trigger.
example 1: You want to print "hello world" if and only if 3 lines after your last prompt you get a line that contains the word "Jim".
multistate AND trigger pattern list:
1.) isPrompt() [type Lua function]
2.) 3 [type line spacer]
3.) Jim [type substring]
script: echo("hello world")
example 2: You want to match the sentence "Jim likes Sally, Carla and Jane.", but you cannot know where the server sets the line break as you cannot disable server line wrap. The server output could look like:
Jim likes Sally and Jane.
or
Jim likes Sally, Carla
and Jane
or any other combination.
solution:
multistate pattern list: [trigger pattern type is always substring], line delta is 2
1. Jim
2. likes
3. Sally
4. and
5. Jane
example 1: You want to print "hello world" if and only if 3 lines after your last prompt you get a line that contains the word "Jim".
multistate AND trigger pattern list:
1.) isPrompt() [type Lua function]
2.) 3 [type line spacer]
3.) Jim [type substring]
script: echo("hello world")
example 2: You want to match the sentence "Jim likes Sally, Carla and Jane.", but you cannot know where the server sets the line break as you cannot disable server line wrap. The server output could look like:
Jim likes Sally and Jane.
or
Jim likes Sally, Carla
and Jane
or any other combination.
solution:
multistate pattern list: [trigger pattern type is always substring], line delta is 2
1. Jim
2. likes
3. Sally
4. and
5. Jane
Re: AND and OR Triggers + Counting Script
True, the games I play all give the option of eliminating server side line wrapping.
As far as to see if a trigger matches only three lines after a prompt, I've switched to using moveCursor and selectString. I have a lot of systems that depend on page-length limited output, and came up with the method of checking the last line for "MORE" via moveCursor and simply shutting down the processing triggers on the correct situation. Again, situational to how I do things.
As far as to see if a trigger matches only three lines after a prompt, I've switched to using moveCursor and selectString. I have a lot of systems that depend on page-length limited output, and came up with the method of checking the last line for "MORE" via moveCursor and simply shutting down the processing triggers on the correct situation. Again, situational to how I do things.