Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ General
➜ Unsure how to go about this...
Unsure how to go about this...
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Azoroth
(31 posts) Bio
|
Date
| Mon 02 Feb 2009 04:16 PM (UTC) |
Message
| 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... | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #1 on Mon 02 Feb 2009 04:23 PM (UTC) |
Message
| 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. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Azoroth
(31 posts) Bio
|
Date
| Reply #2 on Mon 02 Feb 2009 07:35 PM (UTC) |
Message
| <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 | Top |
|
Posted by
| Worstje
Netherlands (899 posts) Bio
|
Date
| Reply #3 on Mon 02 Feb 2009 10:03 PM (UTC) |
Message
| Rather than using the 'Send to: Script' option, use the 'Send to: Script (after omit)' choice. | Top |
|
Posted by
| Azoroth
(31 posts) Bio
|
Date
| Reply #4 on Tue 03 Feb 2009 02:00 PM (UTC) |
Message
| 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.
| Top |
|
Posted by
| Curious2
(47 posts) Bio
|
Date
| Reply #5 on Tue 03 Feb 2009 02:23 PM (UTC) |
Message
| Should be "%1" and not %1 since it is a string I believe. | Top |
|
Posted by
| Azoroth
(31 posts) Bio
|
Date
| Reply #6 on Tue 03 Feb 2009 02:53 PM (UTC) |
Message
| <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. | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #7 on Tue 03 Feb 2009 03:05 PM (UTC) |
Message
| 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>
|
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Curious2
(47 posts) Bio
|
Date
| Reply #8 on Tue 03 Feb 2009 03:10 PM (UTC) Amended on Tue 03 Feb 2009 03:16 PM (UTC) by Curious2
|
Message
| 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."
| Top |
|
Posted by
| Azoroth
(31 posts) Bio
|
Date
| Reply #9 on Tue 03 Feb 2009 03:22 PM (UTC) Amended on Tue 03 Feb 2009 04:17 PM (UTC) by Azoroth
|
Message
| 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 ','
| Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #10 on Tue 03 Feb 2009 06:51 PM (UTC) |
Message
| Your first one failed because you didn't close a quote:
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)
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
23,229 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top