|
boblinski Novice
Joined: 05 Dec 2005 Posts: 49 Location: New Zealand
|
Posted: Thu Jul 18, 2019 10:29 am
Help with trigger syntax |
Code: |
<trigger priority="13990" id="1399">
<pattern>Bob [says|tells you|tells the group] '*%w*'</pattern>
<value>#if (%1 = drink) {wa;ceb;ceb} {}
#if (%1 = eat) {wa;ceb;ceb} {}
#if (%1 = sleep) {rest;sleep} {}
#if (%1 = rest) {rest} {}
#if (%1 = stand) {stand} {}
#if (%1 = wake) {stand} {}
#if (%1 = flee) {flee;flee} {}
#if (%1 = run) {RUNTIME} {}
#if (%1 = sanc) {sanc ilmryn} {}
#if (%1 = farewell) {RUNTIME} {}</value>
</trigger> |
Says to me anything containing those keywords.. I want to act accordingly... I think I have the matching syntax's wrong?
Any help?
Basically if |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Thu Jul 18, 2019 12:30 pm |
Bob {says|tells you|tells the group} '(*)'
String lists in patterns need to be wrapped in curly brackets
You need to wrap the part of your pattern you want to test against in parenthesis for it to capture into the %1 %2 %3 etc variables.' |
|
_________________ Discord: Shalimarwildcat
Last edited by shalimar on Thu Jul 18, 2019 11:13 pm; edited 1 time in total |
|
|
|
boblinski Novice
Joined: 05 Dec 2005 Posts: 49 Location: New Zealand
|
Posted: Thu Jul 18, 2019 5:16 pm |
Will this still recognise and trigger accordingly even with different messages?...
for example will "eat" proc with both:
Bob says 'Eat something, would you?'
And
Bob tells you 'Why don't you eat?' |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Thu Jul 18, 2019 11:13 pm |
#IF (%match(%1, "eat")) {wa;ceb;ceb}
Will work, if you edit the pattern further to use just a * instead of %w. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
|
|