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

ChatNote

Script function

world.ChatNote

Read about scripting

Type

Method

Summary

Does a note using ANSI codes for the chat system

Prototype

void ChatNote(short NoteType, BSTR Message);

View list of data type meanings

Description

This is used internally by the chat system to put notes on the screen in the current chat colour.

First, it calls the plugin callback routine "OnPluginChatDisplay" for each installed plugin, and passes the NoteType and Message to it. This gives the plugin a chance to do its own thing with the message (for instance, display it in a notepad window).

If any plugin returns False (0) then ChatNote exits without doing anything else (including calling other plugins later down the list).

However if all plugins return true (or don't have a "OnPluginChatDisplay" handler) then ChatNote then does the following:

1. Save the current note colour.
2. Change the note colour to the "chat_foreground_colour" and "chat_background_colour" from the world preferences. If they are both the same, it takes the default chat colour of red on black.
3. Removes a leading newline, if any.
4. Removes a trailing newline, if any.
5. If the world preferences option "ignore_chat_colours" is set, the ANSI codes are stripped from the message.
6. The message is displayed (using AnsiNote).
7. The saved note colour is restored.


The NoteType argument is used to identify "types" of chats to the plugin callback routine. These types are currently defined:

0 Connection attempt
1 Session start, end
2 Name Change
3 Message
4 Incoming Personal
5 Incoming Everybody
6 Incoming roup
7 Outgoing Personal
8 Outgoing Everybody
9 Outgoing Group
10 Peek List
11 Connection List
12 Ping
13 Information
14 File
15 Snoop Data
16 Command

You could use those to send some types of messages (eg. connection attempts) to the main world window, but other types to a notepad window.


Available in MUSHclient version 3.37 onwards.



VBscript example

ChatNote 3, "<CHAT> My plugin is now installed"


Jscript example

ChatNote (3, "<CHAT> My plugin is now installed");


PerlScript example

ChatNote (3, "<CHAT> My plugin is now installed");


Python example

world.ChatNote (3, "<CHAT> My plugin is now installed")


Lua example

ChatNote (3, "<CHAT> My plugin is now installed")


Lua notes

The message is optional and defaults to the empty string.


Return value

Nothing.


See Also ...

Topics

Chat system
Getting started

Functions

(ANSI) Generates an ANSI colour sequence
(AnsiNote) Make a note in the output window from text with ANSI colour codes imbedded
(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
(ChatMessage) Sends a message to a chat user (raw format)
(ChatNameChange) Changes your chat name
(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
(ColourNote) Sends a message to the output window in specified colours
(GetChatInfo) Get information about a chat connection
(GetChatList) Gets the list of chat sessions
(GetChatOption) Gets the value of a chat session option
(GetOption) Gets value of a named world option
(Note) Sends a note to the output window
(SetChatOption) Sets the value of a chat session option
(SetOption) Sets value of a named world option

(Help topic: function=ChatNote)

Documentation contents page


Search ...

Enter a search string to find matching documentation.

Search for:   

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]