[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Tips and tricks
. . -> [Subject]  How to make a separate chats window
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: How to make a separate chats window
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1 2  3  4  5  

Posted by Basyiel   (10 posts)  [Biography] bio
Date Thu 11 Feb 2010 12:09 PM (UTC)  quote  ]

Amended on Thu 11 Feb 2010 07:30 PM (UTC) by Basyiel

Message
I dunno, its like these triggers take a minute to warm up :-) started workin normally the way i wanted after changed that line in the trigger, and played for 5-10min. Thanks Worstje








[Go to top] top

Posted by Worstje   Netherlands  (654 posts)  [Biography] bio
Date Thu 11 Feb 2010 10:53 AM (UTC)  quote  ]
Message
Try:

<trigger
enabled="y"
match="^(\(.+\): )?[A-Za-z]+ (says|yells|tells you), &quot;.+"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>

<trigger
enabled="y"
match="^(\(.+\): )?You (say|tell|whisper)(?: .+)?, &quot;.+"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>


Should fix your issues. I don't think I changed the first trigger, but just to make sure I kept both in my post. :)
[Go to top] top

Posted by Basyiel   (10 posts)  [Biography] bio
Date Thu 11 Feb 2010 10:31 AM (UTC)  quote  ]
Message
I've toying with it here n there, found out the says are working in town and guild chats such as this:

(Sar-Sargoth): Raki says, "Thank you everyone for the hunt."
(Sar-Sargoth): Dhaed says, "Yes, thank you very much for the hunt."

But nothing I say in any kind of chat goes to the chat window, everything stays in in the main window:

(Clan Raven): You say, "Mhm."

You say in Moredhel, "Uhh."

(Sar-Sargoth): You say, "K."


And heres the plug in as it is loaded into the main window.

<?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>

</plugin>

<!-- Triggers -->

<triggers>

<trigger
enabled="y"
match="^(\(.+\): )?[A-Za-z]+ (says|yells|tells you), &quot;.+"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>

<trigger
enabled="y"
match="^You (say|tell|whisper) .+, &quot;.+"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>

<trigger
enabled="n"
match="*"
script="redirect"
name="multi_line_chat"
sequence="10"
>
</trigger>


</triggers>

<!-- Script -->


<script>
<![CDATA[
chat_world = "RoD 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

end -- world found

-- 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 redirect

]]>
</script>
</muclient>
[Go to top] top

Posted by Nick Gammon   Australia  (15,754 posts)  [Biography] bio
Date Mon 08 Feb 2010 11:52 PM (UTC)  quote  ]
Message
To help both of you we need to see, copied and pasted (not just described) the exact output from the MUD you want to match (and any similar output you want to not match).

Also, if you changed the plugin can you at least post the changed lines (or all of it?).

Regular expression matching can be fiddly to get right, an extra space somewhere and it won't match.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Basyiel   (10 posts)  [Biography] bio
Date Mon 08 Feb 2010 10:50 PM (UTC)  quote  ]
Message
Ive followed the directions to a tee, I play midkemia, I cannot get anything to send from the main world to the chat window.. I'm copyin and pastin, enabling the plug in and nothing.. I dunno what to say.. past frustrated.. i like the client but nothing seems to work for me. Any help would be great.
[Go to top] top

Posted by Cerxi   Canada  (1 post)  [Biography] bio
Date Mon 25 Jan 2010 08:30 PM (UTC)  quote  ]

Amended on Mon 25 Jan 2010 08:51 PM (UTC) by Cerxi

Message
Sighh.. I'm really new at this. All I want it to do is match (<the name of any of the various guilds, cities, or clans>): <someone> says, "<something>" and pipe it to a new window. Also not to match regular <person> says, only group ones. But I can't figure out how because this is rather too complicated for my tiny brain.
[Go to top] top

Posted by Nick Gammon   Australia  (15,754 posts)  [Biography] bio
Date Thu 24 Dec 2009 07:40 AM (UTC)  quote  ]

Amended on Thu 24 Dec 2009 07:42 AM (UTC) by Nick Gammon

Message
Oh yeah, I thought it looked familiar. :P

Well, this part on page 1 looks for the end of a multi-line chat:


 -- 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


That is testing the last character of each line for the double-quote character. Now if you say a multi-line chat ends on a period or question-mark or something, you change it to:


 -- if ends with period or question-mark, end of multi-line chat
  if line:sub (-1) == '.' or 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


Now if that doesn't work, can you post what you did exactly, and what the lines from the MUD are?

And if you get errors, rather than saying "I got errors" can you post the exact error message, and what your code was that caused it?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Lawlimnatorization   (2 posts)  [Biography] bio
Date Thu 24 Dec 2009 07:33 AM (UTC)  quote  ]
Message
>.>

You just linked me back to the start of this post. I don't really know how to go about changing it to only end on punctuation. I tried just throwing everything except ' into the script and I just got errors, so now I've got it sitting on a period.
[Go to top] top

