ChatNote
Script function

world.ChatNote

DOC_scripting Read about scripting

Type

Method

Summary

Does a note using ANSI codes for the chat system

Prototype

void ChatNote(short NoteType, BSTR Message);

DOC_data_types 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.



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

DOC_chat Chat system
DOC_starting Getting started

Functions

FNC_ANSI ANSI (Generates an ANSI colour sequence)
FNC_AnsiNote AnsiNote (Make a note in the output window from text with ANSI colour codes imbedded)
FNC_ChatAcceptCalls ChatAcceptCalls (Accepts incoming chat calls)
FNC_ChatCall ChatCall (Calls a chat server (makes an outgoing call) using the MudMaster chat protocol)
FNC_ChatCallzChat ChatCallzChat (Calls a zChat chat server (makes an outgoing call))
FNC_ChatDisconnect ChatDisconnect (Disconnects a current chat call)
FNC_ChatDisconnectAll ChatDisconnectAll (Disconnects all current chat calls)
FNC_ChatEverybody ChatEverybody (Sends a chat message to every connected chat user)
FNC_ChatGetID ChatGetID (Looks up what chat ID (identifier) corresponds to a particular chat name)
FNC_ChatGroup ChatGroup (Sends a chat message to every connected chat user in the specified group)
FNC_ChatID ChatID (Sends a chat message to a particular chat session)
FNC_ChatMessage ChatMessage (Sends a message to a chat user (raw format))
FNC_ChatNameChange ChatNameChange (Changes your chat name)
FNC_ChatPasteEverybody ChatPasteEverybody (Pastes the clipboard contents to every connected person)
FNC_ChatPasteText ChatPasteText (Pastes the clipboard contents to that person)
FNC_ChatPeekConnections ChatPeekConnections (Sends a "peek connections" message to the specified chat user)
FNC_ChatPersonal ChatPersonal (Sends a chat message to a particular person)
FNC_ChatPing ChatPing (Sends a ping message to the specified chat user)
FNC_ChatRequestConnections ChatRequestConnections (Sends a "request connections" message to the specified chat user)
FNC_ChatSendFile ChatSendFile (Starts sending a file to the specified chat user)
FNC_ChatStopAcceptingCalls ChatStopAcceptingCalls (Stops this world from accepting chat calls)
FNC_ChatStopFileTransfer ChatStopFileTransfer (Stops a file transfer in progress to that chat user)
FNC_ColourNote ColourNote (Sends a message to the output window in specified colours)
FNC_GetChatInfo GetChatInfo (Get information about a chat connection)
FNC_GetChatList GetChatList (Gets the list of chat sessions)
FNC_GetChatOption GetChatOption (Gets the value of a chat session option)
FNC_GetOption GetOption (Gets value of a named world option)
FNC_Note Note (Sends a note to the output window)
FNC_SetChatOption SetChatOption (Sets the value of a chat session option)
FNC_SetOption SetOption (Sets value of a named world option)

(Help topic: function=ChatNote)

DOC_contents Documentation contents page