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

MUSHclient chat system


Why use chat?

The chat system lets you do peer-to-peer chatting. That is, talk to other players directly without going through the MUD server. This could be useful for:


Features

Once connected (either by an incoming or outgoing call) you can:

The functions marked "(*)" are protected by flags, so you have to enable them before people can do that to you. This is to stop other people affecting your session, or viewing it, without permission.

All these features are on a per-world basis, so if you have multiple worlds open you can have multiple chat sessions as well. If you want chatting to interact between worlds this can be achieved with some simple scripting.

Privacy


Chat plugin

There is a new plugin supplied with MUSHclient "Chat.xml" - this provides an interface between the chat routines and the player. Install that plugin and then type:


chat:help
to see the various commands you can use.


Quick start guide ....


Other things you can do

Snooping

Snooping lets you see what someone else sees on their output window.

Send a file

You can send a file from one chat user to another.

The file is sumchecked as it is read in on the sending end, and also on the receiving end. Both sumchecks should agree. If both players are using MUSHclient you will see the sumchecks printed above each other, so you can simply do a visual scan.


<CHAT> Receiving a file from nick -- Filename:
 C:\WINNT\Profiles\nick\Desktop\tips.txt, Length: 3928 bytes (3.8 Kb).
<CHAT> Receive of file "C:\WINNT\Profiles\nick\Desktop\tips.txt" complete.
<CHAT> Sumcheck as written was:  A59C38AD DFA6EB94 3F2494B4 D29D9E5B 756370EF
<CHAT> Sumcheck from sender was: A59C38AD DFA6EB94 3F2494B4 D29D9E5B 756370EF

The "as written" line was generated by the receiving client, the "from sender" line was generated by the sending client. If both sumchecks agree (160 bits of sumcheck) then it is very likely that the file has been transferred successfully. If not, you should delete the received file and try again. If one of you is using a different client then that client will not generate the sumcheck. In that case you cannot be sure the file was received successfully.

Tip: If you have multiple files to send, or the file is large, we recommend using a file compression/archive utility, such as WinZip or PKzip, to create a single, compressed, file. This will be faster and easier to use. Also, archives will probably incorporate their own sumchecks as a further check of file integrity.

Note: You can only send or receive one file at a time, to each chat user. However you can send files simultaneously to different chat users, and keep chatting during the file transfer.

Send commands

You can send commands from one chat user to another.

Sending multiple lines

You can use the #paste command to send multiple lines to another chat user. You could do this to simply show something you see on the screen (eg. your inventory), or to exchange triggers, aliases etc.

To exchange aliases, triggers, timers, or similar, do this:


Scripting support

The chat features has detailed support in the MUSHclient scripting language. The follow new script routines have been added:

The following routine retrieves a list of the current chat sessions:

You can use the chat "ID"s (identifiers) returned from the above to find out more about a particular chat session, or set chat options:

The following routines have been added to improve handling of ANSI codes, because incoming and outgoing chat messages are supposed to be coloured using standard ANSI sequences:

New plugin callback routines have been added to let plugins interface with the chat system:

These routines let you automate things like whether callers are accepted, process or disgregard certain chat message types, display incoming messages in the default way, or customise it. You are also notified of new players joining the chat system, and ones that leave it.


Example of using scripting

Using a trigger to tell the group what is happening

The example below shows how you can use a trigger (this one matches "You are hungry.") to automatically send an "emote to all" to tell everybody.


<triggers>
  <trigger
   enabled="y"
   match="You are hungry."
   send_to="12"
   sequence="100"
  >
  <send>ChatEverybody &quot;is hungry&quot;, 1</send>
  </trigger>
</triggers>

When this fires, everybody sees:


nick is hungry

The "ChatEverybody" script routine sends a chat to everybody. The second argument is the "emote" argument. By setting it to 1 you emote rather than say.

Using a custom message number

