Multiple Triggers Same Line
Posted: Mon Mar 26, 2018 8:26 am
I am trying to figure out a way to run the same trigger multiple times every time it finds the keyword on the same line.
Example text:
Example trigger with match all enabled:
I would like it to echo "softdrinks = 2" and "burritos = 4" But right now all it will do it echo the first item it finds on the line. Please help! Any pointers in the right direction would be most helpful.
Example text:
Code: Select all
Foods: burrito, soft-drink, burrito, soft-drink, burrito and burrito
Code: Select all
(\, |\: |and )(\w+)
foodtype = matches[3]
if foodtype == "burrito" then
burritocounter = burritocounter + 1
echo("burritos = "..burritocounter )
end
if foodtype == "soft-drink" then
softdrinkcounter = softdrinkcounter + 1
echo("softdrinks = "..softdrinkcounter)
end