mclemente / fvtt-advanced-macros

Use handlebars templating, recursive macro calls and call macros with arguments or directly from chat.
MIT License
15 stars 9 forks source link

update is not a function #23

Closed dexstrom90 closed 2 years ago

dexstrom90 commented 2 years ago

Updated everything and I have the latest version of advanced macros and Foundry but my macros from before the updates aren't working anymore. I have several macros that rotate tokens such as the one below but now the update function doesn't seem to work. I even pulled a macro from the Advanced Macros compendium and it's not liking the update function.

let token1 = canvas.tokens.placeables.find(t => t.data.name === "Gear1"), token2 = canvas.tokens.placeables.find(t => t.data.name === "Gear2"), token3 = canvas.tokens.placeables.find(t => t.data.name === "Gear3"), gears = canvas.background.objects.children.find(t => t.data._id === "NTc4NzYwMDk2MGUy");

(async ()=>{ if(!token1 || !token2 || !token3) return;

await token1.update({ rotation : 11 }); await token2.update({ rotation : -2 }); await token3.update({ rotation : 354 }); await gears.update({ img: "worlds/tomb-of-annihilation/scenes/tiles/_28S_29_L5_3A_Gears_of_Hate/State_5.png" }); })();

mclemente commented 2 years ago

It's token.data.update now.