Closed kakaroto closed 4 years ago
Having some of the useful scripts that don't work as actual feature be available in a macro compendium would be great. Examples:
check distances :
let message = "" for (let token of canvas.tokens.controlledTokens) { let ruler = canvas.controls.ruler; for (let target of game.user.targets) { ruler.clear() ruler.waypoints.push(token.center) ruler.labels.addChild(new PIXI.Text("")); ruler.measure(target.center); let distance = ruler.labels.children[0].text; message += `From '${token.name}' to '${target.name}' : ${distance}<br/>` ruler.clear(); } } if (message) { ChatMessage.create({content: message, whisper: [game.user.id]}); }
print/find id of entities
auto configure tokens
let tokens = [] for (let token of canvas.tokens.placeables) { tokens.push({_id: token.id, "bar1.attribute": "attributes.hp", "bar2.attribute": "", "displayName": CONST.TOKEN_DISPLAY_MODES.OWNER, "displayBars": CONST.TOKEN_DISPLAY_MODES.OWNER}) }
if (tokens.length > 0) canvas.scene.updateManyEmbeddedEntities('Token', tokens)
Having some of the useful scripts that don't work as actual feature be available in a macro compendium would be great. Examples:
check distances :
print/find id of entities
auto configure tokens
if (tokens.length > 0) canvas.scene.updateManyEmbeddedEntities('Token', tokens)