Posted by Nick Gammon   Australia  (15,754 posts)  [Biography] bio
Date Wed 23 Dec 2009 07:08 PM (UTC)  quote  ]
Message
Check this out:

Template:faq=7991 Please see the forum thread: http://gammon.com.au/forum/?id=7991.


In that thread, a little way down the page, I describe how to handle multi-line chats, and sending to another window. Rather than using a single multi-line trigger it uses a couple of triggers, where the start of a chat activates a second one.

In the multi-line example, it keeps processing chats until they end with a double-quote (by a simple search). You would just modify that to keep processing until they do *not* end with punctuation. Otherwise conceptually it would be very similar.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Lawlimnatorization   (2 posts)  [Biography] bio
Date Wed 23 Dec 2009 04:17 PM (UTC)  quote  ]

Amended on Wed 23 Dec 2009 04:19 PM (UTC) by Lawlimnatorization

Message
How would I go about making the multi-line trigger activate over a line that didn't end in punctuation? I know it leaves this pretty open, but the only true indicator on the MUD I play that somebody's chat message has ended is that it ended with a form of punctuation, usually a period it throws on the end if somebody forgot (or was simply too lazy) to add one themselves.

Edit: Thinking of the English language itself, it should probably also trigger from lines that end with a comma, due to the fact it indicates that only a portion of the sentence has passed.
[Go to top] top

Posted by Danthrall   (2 posts)  [Biography] bio
Date Sat 05 Dec 2009 12:03 AM (UTC)  quote  ]
Message
That did it. Updated my version, and it's working, all nifty-like. Thanks!
[Go to top] top

Posted by Nick Gammon   Australia  (15,754 posts)  [Biography] bio
Date Fri 04 Dec 2009 11:04 PM (UTC)  quote  ]
Message
What version of MUSHclient are you using? Version 4.43 may possibly fix this, as the style run colours sent to triggers are the updated ones as amended by other triggers.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Danthrall   (2 posts)  [Biography] bio
Date Fri 04 Dec 2009 10:52 PM (UTC)  quote  ]
Message
Alright, it took me a while to figure it out, but I finally got the new worlds to open up and everything. My only problem is that I can't see to get color-based triggers to carry over.

For instance, if I disable the plugin that allows the chat worlds to open, pages show up color coded... one for incoming, another for outgoing. When the plugin is enabled, however, the colors are gone.

I've even tried to make a set of triggers for the new world, as well, with no luck.
[Go to top] top

Posted by Nick Gammon   Australia  (15,754 posts)  [Biography] bio
Date Thu 12 Nov 2009 07:44 PM (UTC)  quote  ]
Message
This is because what is happening is that the trigger matches and omits the line, but the MUD is helpfully sending an extra blank line, which the trigger doesn't match.

I found this hard to fix for the individual matches (sometimes the blank lines were there and sometimes not), so I just use the plugin below that suppresses *all* blank lines.

There is a discussion about it somewhere else on this forum.

Template:saveplugin=Omit_Blank_Lines To save and install the Omit_Blank_Lines plugin do this:
  1. Copy between the lines below (to the Clipboard)
  2. Open a text editor (such as Notepad) and paste the plugin into it
  3. Save to disk on your PC, preferably in your plugins directory, as Omit_Blank_Lines.xml
  4. Go to the MUSHclient File menu -> Plugins
  5. Click "Add"
  6. Choose the file Omit_Blank_Lines.xml (which you just saved in step 3) as a plugin
  7. Click "Close"



<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Monday, July 07, 2008, 1:07 PM -->
<!-- MuClient version 4.31 -->

<!-- Plugin "Omit_Blank_Lines" generated by Plugin Wizard -->

<muclient>
<plugin
   name="Omit_Blank_Lines"
   author="Nick Gammon"
   id="87a0ec3649ab9a04d5ea618d"
   language="Lua"
   purpose="Omits blank lines from output"
   date_written="2008-07-07 13:06:47"
   requires="4.00"
   version="1.0"
   >
<description trim="y">
<![CDATA[
Omits completely empty lines from output.
]]>
</description>

</plugin>


<!--  Triggers  -->

<triggers>
  <trigger
   enabled="y"
   match="^$"
   omit_from_output="y"
   regexp="y"
   sequence="100"
  >
  </trigger>
</triggers>

</muclient>


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Flek   (3 posts)  [Biography] bio
Date Thu 12 Nov 2009 06:23 PM (UTC)  quote  ]
Message
One thing I have noticed and this is mush in general I think...
When I add the line
omit_from_output="y"
it will gag it from my main window but I still get a blank line in my scrolling.
Is there a way to fix this?
[Go to top] 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.


18,341 views.

This is page 1, subject is 5 pages long: 1 2  3  4  5  [Next page]

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]