note: I figured out an alternative to solution.
This should be an easy one. On the line I see something like this.
Bernshire (5h2g3i23) men: 120 req: 1200 current: 0 (garrison)
My trigger below is intended to match that line and evaluate if the 'req: *' is greater than the 'current: *'.
If the 'req # is higher, it sends a command to the mud using some of the other parts of that line.
The command seems to send fine.
The problem is with the '(5h2g3i23)' The command being sent to the mud can only use what's inside the parenthesis, but my trigger matches all of it, including the parenthesis.
I tried using escape chars as the alternative trigger below, but then the line does not match at all.
"(@aland) \((.*?)\) men: (.*) req: (.*?) current: (.*?) (.*?)"
Okay edit: I got the trigger to work well on my own. Without regular expressions. I'm still not sure why the regular expressions didn't work.
"@aland (*) * men: * req: * current: * *"
match="(@aland) \((.*?)\) men: (.*) req: (.*?) current: (.*?) (.*?)"
Below is what I have.
The problem is it sends
'resupply (5h2g3i23) 1200'
When I just want 'resupply 5h2g3i23 12000 (those spaces don't seem to bother the mud)
-------------------------------------------------------
<triggers>
<trigger
custom_colour="2"
enabled="y"
expand_variables="y"
group="payland"
ignore_case="y"
match="(@aland) (.*?) men: (.*?) req: (.*?) current: (.*?) (.*?)"
regexp="y"
repeat="y"
send_to="12"
>
<send>if %4 > %5 then
Send "resupply %2 %4"
world.note "supplying now debug W1= %1 W2= %2 W3= %3 W4= %4 W5 = %5 W6= %6 W7= %7"
else
world.note "all required supplies are present Debug W1= %1 W2= %2 W3= %3 W4= %4 W5 = %5 W6= %6 W7= %7"
end if
</send>
</trigger>
</triggers>
This should be an easy one. On the line I see something like this.
Bernshire (5h2g3i23) men: 120 req: 1200 current: 0 (garrison)
My trigger below is intended to match that line and evaluate if the 'req: *' is greater than the 'current: *'.
If the 'req # is higher, it sends a command to the mud using some of the other parts of that line.
The command seems to send fine.
The problem is with the '(5h2g3i23)' The command being sent to the mud can only use what's inside the parenthesis, but my trigger matches all of it, including the parenthesis.
I tried using escape chars as the alternative trigger below, but then the line does not match at all.
"(@aland) \((.*?)\) men: (.*) req: (.*?) current: (.*?) (.*?)"
Okay edit: I got the trigger to work well on my own. Without regular expressions. I'm still not sure why the regular expressions didn't work.
"@aland (*) * men: * req: * current: * *"
match="(@aland) \((.*?)\) men: (.*) req: (.*?) current: (.*?) (.*?)"
Below is what I have.
The problem is it sends
'resupply (5h2g3i23) 1200'
When I just want 'resupply 5h2g3i23 12000 (those spaces don't seem to bother the mud)
-------------------------------------------------------
<triggers>
<trigger
custom_colour="2"
enabled="y"
expand_variables="y"
group="payland"
ignore_case="y"
match="(@aland) (.*?) men: (.*?) req: (.*?) current: (.*?) (.*?)"
regexp="y"
repeat="y"
send_to="12"
>
<send>if %4 > %5 then
Send "resupply %2 %4"
world.note "supplying now debug W1= %1 W2= %2 W3= %3 W4= %4 W5 = %5 W6= %6 W7= %7"
else
world.note "all required supplies are present Debug W1= %1 W2= %2 W3= %3 W4= %4 W5 = %5 W6= %6 W7= %7"
end if
</send>
</trigger>
</triggers>