Unsure how to go about this...

Posted by Azoroth on Mon 02 Feb 2009 04:16 PM — 11 posts, 32,878 views.

#0
Ok, so I'm trying to clean up my triggers a bit so there's less spam. What I've created is a basic shape trigger for the npc's I'm fighting. I just makes their shape more visible so I can see it in spam.

Here is what I have currently:

<triggers>
<trigger
custom_colour="17"
enabled="y"
group="Shape"
ignore_case="y"
match="* is in perfect shape.*"
send_to="2"
sequence="100"
other_text_colour="gray"
>
<send>PERF PERF PERF PERF PERF >>>> %1 <<<< PERF PERF PERF PERF</send>
</trigger>
</triggers>


Now, on the mud, the trigger looks like this:

Azoroth is in perfect shape.
PERF PERF PERF PERF PERF >>>> Azoroth <<<< PERF PERF PERF PERF

What I'd like to do is somehow sub Azoroth is in perfect shape with the trigger text, which would reduce a line of spam. Not sure how to go about doing this though...
USA #1
I believe that you can set the trigger to 'gag' the line of text it matched, i.e., not display what it matched, and display your output instead.
#2
<triggers>
<trigger
custom_colour="17"
enabled="y"
group="Shape"
ignore_case="y"
match="* is in perfect shape.*"
omit_from_output="y"
send_to="12"
sequence="100"
other_text_colour="gray"
>
<send>Note ("PERF PERF PERF PERF PERF %1 PERF PERF PERF PERF")</send>
</trigger>
</triggers>


I tried this, but to now avail...I think I read somewhere you need to omit the trigger match and have it send a Note or ColourNote? I set the trigger to omit from output as you can see but now nothing is displaying at all. Where am I going wrong? :P
Netherlands #3
Rather than using the 'Send to: Script' option, use the 'Send to: Script (after omit)' choice.
#4
Hmm ok, so I tried that with two variations and both gave me a compile error.

Trigger 1 Attempt:

<triggers>
<trigger
custom_colour="17"
enabled="y"
group="Shape"
ignore_case="y"
match="* is in perfect shape.*"
omit_from_output="y"
send_to="14"
sequence="100"
other_text_colour="gray"
>
<send>PERF PERF PERF PERF PERF %1 PERF PERF PERF PERF</send>
</trigger>
</triggers>


Trigger 2 (unchecking omit_from_output)

<triggers>
<trigger
custom_colour="17"
enabled="y"
group="Shape"
ignore_case="y"
match="* is in perfect shape.*"
send_to="14"
sequence="100"
other_text_colour="gray"
>
<send>PERF PERF PERF PERF PERF %1 PERF PERF PERF PERF</send>
</trigger>
</triggers>

I ended up receiving this error on both attempts:

Compile error
World: t2t
Immediate execution
[string "Trigger: "]:1: '=' expected near 'PERF'

I'm at a loss :/ Thanks for the help so far.

#5
Should be "%1" and not %1 since it is a string I believe.
#6
<triggers>
<trigger
custom_colour="17"
enabled="y"
group="Shape"
ignore_case="y"
match="* is in perfect shape.*"
omit_from_output="y"
send_to="14"
sequence="100"
other_text_colour="gray"
>
<send>Note ("PERF PERF PERF PERF PERF "%1" PERF PERF PERF PERF")</send>
</trigger>
</triggers>

Exact same error as previously encountered :(

Thanks for the help so far.
USA #7
What scripting language are you using?

This trigger won't work:
<triggers>
<trigger
custom_colour="17"
enabled="y"
group="Shape"
ignore_case="y"
match="* is in perfect shape.*"
send_to="14"
sequence="100"
other_text_colour="gray"
>
<send>PERF PERF PERF PERF PERF %1 PERF PERF PERF PERF</send>
</trigger>
</triggers>

because you are sending to script, but not using the 'Note' function.

Try:


<triggers>
<trigger
custom_colour="17"
enabled="y"
group="Shape"
ignore_case="y"
match="* is in perfect shape.*"
send_to="14"
sequence="100"
other_text_colour="gray"
>
<send>Note("PERF PERF PERF PERF PERF %1 PERF PERF PERF PERF")</send>
</trigger>
</triggers>
#8
You can't do it like that.

Do this:

Note("Perf Perf %1 Perf Perf")

or

Note("Perf Perf " .. "%1" .. " Perf Perf")

You actually had the one example right but you were not sending to script after omit, which is why it didn't work. I made that mistake too. :-)

Here is an example using ColourNote. Try this.

<triggers>
<trigger
enabled="y"
group="Shape"
ignore_case="y"
match="^([A-Z][a-z]+) is in perfect shape\.$"
omit_from_output="y"
regexp="y"
send_to="14"
sequence="100"
other_text_colour="gray"
>
<send>local person = string.upper("%1")
ColourNote("lime", "black", "PERF PERF PERF PERF ", "white", "black", person, "lime", "black", " PERF PERF PERF PERF")</send>
</trigger>
</triggers>

What is the actual line you are matching?

You have "* is in perfect shape.*". Is there something that comes after shape? Your example was "Azoroth is in perfect shape."
Amended on Tue 03 Feb 2009 03:16 PM by Curious2
#9
I have lua enabled. I will try what was suggested. I am matching on the line:

* is in perfect shape. I use this because it will capture ANYONE I shape (Eg Azoroth, Curious2, Dog, etc.)

#Edit#

I have tried the suggested trigger you gave me Curious2 and it worked perfectly. I'll study it so I can adjust the other triggers that I need to do almost the exact same thing to.


One other thing I am trying to sub would be: A rusty key.

I tried using this trigger to sub it.

<triggers>
<trigger
enabled="y"
match="A rusty key|[*]A rusty key (in hands)"
omit_from_output="y"
regexp="y"
send_to="14"
sequence="100"
>
<send>ColourNote ("white, "", "A rusty key [", "lime", "", "white", "", "]")</send>
</trigger>
</triggers>


Compile errors again:
Compile error
World: t2t
Immediate execution
[string "Trigger: "]:1: ')' expected near '", "'

Thanks for everything so far guys, you've been fantastic help.

This will be the last thing I ask, since it's the only thing I have left to figure out with my client.


Edit: I tried using empty placeholders for my colours like nick had told me before.

<triggers>
<trigger
enabled="y"
match="A rusty key|[*]A rusty key (in hands)"
omit_from_output="y"
regexp="y"
send_to="14"
sequence="100"
>
<send>ColourNote ("white", "", "A rusty key [", "lime", "white", , "", "]")</send>
</trigger>
</triggers>

but I'm receiving compile error:

Compile error
World: t2t
Immediate execution
[string "Trigger: "]:1: unexpected symbol near ','

Amended on Tue 03 Feb 2009 04:17 PM by Azoroth
Australia Forum Administrator #10
Your first one failed because you didn't close a quote:


ColourNote ("white, "", 


Note no quote at the end of "white".

Quote:

I tried using empty placeholders for my colours like nick had told me before.


I never said that. I said an empty string (ie. "" ). Lua doesn't support completely non-existent arguments, like: print (a,,,,,b)