diff --git a/docs/API-Reference.md b/docs/API-Reference.md index 099909e..74b6398 100644 --- a/docs/API-Reference.md +++ b/docs/API-Reference.md @@ -123,6 +123,7 @@ Walter Higgins * [Usage](#usage-8) * [alias Plugin](#alias-plugin) * [Examples](#examples-2) + * [chat Plugin](#chat-plugin) * [Classroom Plugin](#classroom-plugin) * [classroom.allowScripting() function](#classroomallowscripting-function) * [Commando Plugin](#commando-plugin) @@ -2479,6 +2480,37 @@ Aliases can be used at the in-game prompt by players or in the server console. Aliases will not be able to avail of command autocompletion (pressing the TAB key will have no effect). +## chat Plugin + +This plugin lets players choose a text color to use when chatting. Players can list colors by typing... + + /jsp list_colors + +... and can set the color to use when chatting by typing... + + /jsp chat_color {color} + +... where {color} is one of the following colors... + + * black + * blue + * darkgreen + * darkaqua + * darkred + * purple + * gold + * gray + * darkgray + * indigo + * brightgreen + * aqua + * red + * pink + * yellow + * white + +This plugin's source code is useful to study because it is short and demonstrates use of the `plugin()`, and `command()` functions, persistence and event handling. + ## Classroom Plugin The `classroom` object contains a couple of utility functions for use @@ -2624,8 +2656,8 @@ The `jsp home` command has the following options... * `/jsp home` ..command will return you to your home, if you have set one. - * `/jsp home ` Will take you to the home of (where - is the name of the player whose home you wish to visit. + * `/jsp home {player}` Will take you to the home of {player} (where + {player} is the name of the player whose home you wish to visit. * `/jsp home delete` Deletes your home location from the location database. This does not actually remove the home from the world or @@ -2640,8 +2672,8 @@ visit. * `/jsp home list` Lists home which you can visit. * `/jsp home ilist` Lists players who can visit your home. - * `/jsp home invite ` Invites the named player to your home. - * `/jsp home uninvite ` Uninvites (revokes invitation) the named player to your home. + * `/jsp home invite {player}` Invites the named player to your home. + * `/jsp home uninvite {player}` Uninvites (revokes invitation) the named player to your home. * `/jsp home public` Opens your home to all players (all players can visit your home). * `/jsp home private` Makes your home private (no longer visitable by all). @@ -2649,7 +2681,7 @@ visit. The following administration options can only be used by server operators... * `/jsp home listall` List all of the homes - * `/jsp home clear ` Removes the player's home + * `/jsp home clear {player}` Removes the player's home location. Again, this command does not destroy any structures in the world, it simply removes the location from the database. No blocks are destroyed by this command. diff --git a/src/main/js/plugins/chat/color.js b/src/main/js/plugins/chat/color.js index a6666d0..eb85f6c 100644 --- a/src/main/js/plugins/chat/color.js +++ b/src/main/js/plugins/chat/color.js @@ -1,6 +1,36 @@ -/* - TODO: Document this module -*/ +/************************************************************************* +## chat Plugin + +This plugin lets players choose a text color to use when chatting. Players can list colors by typing... + + /jsp list_colors + +... and can set the color to use when chatting by typing... + + /jsp chat_color {color} + +... where {color} is one of the following colors... + + * black + * blue + * darkgreen + * darkaqua + * darkred + * purple + * gold + * gray + * darkgray + * indigo + * brightgreen + * aqua + * red + * pink + * yellow + * white + +This plugin's source code is useful to study because it is short and demonstrates use of the `plugin()`, and `command()` functions, persistence and event handling. + +***/ var _store = { players: { } }, colorCodes = {}, i, diff --git a/src/main/js/plugins/homes/homes.js b/src/main/js/plugins/homes/homes.js index f859531..94fb22e 100644 --- a/src/main/js/plugins/homes/homes.js +++ b/src/main/js/plugins/homes/homes.js @@ -28,8 +28,8 @@ The `jsp home` command has the following options... * `/jsp home` ..command will return you to your home, if you have set one. - * `/jsp home ` Will take you to the home of (where - is the name of the player whose home you wish to visit. + * `/jsp home {player}` Will take you to the home of {player} (where + {player} is the name of the player whose home you wish to visit. * `/jsp home delete` Deletes your home location from the location database. This does not actually remove the home from the world or @@ -44,8 +44,8 @@ visit. * `/jsp home list` Lists home which you can visit. * `/jsp home ilist` Lists players who can visit your home. - * `/jsp home invite ` Invites the named player to your home. - * `/jsp home uninvite ` Uninvites (revokes invitation) the named player to your home. + * `/jsp home invite {player}` Invites the named player to your home. + * `/jsp home uninvite {player}` Uninvites (revokes invitation) the named player to your home. * `/jsp home public` Opens your home to all players (all players can visit your home). * `/jsp home private` Makes your home private (no longer visitable by all). @@ -53,7 +53,7 @@ visit. The following administration options can only be used by server operators... * `/jsp home listall` List all of the homes - * `/jsp home clear ` Removes the player's home + * `/jsp home clear {player}` Removes the player's home location. Again, this command does not destroy any structures in the world, it simply removes the location from the database. No blocks are destroyed by this command. @@ -74,21 +74,21 @@ var homes = plugin( 'homes', { return [ /* basic functions */ '/jsp home : Return to your own home', - '/jsp home : Go to player home', + '/jsp home {player} : Go to player home', '/jsp home set : Set your current location as home', '/jsp home delete : Delete your home location', /* social */ '/jsp home list : List homes you can visit', '/jsp home ilist : List players who can visit your home', - '/jsp home invite : Invite to your home', - '/jsp home uninvite : Uninvite to your home', + '/jsp home invite {player} : Invite {player} to your home', + '/jsp home uninvite {player} : Uninvite {player} to your home', '/jsp home public : Open your home to all players', '/jsp home private : Make your home private', /* administration */ '/jsp home listall : Show all houses (ops only)', - '/jsp home clear : Clears player home location (ops only)' + '/jsp home clear {player} : Clears player home location (ops only)' ]; }, /* ========================================================================