Register forum user name Search FAQ

MUSHclient scripting

Description of MUSHclient world function: world.IsConnected


Name IsConnected
Type Method
Summary Tests to see if the world is connected to the MUD server
Prototype boolean IsConnected();
Description

This returns TRUE if the world is currently connected.

See GetInfo (227) for more details about the exact connection status.

There are actually a number of connection "phases" because connection is not synchronous. That is, connecting takes time.

If you are using a proxy server, with a username/password, there are 8 phases as described below. Not all phases are necessarily done, for example if the MUD address is already a "dotted decimal" number then a MUD name lookup is not required.

They are:

0=not connected (and not attempting to connect)
1=MUD name lookup (converting MUD name to an IP address)
2=Proxy server name lookup (converting proxy server name to an IP address)
3=connecting to MUD (establishing TCP/IP connection to the MUD)
4=connecting to proxy server (establishing TCP/IP connection to the proxy server)
5=proxy server phase 1 (sent SOCKS authentication method, awaiting confirmation)
6=proxy server phase 2 (sent SOCKS username/password, awaiting confirmation)
7=proxy server phase 3 (sent SOCKS connect details, awaiting confirmation)
8=connected to MUD (fully connected)

Strictly speaking, IsConnected returns true if the connection phase is 8 (connected to MUD) and false for any other phase.

VBscript example
world.note world.IsConnected
Jscript example
world.note(world.IsConnected());
PerlScript example
$world->note($world->IsConnected());
Python example
world.note(world.IsConnected)
Lua example
Note(IsConnected())
Returns TRUE if world connected
FALSE if not connected

Note: TRUE is a non-zero value, FALSE is the value 0.

See also ...

Function Description
Connect Connects the world to the MUD server
Disconnect Disconnects the world from the MUD server
GetConnectDuration Returns the number of seconds this world has been connected.
GetInfo Gets information about the current world

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.