Thanks. At least I'm able to get it to match with only one trigger then.
Can anyone (Nick) explain why it only sends to the script once? Other than highlighting or gagging, what's the use in matching multiple times and not executing each time. I mean, I can easily cause stack overflows with infinite loops in other places, so why not here? :)
Your trigger will MATCH multiple times on a line (turn on highlighting, you'll see), however it will only send to the script (and thus, your note) once per line.
So, you'll have have three triggers (one for three items, one for two items, one for a single item), of course, you could also just have a single trigger with three items in it (where two are optional).
Amended on Fri 24 Jun 2005 02:33 PM (UTC) by Larkin
Message
I haven't figured out the trick to triggering a pattern multiple times in a single line. I'm attempting to check the contents of my pocketbelts and store the values in a table. I can make three or four triggers or come up with a complex regular expression to do this, so that's not my question. Can anyone tell me how to match on a very simple expression that just repeats on the same line? My trigger isn't doing it.
Sample output to match on:
You check the contents of your 5 pocketbelts:
3959 spices 5 kombu 63 coltsfoot
36 kafe 53 galingale 49 pennyroyal
50 faeleaf 51 calamus 61 marjoram
2 colewort 51 myrtle 120 chervil
50 arnica
My trigger:
<triggers>
<trigger
enabled="y"
keep_evaluating="y"
match="(\d+)\s+(\w+)"
regexp="y"
repeat="y"
send_to="12"
sequence="100"
>
<send>Note("You have %1 of %2.")</send>
</trigger>
</triggers>
My results:
You check the contents of your 5 pocketbelts:
You have 5 of pocketbelts.
3959 spices 5 kombu 63 coltsfoot
You have 3959 of spices.
36 kafe 53 galingale 49 pennyroyal
You have 36 of kafe.
50 faeleaf 51 calamus 61 marjoram
You have 50 of faeleaf.
2 colewort 51 myrtle 120 chervil
You have 2 of colewort.
50 arnica
You have 50 of arnica.
Edit: monospace isn't monospaced? Code is, though. Heh.
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.