Forum rules

- Use common sense and be respectful towards each other at all times, even when disagreeing.- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.

Within Javascript based triggers and aliases, you can interact with the mud and the client using the gwc object.

gwc.connection.send(output, [resolve aliases])

Send command to Genesis. Supply true as the second argument to enable alias resolving.

gwc.output.color(foreground, background)

Changes the color of the last line received from the mud. You can omit the background color argument if you do not want to change it.

gwc.output.append(text)

Adds a new line to the output window with the specified text.

gwc.output.replace(searchvalue, newvalue. [use html])

Perform a string replace on the last output line of the mud. Replace uses a string replace on either the html or text value (depending on the third argument).

gwc.userdata

Object available to store information. All data contained is persisted to the server and will be available as soon as you login.

Note that the userdata object is persisted after the scripts have fired. If you adjust the contents of the userdata object outside of this (for instance by using a setTimeout), it will not be stored until a new trigger has fired.

gwc.gmcp.data

Object containing the stored GMCP information. This object is automatically updated as new information is received. However, in case of GMCP triggers the new data has not yet been applied (the newest data can be accessed through the 'args' variable.)

Generic Mud Communication ProtocolGenesis supports the Generic Mud Communication Protocol, or GMCP, to pass easily parsable information to your mudclient. It's an extension to the normal telnet protocol, and sends messages invisible to the user (even when running a client that do not support GMCP).

The primary purpose of GMCP is to improve the availability of information relevant to your game without providing players with a distinct advantage. As such, any information passed through the protocol will have the same precision / textual representation as through the normal text interface.

At the moment of writing, the Mudlet and CMud client (as of version 3.22) support the GMCP protocol. This only includes the handling of the messages and a variety of the core features that subscribe to the broad- casts provided by the mudlib. It is up to the player to add trigers and or other scripts to use the provided information.

GMCP Messages are formed of a package name, and an optional JSON payload separated by a space. Normally the mud client will handle the parsing and will provide the information in it's native format to the scripts. For exact details, you will need to look into the documentation of your mud- client.

Broadcasts are only sent when you are subscribed to the packages to which they belong. Packages names follow a parent -> child format, which each level separated by a dot. If you subscribe to the Core package, you will receive all broadcasts for packages that start with Core, if you were to subscribe to Core.Subpackage, you would only get those and it's children.

Send upon disconnect. Payload is a string detailing the reasons for the disconnect.

Char Broadcasts---------------Char.StatusVars

Send upon subscription to the Char package, contains and object as payload where each key value pair contains the technical key (used in Char.Status) and a text value containing a more humanly readable caption.

Example: { "level" : "Level", "race" : "Race" }

Char.Status

Upon subscription to the Char package, an initial set of status variables is sent. After this initial broadcast, subsequent broadcasts will only contain changed variables.

Similar to the status broadcast, the initial broadcast will contain all initial values, subsequent broadcasts include only the updated values.

Example: { "health" : "very hurt", "mana" : "in full vigour" }

Currently the following information is included in the vitals broadcast:

food, drink, fatigue, mana, health, intoxication

Client commands---------------Core.Hello

First message send after GMCP has been negotiated. Payload is an object, containing the keys "client" and "version".

Example: { "client" : "GMC", "version" : "1.0.1" }

Core.Supports.Set Core.Supports.AddCore.Supports.Remove

Commands to subscribe to the various broadcasts offered by the mudib (see supported packages), the payload is an array with strings, containing the packages and versions.

Example: [ "Core 1", "Room 1" ]

If the version number is ommited, version 1 is assumed. The set command replaces the previous list of subscribed packages. Add adds the new packages to the existing list, overwriting the version of existing modules with the new one supplied (even if it is lower than the existing version).

You can unsubscribe from broadcasts using the Core.Supports.Remove command. Version numbers are optional and will be ignored when supplied.

Core.Ping

Check to see if the server is still responding. A Core.Ping message will be sent in reply, containing no payload.

Char.Login

Only valid while no user is logged in. Contains an object as payload with keys name and password. Upon successfull validation of the credentials, the user is logged in.

Example: { "name" : "Eowul", "password" : "topsecret" }

Char.Skills.Get

Request an up to date skill-list for the logged in player. Data is returned based on the parameters given.

When no parameters are supplied, a list of all known skill- groups is returned using the Char.Skills.Groups package name and containing an array of strings as the payload.

Example: [ "General", "Weapon" ]

In order to get the skills for a specific group (or using 'All' to get all available skills regardless of group), supply an object as the commmands payload, using 'group' as key and the group name as value. This will return a list of skills and their values through the Char.Skills.List package. The payload is an object with the group name repeated with the 'group' key, and the list of skills (another object) using the 'list' key.

Unlike most other commands, the numerical value of the skill is returned as there is a one to one mapping with it's textual counterpart.

Should you only be interested in the values of a single skill, you can supply an object as payload with both a group and a name key, and the skill data will be returned using the Char.Skills.Info packagename, with an object as payload, containing the group, name, info and value keys.

The levels for health, mana and fatigue were hard-coded into the client in order to provide the health bars.This has now been made dynamic as it turned out that skipping to 0 for "feeling well" was not conducive to the mental health of users.Consequently, the following packages are now supported.

Code:

Char.Vitals.Get

Request an up to date list of the possible levels for vitals. Data is returned based on the parameters given.

When no parameters are given, a list of all supported vitals is returned using the Char.Vitals.List package and containing an array of strings as the payload.

Char.Vitals.List Example: [ "health", "mana" ]

In order to get the levels for one more more vitals, it accepts a single vital, an array of vitals or "All" to get the full list, which will be sent with the package Char.Vitals.Levels. The payload is an object with as keys the vitals, and an array of the levels as argument.

The GMCP interface for maps has been changed. The complete ASCII map is now passed with GMCP, along with the coordinates. This way the client doesn't have to rely on the maps being available before from a certain location. For this Room.Info has been amended with the coordinates. This is called when the player moves to another room.

Code:

Room.Info

Upon subscription of the Room package it will send information about the environment the player is in. The payload for each room is an object with the following keys:

id - A unique identifier for the room. This will remain static as long as the code of the room isn't moved. short - The short description of the room. exits - An array listing the exits of the room. doors - An array listing the exits of the room reachable through a door. x, y - Coordinates of the room on the map. Omitted if the room isn't on the map. Note x=0 will never happen, so you can test for that. The zoomx, zoomy are only given if there is a zoomed map.

In addition, a new Room.Map has been created, that is called whenever the player moves to a new section of the map.

Code:

Room.Map

This package is sent when a player enters into a new map area. It contains the map graphics and optionally the zoomed map graphics.

Example: { "map" : "map graphics", "zoom" : "zoomed map graphics" }

Note, the Room.Map is NOT called when the player moves to an area that isn't covered by the Map. Whether the player is on the map can be determined by the Room.Info.X being positive (X=0 will not happen on maps). The presence of the zoom function can be determined by the Room.Info.zoomx being positive.

Information about the team you are in is now available through the Char.Team package:

Code:

Char.Team

This will send information about the team you are in. If you are not in a team (anymore) it sends an empty package { }. The following info is sent:

- leader - the name of your leader, or "You" if you are the leader. - members - the names of the members of the team. If you are a member, it does not include yourself (only your team mates). - follow - "follow" or "stay", depending on the leader's instructions.

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum