js:MapTool.chat: Difference between revisions
Jump to navigation
Jump to search
m (Split out all three functions; add explanatory text; fix typos) |
m (Corrected order of parameter definitions; added detail/link for more info) |
||
Line 29: | Line 29: | ||
'''Parameters''' | '''Parameters''' | ||
* {{code| | * {{code|lstOfPlayers}} An array containing the names of the players to send the message to. Can include the same list of values as {{func|broadcast}}. | ||
* {{code| | * {{code|msg}} String to send to the list of users specified by {{code|lstOfPlayers}}. | ||
}} | }} | ||
Revision as of 05:08, 11 June 2023
This article describes a feature or macro function that is experimental and may be subject to change.
Within the javascript environment used by js.eval
, MapTool.chat
is the entry point for sending chat messages. This page details the attributes and functions available on the MapTool.chat
object.
chat.broadcast() Function
Note: This function can only be used in a Trusted Macro
• Introduced in version 1.10.0
Like the broadcast() macro.
Usage
MapTool.chat.broadcast(msg);
Parameters
msg
String to send to all players and GMs.
chat.broadcastTo() Function
Note: This function can only be used in a Trusted Macro
• Introduced in version 1.10.0
Like the broadcast() macro when used to send just to a particular list of connected machines.
Usage
MapTool.chat.broadcastTo(lstOfPlayers, msg);
Parameters
lstOfPlayers
An array containing the names of the players to send the message to. Can include the same list of values as broadcast().msg
String to send to the list of users specified bylstOfPlayers
.
chat.broadcastToGM() Function
Note: This function can only be used in a Trusted Macro
• Introduced in version 1.10.0
Like the broadcast() macro, but only sends to GMs.
Usage
Maptool.chat.broadcastToGM(msg)
Parameters
msg
String to send to all GMs.