{ "name": "API Documentation", "pages": [ { "sort": 100000, "name": "Accessing the API", "type": "text", "_id": "Q4WPDTxUW6te0td1", "title": { "show": true, "level": 1 }, "image": {}, "text": { "format": 1, "content": "

The swade-mb-helpers API can be accessed in a macro with the following line of code:

const api = game.modules.get('swade-mb-helpers').api

The name 'api' will be used for all examples but the variable name within your macro doesn't matter.

" }, "video": { "controls": true, "volume": 0.5 }, "src": null, "system": {}, "ownership": { "default": -1, "R9ZgY0IvWl8ovIuT": 3 }, "flags": {}, "_stats": { "systemId": "swade", "systemVersion": "3.2.2", "coreVersion": "11.315", "createdTime": 1700438788646, "modifiedTime": 1700438788646, "lastModifiedBy": "R9ZgY0IvWl8ovIuT" }, "_key": "!journal.pages!Q4iS1LIiyy7acuaF.Q4WPDTxUW6te0td1" }, { "sort": 200000, "name": "api.powerEffects", "type": "text", "_id": "X0rGr7qO1SRHwy9q", "title": { "show": true, "level": 1 }, "image": {}, "text": { "format": 1, "content": "
async function powerEffects (options = {})

powerEffects is the dispatcher behind all of the power effects in swade-mb-helpers. It will parse the options to handle power dialogs and effects for every currently handled power effect within this module.

Parameters

The only parameter is the options parameter detailed below


Options

the options object has the following fields:

One of 'item' or 'name' must be set.

Returns

There is no return value for this function.

" }, "video": { "controls": true, "volume": 0.5 }, "src": null, "system": {}, "ownership": { "default": -1, "R9ZgY0IvWl8ovIuT": 3 }, "flags": {}, "_stats": { "systemId": "swade", "systemVersion": "3.2.2", "coreVersion": "11.315", "createdTime": 1700439000261, "modifiedTime": 1700439000261, "lastModifiedBy": "R9ZgY0IvWl8ovIuT" }, "_key": "!journal.pages!Q4iS1LIiyy7acuaF.X0rGr7qO1SRHwy9q" }, { "sort": 300000, "name": "api.requestRollFromTokens", "type": "text", "_id": "zvPWCYx402kk2hsE", "title": { "show": true, "level": 1 }, "image": {}, "text": { "format": 1, "content": "
async function requestRollFromTokens (tokens, rollType, rollDesc, options = {})

This will request a roll from the tokens given using socketlib to request the roll from the currently logged on owner of the token.

Parameters

Options

The options object can be completely empty, but can have any or all of the following optional fields:

Returns

The return value is a list of promises which, if fulfilled, are the resulting roll objects from the token's rolls.

" }, "video": { "controls": true, "volume": 0.5 }, "src": null, "system": {}, "ownership": { "default": -1, "R9ZgY0IvWl8ovIuT": 3 }, "flags": {}, "_stats": { "systemId": "swade", "systemVersion": "3.2.2", "coreVersion": "11.315", "createdTime": 1700439709611, "modifiedTime": 1700440442904, "lastModifiedBy": "R9ZgY0IvWl8ovIuT" }, "_key": "!journal.pages!Q4iS1LIiyy7acuaF.zvPWCYx402kk2hsE" } ], "folder": null, "ownership": { "default": 0, "R9ZgY0IvWl8ovIuT": 3 }, "flags": { "core": {} }, "_stats": { "systemId": "swade", "systemVersion": "3.2.2", "coreVersion": "11.315", "createdTime": 1700438778794, "modifiedTime": 1700440473945, "lastModifiedBy": "R9ZgY0IvWl8ovIuT" }, "_id": "Q4iS1LIiyy7acuaF", "sort": 100000, "_key": "!journal!Q4iS1LIiyy7acuaF" }