Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ooshhub authored Feb 5, 2023
1 parent bb11502 commit 714eeb4
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions README.md
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}
*/
```

0 comments on commit 714eeb4

Please sign in to comment.