-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
20 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
# checkLightLevel | ||
Roll20 Mod Script | ||
|
||
Checks the light level of the currently selected token. | ||
A script to check the current illumination level of a selected Token. | ||
Basic usage: `!checklight` with a token selected | ||
|
||
[Documentation](https://app.roll20.net/forum/post/11312893) | ||
|
||
Usage: `!checkLight` | ||
## From other scripts | ||
|
||
From other scripts: `checkLightLevel.litBy(tokenOrId)` | ||
`checkLightLevel.litBy(tokenOrId)` | ||
Returns a LitBy object: | ||
|
||
```/** | ||
* @typedef {object} LitBy | ||
* @property {?boolean} bright - token is lit by bright light, null on error | ||
* @property {?array} dim - dim light emitters found to be illuminating selected token, null on error | ||
* @property {?float} daylight - token is in <float between 0 and 1> daylight, false on no daylight, null on error | ||
* @property {?float} total - total light multiplier from adding all sources, max 1, null on error | ||
* @property {?string} err - error message, only on error | ||
* | ||
* @param {string | object} tokenOrTokenId - Roll20 Token object, or token UID string | ||
* @returns {LitBy} | ||
*/ | ||
isLityBy(tokenOrTokenId) | ||
``` | ||
/* | ||
* @typedef {object} LitBy | ||
* @property {?boolean} bright - token is lit by bright light, null on error | ||
* @property {?array} dim - dim light emitters found to be illuminating selected token, null on error | ||
* @property {?float} daylight - token is in <float between 0 and 1> daylight, false on no daylight, null on error | ||
* @property {?float} total - total light multiplier from adding all sources, max 1, null on error | ||
* @property {?boolean} partial - if true, no source of light is completely illuminating the token's area | ||
* @property {?string} err - error message, only on error | ||
* | ||
* @param {string | object} tokenOrTokenId - Roll20 Token object, or token UID string | ||
* @returns {LitBy} | ||
*/ | ||
``` |