Assuming you have Math.js added to your system the way Tobias indicates, it 
looks like this works:

<$set name="2d6" filter="[[]eval[randomInt(1,6)+randomInt(1,6)]]" >
<<2d6>>
</$set>

Inside of the <$set> tags, <<2d6>> generates a number from 2 to 12.

HTH
Mark

On Saturday, November 12, 2016 at 4:19:59 AM UTC-8, Guillaume Escrivant 
wrote:
>
> Hello
> I want to use eval to simulate dice roll - using 2d6 notation instead of 
> randomInt(1,6) + randomInt(1,6)
>
> I'v seen in the Tobibeer code that it parse for variable, 
>
>
> *<$set name="2d6" value="randomInt(1,6)+randomInt(1,6)"*
>
>
> *</$set>*
> But it dont work
> Unable to evaluate '9-(0+2d6)' (Error: Undefined symbol d6).
>
> I can also add a new operator in math.js but it seem difficult ;)
>
> Does someone have an idéa ?
>
> Tks
> Guillaume
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/73638845-50fc-4219-bd21-5522d7d89a0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to