Separate chat window for Mushclient

Posted by Jypsierose on Mon 27 Jul 2015 09:52 PM — 19 posts, 68,055 views.

#0
My fiance and I both play Clok and use Mushclient to do so. He uses a Mushreader plugin while I do not have to at the moment. It is hard for him to catch the different chats while he is doing stuff such as fighting and forging, or even foraging. It is just as hard for me too sometimes because I am starting to lose my sight as well. Is it possible to have someone help us create a different chat window for mushclient for the game Clok if I were to give you the different chat commands? I know that Clok doesn't use all of the same ones that other MUD's do, and it uses a few that are different.
Australia Forum Administrator #1
How would a separate window help?

One idea that springs to mind here is something that Aardwolf does, and that is that the MUD lets you "catch" tells, and replay them later. Would that help you?
#2
How does it "catch" tells? And yes, that might just work. But I would need to know how it catches tells. Also having the separate window would help me because it would make it easier for me to be able to distinguish the chat message, tells, esp messages emotes and other "chatting".
Australia Forum Administrator #3
It's done by the MUD server, but the basic idea is that if you turn it on (which you might, in a battle), all incoming tells are saved into a special area. Then when you want them, they are replayed to you.

Now what MUSHclient could do is match incoming tells, and then omit them from output, but store them in a table, perhaps playing a "ding" or something to let you know that this has happened. Then when you type (say) "replay" it reads them back from the saved table (and deletes them).
#4
He used to use VIPMud and VIPMud had his chats in a different window that way he could track them easier. He is not completely blind so he can 'see' them somewhat, but sometimes his game scrolls so fast while he is working that he loses the chat. Also his computer will not allow for sounds from the game other than JAWS reading his screen for him. I saw that there was a way to redirect the chats to a seperate window, but I am not very good with code so I would not know how to adjust it to make it work for Clok for us both.
Australia Forum Administrator #5
Bear with me here. If you redirect chats to another window you'll want them read out? Or not? Because if you do that is now two (or more) competing windows that are trying to read out their contents, possibly at the same time.
#6
No, they don't need to be read out. at the same time. He wants to be able to click back and forth between the two windows. So, I am thinking that to accomplish what he wants perhaps the chat, tells, emotes, etc. should all just get redirected to the new window? I am not sure how that would work.

So, basically what he wants is for Jaws to pick up on what he is 'seeing' in the window that he has highlighted at the time and to basically ignore it from the other unless he switches. I know that he was able to do that with VIPmud, but he started having problems with VIPmud.
#7
Is it possible to do this at all?
Australia Forum Administrator #8
Well, anything's possible, more or less.

I'm having trouble visualizing this, so if I may ask a couple more questions ...

You want to hive off chats to a separate window during a battle, right? And not have them spoken at the time, I presume.

Now you want to "click" on this other window, and have them replayed? Just by clicking? Which one does it start at? The last one not read out? And what if you need it to stop reading them back? Do you want it to stop if you click away?

The mechanics of this are a bit unclear to me.
#9
I know that the way his VIPmud worked before he started having problems with it was that the chats all redirected to the 'second' window and he was able to click over to the window.

What it did was that it would read through the last message that was sent, but Jaws has this ability that lets him review the messages by using his up and down arrows to read previous messages. So that he can keep track of what is happening in the other 'chats'.

What happens for him with Mush right now is that the chats get lost in everthing else that is going on and you can only scroll back so far. in one window before it gets 'lost'.

So, yes, the chats, tells etc. would not be spoken at the same time that he is doing other stuff such as fighting, battling or other things like that.

But yes, it would also stop reading anything in the window that is not 'highlighted' at the time.
Amended on Wed 29 Jul 2015 04:22 AM by Jypsierose
#10
You referenced Aardwolf before. What I need is the same thing as their plugin that redirects their different chat messages to a different window, because just catching tells won't work for me or my fiance. We need it to redirect the messages for:

chat
question
ESP
say
ask
tell
whisper
sayto
says to



Can you help me out with something that will redirect those to another window? As I said before I am not really good at coding and I will give myself another migraine trying to figure it out.

There are also other 'languages' for the game that sometimes people speak in. How would those go to the new chat? Would each one have to be inputed into the code, or how would that work? Plus there are different tones that people can speak in.

Sorry for the edit, I had forgotten to add that part if the post.
Amended on Thu 30 Jul 2015 02:45 PM by Jypsierose
#11
I have been trying to set this plugin up on my own using an old thread that I found for making a plugin to redirect the chat here at:

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=7991

I just can't seem to get it to work even with following the instructions of what you say to do.
USA Global Moderator #12
If I understand this thread correctly, I think we're talking about something like this...

1. Chats get captured to a buffer.

2. An audible cue like maybe a short beep plays when new chats get buffered. (optional, but I think it would be useful)

3. The buffered chats are displayed to either a new world window or a miniwindow, optionally with big font or reverse contrast for better visibility.

4. The buffer display has up/down arrow key accelerators bound to it, disabled by default, that when enabled will move a virtual pointer through the buffered messages and sends the previous or next message to text-to-speech. Maybe also add a spacebar accelerator to send the current message through text-to-speech again without moving the virtual pointer.

