ChatMessage
Script function world.ChatMessage Read about scripting Type Method Summary Sends a message to a chat user (raw format) Prototype `long ChatMessage(long ID, short Message, BSTR Text);` View list of data type meanings Description `This sends a "raw" chat message to the particular chat user identified by the chat ID. You would not normally use this, as this is a low-level routine which is used by other script functions (such as ChatPersonal). However you could use it to do custom chat messages (eg. use message number 200) which the receiving client could pick up in a plugin callback routine. For an example of doing that, see: http://www.gammon.com.au/mushclient/chat.htm#EXAMPLE Another possible use would be to send chat messages with custom colours, or custom formatting (eg. different colours). The "Message" argument is the chat message number, which is used at the start of the chat message. These numbers are currently defined: 1 Name_change 2 Request_connections 3 Connection_list 4 Text_everybody 5 Text_personal 6 Text_group 7 Message 8 Do_not_disturb 9 Send_action 10 Send_alias 11 Send_macro 12 Send_variable 13 Send_event 14 Send_gag 15 Send_highlight 16 Send_list 17 Send_array 18 Send_baritem 19 Version 20 File_start 21 File_deny 22 File_block_request 23 File_block 24 File_end 25 File_cancel 26 Ping_request 27 Ping_response 28 Peek_connections 29 Peek_list 30 Snoop 31 Snoop_data 105 Send_command The "Text" argument is the text of the message to be sent. It can be empty. See the chat specifications for more details about what should be in the text field. You do *not* need to put the message number at the start of the text field, nor do you need to put the message terminator (hex FF) at the end of the text field. MUSHclient does that for you automatically. Each call is identified by its "chat ID" - each chat session has a unique ID, which starts at one, and is incremented by one, per world. You can use GetChatList to find a list of chat IDs that is current. You can use ChatGetID to find the chat ID corresponding to a particular chat name.` VBscript example
    ChatMessage ChatGetID ("fred"), 30, ""  ' start snooping Fred
    '
    '  do a custom coloured "chat to everybody" (using bold magenta)
    '
    ' (The chat is only sent to connection Bruce, however)
    '

    ChatMessage ChatGetID ("bruce"), 4, _
                 vbCrLf & ANSI (35) & ANSI (1) & _
                 "<CHAT> The chat system is great!" & _
                 vbCrLf
Jscript example
    ChatMessage (ChatGetID ("fred"), 30, "");  // start snooping Fred
    //
    //  do a custom coloured "chat to everybody" (using bold magenta)
    //
    // (The chat is only sent to connection Bruce, however)

    ChatMessage (ChatGetID ("bruce"), 4,
                 "\n" + ANSI (35) + ANSI (1) +
                 "<CHAT> The chat system is great!\n");
PerlScript example
    ChatMessage (ChatGetID ("fred"), 30, "");  # start snooping Fred
    #
    #  do a custom coloured "chat to everybody" (using bold magenta)
    #
    # (The chat is only sent to connection Bruce, however)

    ChatMessage (ChatGetID ("bruce"), 4,
                 "\n" . ANSI (35) . ANSI (1) .
                 "<CHAT> The chat system is great!\n");
Python example
    world.ChatMessage (world.ChatGetID ("fred"), 30, "")  # start snooping Fred
    #
    #  do a custom coloured "chat to everybody" (using bold magenta)
    #
    # (The chat is only sent to connection Bruce, however)

    world.ChatMessage (world.ChatGetID ("bruce"), 4,
                 "n" + world.ANSI (35) + world.ANSI (1) +
                 "<CHAT> The chat system is great!n")
Lua example
    ChatMessage (ChatGetID ("fred"), 30)  -- start snooping Fred
    --
    --  do a custom coloured "chat to everybody" (using bold magenta)
    --
    -- (The chat is only sent to connection Bruce, however)

    ChatMessage (ChatGetID ("bruce"), 4,
                 "n" .. ANSI (35) .. ANSI (1) ..
                 "<CHAT> The chat system is great!n")
Lua notes
    The message is optional and defaults to the empty string.
Return value
    eChatIDNotFound: That chat ID is not connected
    eOK: Sent OK
View list of return code meanings See Also ... Topics Chat system Getting started Functions ChatAcceptCalls (Accepts incoming chat calls) ChatCall (Calls a chat server (makes an outgoing call) using the MudMaster chat protocol) ChatCallzChat (Calls a zChat chat server (makes an outgoing call)) ChatDisconnect (Disconnects a current chat call) ChatDisconnectAll (Disconnects all current chat calls) ChatEverybody (Sends a chat message to every connected chat user) ChatGetID (Looks up what chat ID (identifier) corresponds to a particular chat name) ChatGroup (Sends a chat message to every connected chat user in the specified group) ChatID (Sends a chat message to a particular chat session) ChatNameChange (Changes your chat name) ChatNote (Does a note using ANSI codes for the chat system) ChatPasteEverybody (Pastes the clipboard contents to every connected person) ChatPasteText (Pastes the clipboard contents to that person) ChatPeekConnections (Sends a "peek connections" message to the specified chat user) ChatPersonal (Sends a chat message to a particular person) ChatPing (Sends a ping message to the specified chat user) ChatRequestConnections (Sends a "request connections" message to the specified chat user) ChatSendFile (Starts sending a file to the specified chat user) ChatStopAcceptingCalls (Stops this world from accepting chat calls) ChatStopFileTransfer (Stops a file transfer in progress to that chat user) GetChatInfo (Get information about a chat connection) GetChatList (Gets the list of chat sessions) GetChatOption (Gets the value of a chat session option) SetChatOption (Sets the value of a chat session option) (Help topic: function=ChatMessage) Documentation contents page