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>
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
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!
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.
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.
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>
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
Hello. I am also having a problem. I copied the plug in, and added in the messages for my realm, made sure everything checked up and matched, but there is nothing going from the main window to the redirect window. My plugin looks like:
<?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="1.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>
<script>
<![CDATA[
chat_world = "DBE Chats"
local first_time = true
function redirect (name, line, wildcards, styles)
-- try to find "chat" world
local w = GetWorld (chat_world) -- get "chat" world
-- if not found, try to open it
if first_time and not w then
local filename = GetInfo (67) .. chat_world .. ".mcl"
Open (filename)
w = GetWorld (chat_world) -- try again
if not w then
ColourNote ("white", "red", "Can't open chat world file: " .. filename)
first_time = false -- don't repeatedly show failure message
end -- can't find world
end -- can't find world first time around
if w then -- if present
for _, v in ipairs (styles) do
w:ColourTell (RGBColourToName (v.textcolour),
RGBColourToName (v.backcolour),
v.text)
end -- for each style run
w:Note ("") -- wrap up line
Adjust [OOC] to \[OOC\] in your triggers. [] signifies a character class in regular expressions, and you are basically saying O, O, or C. Which it apparently does not consider an error but in either case, it does not do what you expect it to. :)
Edit: Although the yells and other varieties should still work. Can I assume you only tested with the OOC channel? :)
To help you, you need to show us some sample lines that you are trying to match. Triggers are pretty specific, maybe there is a comma there you didn't allow for.
Some samples are (I am aware of the tells being transmission instead):
Player [OOC]s, 'ty Volaj... on my way back to recall, lol.'
You [OOC], 'Hello.'
Player says, 'whats goin onnnn uub'
You say, 'Yo'
You send a scouter transmission to Player, 'Heya'
Player sends a scouter transmission to you, 'okay :P'
You (Holler), 'Someone else holler!'
Player (Holler)s, 'why?'
You (Shout), 'Shout like you mean it'
Player (Shout)s, 'shout shout'
You sing, 'Someone sing!'
Player sings, 'why?'
Player (1): homo
You (Roleplay), '-=Test=-'
Player (Roleplay)s, '*kills the human*'
You (Quote), '2 more!'
Player (Quote)s, 'woot helping'
You (Congrat), '1 more!'
Player (Congrat)s, 'yo'
You RP/Quest say, 'That's all!'
Player RP/Quest says, 'you need this one too? >.>'
You tell the group, 'Yo'
Player tells the group, 'sup'
The Number in "Player (1): homo" also changes depending on what frequency it is on.
I'm using the Chat Redirector/Input Redirector functions with several different worlds, and multiple chat windows.
What I want to know is, how can I set up the Input Redirect to take commands in the chat window, and send those commands to one window or another depending on the command entered.
Would it be possible to set up aliases in the chat window to that effect?
Allright, so I'm not really all that comfortable with the scripting, I haven't done a lot with it beyond making simple tweaks and edits to a few plugins.
Maybe you can tell me what I'm doing wrong here? I figure it's probably something extremely basic like 'completely messing up how the script should be written'.
<aliases>
<alias
match="^\+(P|Pub|Public) (.*?)$"
enabled="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>world_name = "World1"
local w = GetWorld (world_name) -- find world
-- not found? show error
if not w then
ColourNote ("white", "red", "World " .. world_name .. " is not open")
else
w:Execute (%0) -- execute command (handle aliases, etc.)
PushCommand (%0) -- save in command history
end -- if
return ("\t") -- clear command</send>
</alias>
</aliases>