Alright, here you go. It's pretty cut and dry, could have made it more complicated (but a lot shorter), but this works and should serve to help you figure out how this stuff works.
Basically all it does is count the number of things that are above 12, and also the ones that are 18, and then if everything is above 12 it checks to see if four or more are 18. You can change the note lines (note "asdfaf") to send lines (send "yes") to send whatever (probably Y or N). The notes send it to the client (you can see it, server cant) and the sends actually send it to the server.
It also colors the line that it matches (if you don't get color, the trigger isnt working). If the trigger isn't catching, you either aren't having the line end in a newline, or there is something else in the line (more spaces, perhaps?) and we'll need to fix that.
<triggers>
<trigger
custom_colour="4"
enabled="y"
match="^Your roll: (\d+), (\d+), (\d+), (\d+), (\d+), (\d+)$"
regexp="y"
send_to="12"
sequence="100"
>
<send>dim max,med
max = 0
med = 0
if ("%1" >= 12) then
med = med + 1
if ("%1" = 18) then
max = max + 1
end if
end if
if ("%2" >= 12) then
med = med + 1
if ("%2" = 18) then
max = max + 1
end if
end if
if ("%3" >= 12) then
med = med + 1
if ("%3" = 18) then
max = max + 1
end if
end if
if ("%4" >= 12) then
med = med + 1
if ("%4" = 18) then
max = max + 1
end if
end if
if ("%5" >= 12) then
med = med + 1
if ("%5" = 18) then
max = max + 1
end if
end if
if ("%6" >= 12) then
med = med + 1
if ("%6" = 18) then
max = max + 1
end if
end if
'done figuring out values
if (med = 6) then
if (max >= 4) then
note "Yes!"
else
note "Almost! (all above 12)"
end if
else
note "nope"
end if</send>
</trigger>
</triggers>
|