javalent / dice-roller

Inline dice rolling for Obsidian.md
265 stars 27 forks source link

✨ FR - choose the dice rolled to get data from a table #299

Open tyrcho opened 5 months ago

tyrcho commented 5 months ago

I'd like to control the dice rolled from the calling site and not only from the declaration site.

Exemples

matthewturk commented 3 months ago

For what it's worth, I was able to make this work by executing:

const roller = getRoller("[[Page^table]]");
await roller.getResult(); // to make sure lookupTable is created
roller.lookupRoller = getRoller("1d21 + 5")

lookupRoller doesn't get created until the first call to getResult, but after that it can be overridden.