Client API
From TargetWiki
[edit]
External API
The Client API has access to the following external API's:
[edit]
Internal API
In addition, client scripts have access to the 'client' API, which is composed of:
- client.eventhandler()
- This returns a standard Targetware event handler. When the event handler's function(s) are called, the first argument indicates the type of event.
- client.login. This will be followed by two additional arguments. The first is the numerical network identifier for the player logging in, the second is a string containing the name of the player logging in.
- client.logout. This has the same arguments as client.login.
- client.message. This also has the same arguments as client.login, but can be followed by an arbitrary number of additional arguments. This is the event that is called when the Server API sends a message to the client.
- client.quit()
- This logs off the server, terminates the client script, and returns control to the main Targetware interface.
- client.send()
- This sends a message to the server. Zero or more arguments can be included - the server will receive them as a message. The additional arguments can be nil, booleans, numbers, strings, or tables that can be derived from a configuration file only.
