Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue] rollSkill capture results in macro fail #4954

Open
pixelknight1 opened this issue Jan 2, 2025 · 1 comment
Open

[Issue] rollSkill capture results in macro fail #4954

pixelknight1 opened this issue Jan 2, 2025 · 1 comment

Comments

@pixelknight1
Copy link

Context; in Foundry v12.

Issue: Having trouble catching the skillcheck result within a macro. The result is injected into the chat as expected.

(async () => {
   const roll = await token.actor.rollSkill({skill:'nat', ability:'int'}, {fastForward: true});
   ui.notifications.warn("The result is["+ roll.total +"].");
})();

'roll' returns output such as ["1d20 + 2 + 1"] but 'roll.total' is undefined.

(async () => {
   await token.actor.rollSkill({skill:'nat', ability:'int'}, {fastForward: true}, async (roll) => {
    ui.notifications.warn("The result is ["+ roll.total +"]");
    });
})();

However the anonymous function doesn't execute, but references suggest this should work.

@krbz999
Copy link
Contributor

krbz999 commented Jan 2, 2025

It returns an array of rolls.

const rolls = await token.actor.rollSkill({skill:'nat', ability:'int'}, {configure: false});
ui.notifications.warn(`The result is [${rolls[0].total}].`);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants