Gammon Forum
Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, 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.
Entire forum
MUSHclient
Tips and tricks
Chat redirection plugin assistance?
Chat redirection plugin assistance?
|
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Pages: 1 2
Posted by
| Frosty
(5 posts) bio
|
Date
| Wed 26 Nov 2008 08:45 AM (UTC) |
Message
| Hello everyone.
I'm a long-time shareware user of Mushclient.. and I've gotten years of nice service from it. So first, I want to kiss-up and thank Nick for the awesome client, and the others for some spectacular plugins!
Now that I've sufficiently browned up my carrot nose.. I have a question about the tell window plugin. I play on Lost Wishes and I can't seem to get this to work. I've tried it dozens of times and I still can't seem to even get the plugin to work.
I've installed and enabled the plugin on my main "LW.mcl", and I created LW2 for the chat redirection window. I've resized all of my windows and gotten everything ready...but no dice. It doesn't seem to work at all. I'm using version 4.37... but I don't think that could be the issue... right?
Is there something I'm missing below?
Thanks guys!
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Saturday, June 30, 2007, 10:48 -->
<!-- MuClient version 4.13 -->
<!-- Plugin "Chat_Redirector" generated by Plugin Wizard -->
<!--
Edit plugin and change "chat_world" variable to be the name of the
world you want chats to go to.
-->
<muclient>
<plugin
name="Chat_Redirector"
author="Nick Gammon"
id="cb84a526b476f69f403517da"
language="Lua"
purpose="Redirects chat messages to another world"
date_written="2007-06-30 10:45:35"
requires="4.08"
version="2.0"
>
<description trim="y">
<![CDATA[
Redirects chats to the specified world.
Add or modify "chat" triggers to capture different sorts of message.
Change the variable "chat_world" to be the name of the world chats are to go to.
]]>
</description>
</plugin>
<!-- Triggers -->
<triggers>
<trigger
enabled="y"
match="^(\(.+\): )?[A-Za-z]+ (says|yells|tells you), ".+"
regexp="y"
script="chat_redirect"
omit_from_output="y"
sequence="100"
>
</trigger>
<trigger
enabled="y"
match="^You (tell|whisper) .+, ".+"
regexp="y"
script="chat_redirect"
omit_from_output="y"
sequence="100"
>
</trigger>
<trigger
enabled="n"
match="*"
script="chat_redirect"
name="multi_line_chat"
omit_from_output="y"
sequence="10"
>
</trigger>
</triggers>
<!-- Script -->
<script>
<![CDATA[
chat_world = "LW2"
who_world = "Who List"
require "getworld" -- handles finding the world, and sending the line
-- chat redirector
function chat_redirect (name, line, wildcards, styles)
send_to_world (chat_world, styles)
-- if ends with quote, end of multi-line chat
if line:sub (-1) == '"' then
EnableTrigger ("multi_line_chat", false) -- no more lines to go
else
EnableTrigger ("multi_line_chat", true) -- capture subsequent lines
end -- if
end -- function chat_redirect
]]>
</script>
</muclient>
| top |
|
Posted by
| Nick Gammon
Australia (23,042 posts) bio
Forum Administrator |
Date
| Reply #1 on Thu 27 Nov 2008 05:40 AM (UTC) |
Message
| When you say it doesn't work, do you get an error message, or does nothing seem to happen?
If nothing seems to happen, can you post example output? The triggers need to match exactly for something to happen. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Frosty
(5 posts) bio
|
Date
| Reply #2 on Thu 27 Nov 2008 08:02 AM (UTC) |
Message
| Nothing at all is happening. The Chat window just stays blank.
The lines I was trying to redirect are like this:
You say: Cool
Frosty says: Cool
Frosty tells you: test
You tell Frosty: test
You shout: Happy Birthday!
Frosty shouts: Happy Birthday!
[chat] Frosty: woo
{Wayfarer} Frosty exclaims in mock pain.
I apologize in advance for being quite the dimwit when it comes to anything regarding actual code. I barely made it through BASIC about 15 years ago..heh.
I hope this helps? I tried to edit it several different ways and still nothing seems to be transferring over or anything. It's almost as if it's not even installed or enabled. (which it is..I've made sure of that numerous times.)
Thanks in advance for any assistance.. and kudos on the great work with the client! | top |
|
Posted by
| Nick Gammon
Australia (23,042 posts) bio
Forum Administrator |
Date
| Reply #3 on Thu 27 Nov 2008 08:23 PM (UTC) |
Message
| Your problem is the trigger match. In the case of the plugin it is:
match="^(\(.+\): )?[A-Za-z]+ (says|yells|tells you), ".+"
Now that is going to match something like:
(General): Nick says, "hi there"
or
Nick says, "hi there"
Note the comma after "says", and the chat stuff is quoted.
You have said you get:
So you don't have the comma, you don't have the quotes, but you do have a colon.
You need to rework the trigger a bit until it matches, for example:
match="^(\[.+\] )?[A-Za-z]+ (says|yells|tells you): .+"
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Frosty
(5 posts) bio
|
Date
| Reply #4 on Sat 29 Nov 2008 01:55 AM (UTC) |
Message
| Thanks for the help. I've re-worked it a few times.. and now text will redirect to the chat window.. however.. now it appears that everything goes over to the new window. I've spend a few hours off and on trying to fix it.. but I'm not sure what else I could be missing.
I've taken a screenshot here and thought maybe I'd see if you could see if there's something else I could do with the original plugin code that I had pasted earlier.
http://img392.imageshack.us/img392/2382/mushclientie1.png
Thanks | top |
|
Posted by
| Worstje
Netherlands (899 posts) bio
|
Date
| Reply #5 on Sat 29 Nov 2008 03:20 AM (UTC) |
Message
| Paste the triggers you are using. Nick's trigger should not be causing that for as far I am able to tell. | top |
|
Posted by
| Nick Gammon
Australia (23,042 posts) bio
Forum Administrator |
Date
| Reply #6 on Sat 29 Nov 2008 03:53 AM (UTC) |
Message
| This line is probably responsible:
That omits the matching line from the original window. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Frosty
(5 posts) bio
|
Date
| Reply #7 on Sat 29 Nov 2008 04:22 AM (UTC) |
Message
| Thanks for the help guys. I just added an "n" to the omit frmo output and it's letting tells and says go to the other window.
I'm wondering one other thing: Where can I go to learn about scripting? I usually just luck my way into figuring out some scripting (usually checking out other scripts), but I'd rather just learn how to do them myself..heh.
Thanks again. | top |
|
Posted by
| Frosty
(5 posts) bio
|
Date
| Reply #8 on Sat 29 Nov 2008 04:28 AM (UTC) |
Message
| Well... I thought I had it all sorted out. After I reinstalled and enabled it..the script works until a tell/say/chat is redirected into the other window. then afterwards, all text goes over to the new window as well.
I'm not sure what I'm missing here...heh.
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Saturday, June 30, 2007, 10:48 -->
<!-- MuClient version 4.13 -->
<!-- Plugin "Chat_Redirector" generated by Plugin Wizard -->
<!--
Edit plugin and change "chat_world" variable to be the name of the
world you want chats to go to.
-->
<muclient>
<plugin
name="Chat_Redirector"
author="Nick Gammon"
id="cb84a526b476f69f403517da"
language="Lua"
purpose="Redirects chat messages to another world"
date_written="2007-06-30 10:45:35"
requires="4.08"
version="2.0"
>
<description trim="y">
<![CDATA[
Redirects chats to the specified world.
Add or modify "chat" triggers to capture different sorts of message.
Change the variable "chat_world" to be the name of the world chats are to go to.
]]>
</description>
</plugin>
<!-- Triggers -->
<triggers>
<trigger
enabled="y"
match="^(\[.+\] )?[A-Za-z]+ (says|shouts|tells you|chat|wayfarer): .+"
regexp="y"
script="chat_redirect"
omit_from_output="y"
sequence="100"
>
</trigger>
<trigger
enabled="y"
match="^You (tell|whisper|shout|say|chat|wayfarer): .+"
regexp="y"
script="chat_redirect"
omit_from_output="n"
sequence="100"
>
</trigger>
<trigger
enabled="n"
match="*"
script="chat_redirect"
name="multi_line_chat"
omit_from_output="n"
sequence="10"
>
</trigger>
</triggers>
<!-- Script -->
<script>
<![CDATA[
chat_world = "Chat LW"
who_world = "Who List"
require "getworld" -- handles finding the world, and sending the line
-- chat redirector
function chat_redirect (name, line, wildcards, styles)
send_to_world (chat_world, styles)
-- if ends with quote, end of multi-line chat
if line:sub (-1) == '"' then
EnableTrigger ("multi_line_chat", false) -- no more lines to go
else
EnableTrigger ("multi_line_chat", true) -- capture subsequent lines
end -- if
end -- function chat_redirect
]]>
</script>
</muclient>
| top |
|
Posted by
| Nick Gammon
Australia (23,042 posts) bio
Forum Administrator |
Date
| Reply #9 on Sat 29 Nov 2008 08:06 PM (UTC) |
Message
| One of those triggers has omit from output as Y and the others as N.
You might want to change all of them. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Jman
(3 posts) bio
|
Date
| Reply #10 on Thu 12 Mar 2009 08:55 PM (UTC) |
Message
| Hey guys, I'm also having a minor problem with the chat plugin.
I'm trying to redirect group tells which look like this:
Person (100%) tells the group: 'Hi.'
It doesn't seem to be working because of the (100%) bit, which I tried adding myself but couldn't figure it out.
The numbers also change as it is a representation of the person's HP percentage.
Any help is appreciated.
Thanks | top |
|
Posted by
| Nick Gammon
Australia (23,042 posts) bio
Forum Administrator |
Date
| Reply #11 on Thu 12 Mar 2009 09:16 PM (UTC) |
Message
| |
Posted by
| Jman
(3 posts) bio
|
Date
| Reply #12 on Sat 14 Mar 2009 04:01 AM (UTC) |
Message
| These are the triggers that I have, the first one being the problematic one.
<!-- Triggers -->
<triggers>
<trigger
enabled="y"
match="^[A-Za-z]+ \([0-9]+\%\) tells \'(.*?)\'$"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>
<trigger
enabled="y"
match="^[A-Za-z]+ [A-Za-z]+ gossips \'(.*?)\'$"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>
<trigger
enabled="y"
match="^[A-Za-z]+ (says|tells|gossips|shouts|states) \'(.*?)\'$"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>
<trigger
enabled="y"
match="^You (say|gossip|tell|reply|shout) \'(.*?)\'$"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>
<trigger
enabled="y"
match="^You (tell|reply) [A-Za-z]+ [A-Za-z]+ \'(.*?)\'$"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>
</triggers>
\([0-9]+\%\) is what I imagined would work, but doesn't seem to.
Thanks again. | top |
|
Posted by
| Nick Gammon
Australia (23,042 posts) bio
Forum Administrator |
Date
| Reply #13 on Sat 14 Mar 2009 04:50 AM (UTC) |
Message
| In your trigger you have "tells" but the example you pasted had "tells the group:". Thus it won't match. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Jman
(3 posts) bio
|
Date
| Reply #14 on Sat 14 Mar 2009 05:06 AM (UTC) |
Message
| Haha, that did it!
Thanks! | 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.
69,626 views.
This is page 1, subject is 2 pages long: 1 2
It is now over 60 days since the last post. This thread is closed.
  Refresh page
top
Quick links:
MUSHclient.
MUSHclient help.
Forum shortcuts.
Posting templates.
Lua modules.
Lua documentation.
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.