Register forum user name Search FAQ

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 ➜ How to make a separate chats window

How to make a separate chats window

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1  2  3 4  5  6  7  8  

Posted by Zylogia   (12 posts)  Bio
Date Reply #30 on Sat 07 Jun 2008 12:54 AM (UTC)

Amended on Sat 07 Jun 2008 12:55 AM (UTC) by Zylogia

Message
OK, I will try the suppression idea.

However, the sequence is not quite as you listed. I do not get the status line unless (1) I manually hit Enter key, or (2) I get a chat line.

Quote:
(OOC) Orion: Hoy.
H:Healthy, S:Energetic, K:Energetic, F: 100, Camday night

(OOC) Namino blinks.
H:Healthy, S:Energetic, K:Energetic, F: 100, Camday night

(OOC) Koreabard: great, thanks
H:Healthy, S:Energetic, K:Energetic, F: 100, Camday night


Basically, the Chat line seems to end with a newline, which gets processed by MUSHclient and sent back to the MUD, which then echoes the status line.

Thus, it seems that the suppression of output to the main client window is not complete -- the newline character is allowed.
Top

Posted by Nick Gammon   Australia  (23,068 posts)  Bio   Forum Administrator
Date Reply #31 on Sat 07 Jun 2008 01:05 AM (UTC)
Message
There is nothing in that first plugin that sends anything back to the MUD.

You said you get the status line after a chat line, and the problem occurs after a chat line appears.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Zylogia   (12 posts)  Bio
Date Reply #32 on Sat 07 Jun 2008 09:53 PM (UTC)
Message
Hmmm. OK. Given the response, I'll ask a different question.

Given that I receive two lines from the mud, like this

(OOC)Sometext \n
H:Status \n

How do I suppress the newline (\f or \r or \n, I don't know which) in the original window when I send the text to the RoD Chats window?

I've tried a simple trigger (to omit from output) based on ^H:.* and it suppresses everything except the new line. (That is, when status line comes from MUD, I end up with a blank line in the client main window.)

Sorry to be dense... And thanks for your patience and help.
Top

Posted by Nick Gammon   Australia  (23,068 posts)  Bio   Forum Administrator
Date Reply #33 on Sat 07 Jun 2008 10:49 PM (UTC)
Message
Based on your previous example:


(OOC) Orion: Hoy.\n
H:Healthy, S:Energetic, K:Energetic, F: 100, Camday night\n
\n
(OOC) Namino blinks.\n
H:Healthy, S:Energetic, K:Energetic, F: 100, Camday night\n
\n
(OOC) Koreabard: great, thanks\n
H:Healthy, S:Energetic, K:Energetic, F: 100, Camday night\n


I have added the newlines to show the idea. I assume you are just sitting there, and some chats come in.

Your trigger moves the chat to the other window, but, per chat line, you are left with two other lines - one blank, and one status.

One approach to get rid of the blank lines is to make another trigger, like this:


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


That will omit every blank line you get (except ones you type yourself). To make this work you must go to File -> Global Preferences -> General and check "Regular expressions can match on an empty string".


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,068 posts)  Bio   Forum Administrator
Date Reply #34 on Fri 20 Jun 2008 05:47 AM (UTC)

Amended on Fri 20 Jun 2008 05:48 AM (UTC) by Nick Gammon

Message
To simplify this, version 4.28 now has a "getworld" module. The plugin could now look like this:


<?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), &quot;.+"
   regexp="y"
   script="chat_redirect"
   omit_from_output="y"
   sequence="100"
  >
  </trigger>

  <trigger
   enabled="y"
   match="^You (tell|whisper) .+, &quot;.+"
   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 = "RoD chats"
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>

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Chyort   USA  (58 posts)  Bio
Date Reply #35 on Tue 29 Jul 2008 06:22 PM (UTC)
Message
I have multiple worlds reporting to the same window, using the plugin on the first page.

And I'm just wondering, how can i record what world it originated from, and possibly timestamp it.


For example. lets say i have 3 worlds. A B and C

A is the Chat_world

and i get a message on B, instead of
Whoever tells you 'whatever'
being sent to the chat_world it would show something like
(Recieved from B, at Hour/minute) Whoever tells you 'whatever'
Top

Posted by Nick Gammon   Australia  (23,068 posts)  Bio   Forum Administrator
Date Reply #36 on Tue 29 Jul 2008 09:16 PM (UTC)

Amended on Tue 29 Jul 2008 09:17 PM (UTC) by Nick Gammon

