Nachtrose / NRSAP

Nachtrose's Sci-fi ( and modern ) Animated Pack
Other
5 stars 0 forks source link

Auto Update Macros #12

Closed brunocalado closed 2 years ago

brunocalado commented 2 years ago

Hi.

I add to my modules a little trick so everytime I update a macro the user don't even know.

I think you could add this to here.

I push 2 macros. One the user should not use. The other one reads the macro in the compendium. image

Snippet

const compediumName = '';
macroRun('MACRO NAME', compediumName);

async function macroRun(macroName, compendiumName='scum-and-villainy-pt-br.macros') {  
  let pack = game.packs.get(compendiumName);
  let macro = ( await pack.getDocuments() ).find(i => (i.data.name==macroName) );
  await macro.execute();    
}
Nachtrose commented 2 years ago

Included in the v0.1.3.10i release.