clearLights: Difference between revisions
Jump to navigation
Jump to search
m (Conversion script moved page ClearLights to clearLights: Converting page titles to lowercase) |
No edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
clearLights() | clearLights() | ||
clearLights( | clearLights(tokenRef) | ||
clearLights( | clearLights(tokenRef, mapRef) | ||
</ | </syntaxhighlight> | ||
'''Parameters''' | '''Parameters''' | ||
{{param| | {{param|tokenRef|Either the token [[getSelected|{{code|id}}]] or [[getTokenName|Token Name]] of the token for which to turn off all light sources, defaults to the [[Current Token]]. {{TrustedParameter}} }} | ||
{{param| | {{param|mapRef|The Name or ID of the map to find the token. Defaults to the current map.}} | ||
{{Note|Token IDs are unique, but Token Names can be duplicated. Using Token Name when more than one token has the same name can produce unexpected results.}} | |||
|examples= | |examples= | ||
To turn off all of the light sources for the current token. | To turn off all of the light sources for the current token. | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[h: clearLights()] | [h: clearLights()] | ||
</ | </syntaxhighlight> | ||
To turn off all the lights sources on the map you could run the following script, note you will have to be the GM or run it | To turn off all the lights sources on the map you could run the following script, note you will have to be the GM or run it | ||
as part of a trusted macro. | as part of a trusted macro. | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
Ok Kids lights out! | Ok Kids lights out! | ||
[h,foreach(tok, getTokens()), code: { [token(tok): clearLights()]}] | [h,foreach(tok, getTokens()), code: { [token(tok): clearLights()]}] | ||
</ | </syntaxhighlight> | ||
|changes= | |changes= |
Latest revision as of 23:59, 12 May 2024
clearLights() Function
• Introduced in version 1.3b48
Turns off all of the light sources for the Current Token.
Usage
clearLights()
clearLights(tokenRef)
clearLights(tokenRef, mapRef)
Parameters
tokenRef
- Either the tokenid
or Token Name of the token for which to turn off all light sources, defaults to the Current Token.Note: This parameter can only be used in a Trusted Macro.
mapRef
- The Name or ID of the map to find the token. Defaults to the current map.
Token IDs are unique, but Token Names can be duplicated. Using Token Name when more than one token has the same name can produce unexpected results.
Examples
To turn off all of the light sources for the current token.
[h: clearLights()]
To turn off all the lights sources on the map you could run the following script, note you will have to be the GM or run it as part of a trusted macro.
Ok Kids lights out!
[h,foreach(tok, getTokens()), code: { [token(tok): clearLights()]}]
Version Changes
- 1.5.4 - Added
id
andmapname
parameter options.