Register forum user name Search FAQ

MUSHclient scripting

Description of MUSHclient world function: world.ChatCall


Name ChatCall
Type Method
Summary Calls a chat server (makes an outgoing call) using the MudMaster chat protocol
Prototype long ChatCall(BSTR Server, long Port);
Description

Attempts to establish a chat call to another client. If you know the other client is using zChat you may wish to use ChatCallzChat instead which uses the zChat protocol.

You specify the TCP/IP address and the port number. If the port number is zero the default chat port of 4050 is used.

Because of the asynchronous nature of TCP/IP a "good" status from this call does not necessarily mean you will establish a chat session, it just means it has succeeded in starting the process.

In order to establish a chat session, MUSHclient must:

1. Look up the name using the Domain Name Server (DNS) unless a dotted-decimal name was given - this may take a few seconds.
2. Connect to the chat server - this may take a few more seconds
3. Attempt to negotiate a chat session by sending "CHAT:" to the chat server
4. Await a response - this may take a while if the player at the other end is deciding whether to accept the connection or not.
5. Finally, if all goes well, the chat session is established.

To know if the session was really established you need to use the plugin callback routine "OnPluginChatNewUser" - this notifies you when a new user is established.


Note: Available in version 3.37 onwards.


VBscript example
ChatCall "123.45.67.89", 0     ' call on default port
ChatCall "123.45.67.89", 4060  ' call on port 4060
ChatCall "myfriend.hisdomain.com", 0    ' call on default port using name
Jscript example
ChatCall ("123.45.67.89", 0);     // call on default port
ChatCall ("123.45.67.89", 4060);  // call on port 4060
ChatCall ("myfriend.hisdomain.com", 0);    // call on default port using name
PerlScript example
ChatCall ("123.45.67.89", 0);     # call on default port
ChatCall ("123.45.67.89", 4060);  # call on port 4060
ChatCall ("myfriend.hisdomain.com", 0);    # call on default port using name
Python example
world.ChatCall ("123.45.67.89", 0)     # call on default port
world.ChatCall ("123.45.67.89", 4060)  # call on port 4060
world.ChatCall ("myfriend.hisdomain.com", 0)    # call on default port using name
Lua example
ChatCall ("123.45.67.89")     -- call on default port
ChatCall ("123.45.67.89", 4060)  -- call on port 4060
ChatCall ("myfriend.hisdomain.com")    -- call on default port using name
Lua notes
The Port argument is optional. If omitted it defaults to 4050.
Returns eCannotCreateChatSocket: Cannot start call - perhaps all sockets are in use?
eCannotLookupDomainName: Cannot start looking up domain name
eOK: Call process started OK
Introduced in version 3.37

See also ...

Function Description
ChatAcceptCalls Accepts incoming chat calls
ChatCallzChat Calls a zChat chat server (makes an outgoing call)
ChatDisconnect Disconnects a current chat call
ChatDisconnectAll Disconnects all current chat calls
ChatStopAcceptingCalls Stops this world from accepting chat calls

Search for script function

Enter a word or phrase in the box below to narrow the list down to those that match.

The function name, prototype, summary, and description are searched.

Search for:   

Leave blank to show all functions.


Return codes

Many functions return a "code" which indicates the success or otherwise of the function.

You can view a list of the return codes


Function prototypes

The "prototype" part of each function description lists exactly how the function is called (what arguments, if any, to pass to it).

You can view a list of the data types used in function prototypes


View all functions

[Back]

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