If using a new world file, activation/deactivation of the accelerators seems straightforward by just clicking over to that window and then clicking back to the main one. If using a miniwindow, activation could be toggled by clicking on it or by some command alias before the accelerators are operational.

Does that sound right?

I don't know how screen readers work. I don't know if miniwindows get screenread or if they are "safe" on account of not being system text boxes. I don't know if new text in a world window can be exempted by default from screenreading. That would seem to be necessary in order to use a new window for this instead of a miniwindow.
Amended on Thu 30 Jul 2015 10:48 PM by Fiendish
#13
Yes, that sounds right.

The way the screen reader works is that the main window is what is read. So, the other window is exempted by default from screen reading until it becomes the "main" window.

Would it be easier to set this up to buffer the chat to a new world file?

And thank you both for helping me. I know its been a bit confusing and I am sorry about that.
Australia Forum Administrator #14
OK, let's try this. I'm assuming you have the Lua "SAPI speaker" plugin documented here:

http://gammon.com.au/forum/?id=10539

If not, it won't work until we adjust a few things.

I've adapted the Generic Chat plugin described here:

http://gammon.com.au/forum/?id=12855

Basically I added this function, and an alias to call it:


function chat_sapi (name, line, wildcards)

  if last_read_line >= #lines then
    CallPlugin ("463242566069ebfd1b379ec1", "say", "No more.")
    return
  end -- no more lines

  last_read_line = last_read_line + 1  -- this is now the last
  local styles = lines [last_read_line] [1]
  local full_line = ""
  
  while true do
    
    if last_read_line > #lines then
      break
    end -- no more lines
    
    if not styles then
      break
    end -- no styles
    
    for _, style in ipairs (styles) do
      full_line = full_line .. style.text
    end -- for

    if last_read_line >= #lines or    -- at end of buffer
       lines [last_read_line + 1] [2] then   -- start of a new line?
      break
    end -- done this batch of lines
  
    -- read the next one
    last_read_line = last_read_line + 1  -- this is now the last
    styles = lines [last_read_line] [1]
    
  end -- while

  print ("Speaking '" .. full_line .. "'")
  
  CallPlugin ("463242566069ebfd1b379ec1", "say", full_line)
  
end -- function chat_sapi


What this is going to do is implement an alias "chats sapi next". Now you can either type that, make it smaller (eg. "speak") or make a macro key (eg. F5) to call that alias.

The alias will speak the last unspoken line from the chat miniwindow. The miniwindow itself has the ability to have a nice large font in it (RH click on it to adjust the font).

The idea (at this stage) is that you notice things scrolling by in the chat window - with a large font this should be obvious, and then hit F5 to have the next un-heard one read out. If you have time, then hit F5 again for the next one, and so on. Eventually it will say "No more." so you know you have heard the last one.

You will find the plugin here: https://github.com/nickgammon/plugins/blob/master/Generic_Chat_Miniwindow.xml

RH-click on the "Raw" button on that page and then "Save Link as" to get the plugin file. Save that into your plugins folder and then install it.

It will run into trouble when the buffer fills up after 10000 lines, but let's test it initially.




Now you need to make your triggers. Make a world "script" file and put this into it:


function chattrigger (name, line, wildcards, styles)
  require "serialize"
  check (CallPlugin ("10778718503f0c91106745f5", "display", serialize.save_simple (styles)))
end -- chattrigger


To do this use the World configuration -> Scripts tab.

Now for each type of chat / say etc. make a trigger in the world, like this:


<triggers>
  <trigger
   enabled="y"
   match="You say '*'"
   omit_from_output="y"
   script="chattrigger"
   sequence="100"
  >
  </trigger>
</triggers>


Template:pasting
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


The important thing is that it matches on the line (eg. You say 'hi there'), it omits it from the output (so you don't see it or hear it) and it calls the chattrigger function you just added to the script file.

This copies the chat over to the chat plugin, where it will appear.
Australia Forum Administrator #15
You will want to turn timestamps off or you will keep hearing the exact time that the message arrived.

Type:


chats timestamps off 


... once you have the plugin installed OK.
#16
There is only one part I am unsure of what I am doing.


Quote:
Now you need to make your triggers. Make a world "script" file and put this into it:


function chattrigger (name, line, wildcards, styles)
require "serialize"
check (CallPlugin ("10778718503f0c91106745f5", "display", serialize.save_simple (styles)))
end -- chattrigger


To do this use the World configuration -> Scripts tab.



I went to the World configuration and then to the scripts tab. Do I put that function onto a note pad and then save it so that I can add it into the World script? Or how do I do that? And what kind of file do I save it as if I do save it onto notepad first?

Sorry about all the questions. I am just not very good at coding. I am a computer graphics geek for the most part.
Australia Forum Administrator #17
In World configuration -> Scripts tab.

Where it says "External Script File" hit the "New" button. Choose a name, like "myscripts.lua", and save that.

Then hit the "Edit Script" button and paste that code into it, then save the file. That completes that step.
#18
Thank you :)