Message
The first page? Well in the middle is the stuff that sends the text:


 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


You would need to change it to something like:


 if w then  -- if present

  
    w:ColourTell ("white", "", "Received from: " .. WorldName ())
    w:ColourTell ("white", "", os.date (" at %H:%M : "))


    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

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Chyort   USA  (58 posts)  Bio
Date Reply #37 on Tue 29 Jul 2008 09:45 PM (UTC)
Message
yeah, i know enough to know where i needed to change stuff, but not enough to know what to add/change :P and it works great now.

Thanks
Top

Posted by Zeyomie   (5 posts)  Bio
Date Reply #38 on Thu 16 Oct 2008 05:12 PM (UTC)
Message
Hi. I'm a newbie to all of this, and well I'm having issues with the plugin. Everytime someone says something I get a huh? in my main window. I copied the plugin as directed, but I used my own triggers, just adjusted them as needed.

I'm not sure what i've done wrong to keep getting this huh? across my screen.

These are my triggers, maybe this is where the problem is? I set it up to move pages, and channel chats.


<triggers>
<trigger
enabled="y"
match="^.+ pages\: .+$"
omit_from_output="y"
regexp="y"
script="redirect"
sequence="100"
>
<send>%0</send>
</trigger>
<trigger
enabled="y"
match="^\[.+\] .+$"
omit_from_output="y"
regexp="y"
script="redirect"
sequence="100"
>
<send>%0</send>
</trigger>
<trigger
enabled="y"
match="^From afar, .+$"
omit_from_output="y"
regexp="y"
script="redirect"
sequence="100"
>
<send>%0</send>
</trigger>
<trigger
enabled="y"
match="^Long distance to .+$"
omit_from_output="y"
regexp="y"
script="redirect"
sequence="100"
>
<send>%0</send>
</trigger>
<trigger
enabled="y"
match="^You paged .+$"
omit_from_output="y"
regexp="y"
script="redirect"
sequence="100"
>
<send>%0</send>
</trigger>


</triggers>
Top

Posted by Nick Gammon   Australia  (23,068 posts)  Bio   Forum Administrator
Date Reply #39 on Thu 16 Oct 2008 07:28 PM (UTC)
Message
Remove the %0 from the "send" box. What you are doing is echoing back the chat to the MUD, so for example if you get:


From afar, Nick smiles


Your trigger sends back to the MUD:


From afar, Nick smiles


So naturally it replies "huh?".

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Zeyomie   (5 posts)  Bio
Date Reply #40 on Fri 17 Oct 2008 12:36 AM (UTC)

Amended on Fri 17 Oct 2008 12:44 AM (UTC) by Zeyomie

Message
I removed the <send>%0</send> from the triggers, but it still does it. :/
Top

Posted by Nick Gammon   Australia  (23,068 posts)  Bio   Forum Administrator
Date Reply #41 on Fri 17 Oct 2008 02:08 AM (UTC)
Message
Well can you copy the whole plugin and paste it into the forum here? It should fit.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Zeyomie   (5 posts)  Bio
Date Reply #42 on Fri 17 Oct 2008 02:28 AM (UTC)
Message
I have it disabled at the moment. but here is the plugin.

<?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="^.+ pages\: .+$"
omit_from_output="y"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>
<trigger
enabled="y"
match="^\[.+\] .+$"
omit_from_output="y"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>
<trigger
enabled="y"
match="^From afar, .+$"
omit_from_output="y"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>
<trigger
enabled="y"
match="^Long distance to .+$"
omit_from_output="y"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>
<trigger
enabled="y"
match="^You paged .+$"
omit_from_output="y"
regexp="y"
script="redirect"
sequence="100"
>
</trigger>


</triggers>

<!-- Script -->


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

end -- function redirect

]]>
</script>
</muclient>
Top

Posted by Nick Gammon   Australia  (23,068 posts)  Bio   Forum Administrator
Date Reply #43 on Fri 17 Oct 2008 04:36 AM (UTC)
Message
OK, thanks - and now can you copy and paste an example of the output that causes it? (eg. From afar, Nick sighs).

That way I know which trigger is being used.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,068 posts)  Bio   Forum Administrator
Date Reply #44 on Sat 18 Oct 2008 01:12 AM (UTC)
Message
When you changed the plugin, did you reinstall it? Simply changing the file won't do anything while it is loaded in memory. In the plugin list, click the Reinstall button to do that.

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


393,458 views.

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

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.