The MudMaster chat system uses a single byte for chat messages numbers. The numbers 1 to 31 are already used, and zChat also uses 100 to 106 for its extensions to the chat system. Thus, numbers out of those ranges are free for user-chosen features. You should probably choose a number well away from those ranges (for example, 200 up) to implement your own messages. Note that 255 is taken as the "end of message" identifier, and numbers 256 and above will not fit into a single byte.

Below I will illustrate how you could exchange your "prompt line" with another player, so you can monitor their status as you both play the MUD.

  1. First, the "sending" player needs a trigger to capture the prompt, and send it with a custom message number to the other player ...

    
    <triggers>
      <trigger
       enabled="y"
       match="&lt;*hp *m *mv&gt;*"
       send_to="12"
       sequence="100"
      >
      <send>ChatMessage ChatGetID (&quot;bruce&quot;), 200, &quot;%0&quot;</send>
      </trigger>
    </triggers>
    

    This example sends the message to Bruce, but you could choose anybody, or make a loop to send to all players (using GetChatList). The ChatMessage script routine sends a "raw" chat message - it is not formatted in any way, and can thus contain any data of your choosing.

  2. Now Bruce needs to detect the incoming message 200 and react to it. This needs to be done in a plugin, because it uses a plugin callback to detect the chat message. By returning vbFalse it tells MUSHclient not to do any further processing for the message type 200, however other messages are to be processed in the nomral way.

    
    Function OnPluginChatMessage (id, message, sText)
    
    OnPluginChatMessage = vbTrue  ' default to process it
    
    if message = 200 then
      SetStatus GetChatInfo (id, 2) & ": " & sText
      OnPluginChatMessage = vbFalse  ' don't process again
    end if
    
    End Function

    The script uses GetChatInfo (id, 2) to find the actual chat name of the player with the supplied ID, so it will work for whatever name the incoming player has.

The beauty of this system is that it uses the chat system to exchange information with another player, however your screen is not cluttered up with messages. An bit more work and you could probably build some powerful automated systems that enhance playing on PK MUDs.


Configuration options

You can configure various aspects of the chat system by using world.SetOption and the following option names:

Option name Purpose
accept_chat_connections Are we accepting incoming chat calls?
auto_allow_snooping Can they can snoop (if enabled) without a further dialog?
chat_name Our chat name
chat_port Port number to receive incoming chat calls
chat_foreground_colour Foreground (text) colour for chat messages
chat_background_colour Background colour for chat messages
ignore_chat_colours Ignore imbedded colours in incoming chat messages?
validate_incoming_chat_calls Ask before accepting incoming chat calls?

Examples:


world.SetAlphaOption "chat_name", "Henry"
world.SetOption "accept_chat_connections", 1
world.SetOption "chat_port", 4090
world.SetOption "chat_foreground_colour", ColourNameToRGB ("green")

Hint: Most of these options can be indirectly set by using the appropriate script routine. For example, to accept incoming calls use:


 world.ChatAcceptCalls (port)

Using ChatAcceptCalls does three things:

  1. Sets the "accept_chat_connections" flag to true
  2. Changes the "chat_port" to the supplied port number
  3. Actually starts listening for calls (unless it is already accepting calls)

If you just set the option using world.SetOption the option is only noticed next time MUSHclient tries to accept a call.

Similarly, you can use:


 world.ChatNameChange (newname)

to change your chat name. Not only does this change the MUSHclient internal chat name, but notifies existing chat users of your name change.


Colours

The MudMaster chat system seems to rely on clients using the default chat colour of red text on black background. Even if you change the MUSHclient chat colour (as in the example above) you may find parts of incoming messages still in an undesired colour because of the imbedded colours codes.

If this bothers you, set the option "ignore_chat_colours" as described above. Then, chat messages will only appear in the colour you have specified (for the entire line) and any imbedded colour codes will be disregarded.


[Back] [Home]
Written by Nick Gammon - 5K

Comments to Gammon Software support

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

Page updated on Tuesday, 6 December 2005