Chat questions

Posted by Jeffrey F. Pia on Tue 27 Apr 2004 09:01 AM — 6 posts, 25,751 views.

#0
Most of the people on my MUD use zMud, and I've been able to successfully connect to their zChat, but have had some problems:

1) How do I get ANSI colors to work?
#chat nita Test @GGreen
<CHAT> You chat to Nita, 'Test @GGreen'


2) How do I change the default color of incoming chat? It's currently all red, unlike the outgoing text which is bright cyan surrounded by red.

3) For some reason Snoop isn't working, or returning any errors.
TRACE: Trace on
#snoop Nita
TRACE: Matched alias "#snoop *"


4) Any way to get triggers to fire based on Chat text?

That's all I've got for the moment. I'm guessing it's mainly because of zMud/Mushclient incompatibilities, but I haven't ruled out user ignorance yet either. :)
Australia Forum Administrator #1
Quote:

1) How do I get ANSI colors to work?


Well, &G isn't an ANSI colour, that is a MUD colour code. What you could do would be to make a simple script that does things like replace &G with the ANSI equivalents before sending the message. See the ANSI script function that will do that, given the appropriate number.

Quote:

2) How do I change the default color of incoming chat? It's currently all red, unlike the outgoing text which is bright cyan surrounded by red.


See the chat configuration dialog.

Quote:

3) For some reason Snoop isn't working, or returning any errors.


Seems to work for me. Did you have the chat plugin installed?

Quote:

4) Any way to get triggers to fire based on Chat text?


You can't use a trigger, it isn't incoming MUD text. However the chat plugin has a callback OnPluginChatMessage - you can add code to that, to match things, and take steps. See the plugin for an example.

#2
1) Ah gotcha... I'll have to read up on that.

2) Okay, that changed the entire line (except for the last ') to a different color. Even though it would have been nice to change only the words as opposed to the whole line, it's much better than the default color.

3) Yeah, I'm sure. The normal chat commands work, just not snoop. For what it's worth, she was able to snoop me just fine, but when I use the command it doesn't return anything at all.

4) Do I make the changes in the plugin itself? Just do an if message = 7 and send the sText to another Sub for parsing?
Australia Forum Administrator #3
Snoops

  1. What client does she use? I can try it with that.
  2. Does she have snoop enabled?
  3. It is possible that client is buggy in that it is ignoring the snoop command. I tested snooping from MUSHclient to MUSHclient.


Triggers

Actually you probably want OnPluginChatDisplay - that is the interface just before a message is displayed. You can filter it and then return FALSE to not display it (eg. if you display it yourself with a note, or if you want to ignore it).

You probably want to catch types like:


   4 Incoming Personal  
   5 Incoming Everybody 
   6 Incoming Group     


Yes, you would change the plugin itself. I would probably rename it as JeffChat.xml (on disk) or something like that, so that your changed version doesn't get overwritten next time you upgrade MUSHclient. Then use JeffChat as your plugin rather than Chat.
USA #4
Budding off of this old conversation, I have a question reguarding snoop:
Is there a way to have snoop view the world in the eyes of the player - currently it's just sending the basic MUD output to the viewer, not trigger modified. All trigger echos, substitutions, etc. are not showing up on my friends screen.

Any thoughts?

Matt
USA #5
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=2583

If you scroll down a bit you'll see the diagram about how the client deals with snooping (and that it's sent beforehand).

You could get around it, by implimenting your own snoop system with one of the custom message numbers.
And actually, plugin packet changing might occur before the snoop, so you could work around it like that.

As for notes, you'll see (in that thread) nicks reasonings for not allowing notes to be snooped. However, you can send a chat message in addition to your notes if you have a few things you need to send. You could either just chat it, or set up your own command (chat number) to have the other client note it as well (with a callback on the recieving end).