Closed JoeGans closed 5 years ago
Sorry for the late answer. It's easy to do that using macro. You need to define something like that ( I'm assuming that the number of dice (1), the face count (d20) and the threshold (11) don't change at all).
!macro foo,([\s\w]+) 1d20i:[<11]{"\1 :|: Success: %1"}{"\1 :|: Fail: %1"} 1
foo,Slough Perception (SV 10 + PER) Roll
1d20i:[<11]{"Slough Perception (SV 10 + PER) Roll :|: Success: %1"}{"Slough Perception (SV 10 + PER) Roll :|: Fail: %1"}
(be careful, with empty comment, it will not roll, as it will not match the macro)
Brilliant, thanks oBi!!!
.... buttttt, it gives the following error with the () or [] brackets ...
Warning: Unexpected character at 78 - end of command was ignored "[SV10]" Warning: Unexpected character at 78 - end of command was ignored "(SV10)"
Have you noticed that in other macro's, and is there a way round defined characters?
Thanks for all your effort! Walts.
It is just because [\s\w]+ accept only letter and space, but adding (,),[,],+ should do the job
!macro foo,([\w\s\d\(\)\[\]\+\-]+) 1d20i:[<11]{"\1 :|: Success: %1"}{"\1 :|: Fail: %1"} 1
Works a treat, thanks oBi!
Can i ask where the documentation is for macro building/ref? Give me something to play on within our channels! ... Thanks, Walts
It depends what you mean about documentation for macro.
There are three involved mechanisms, here:
If you want documentation about regular expression, take a look on perl regular expression.
Thanks oBi, the Perl link is what I was looking for!
thanks for all your help, Walts
Is there a way to have the Comment & Result displayed on one line?
This was my die roll: !1d20i:[<11]{"Success: %1"}{"Fail: %1"} # Slough Perception (SV 10 + PER) Roll
... and this is how it came out, in two lines ...
Slough Perception (SV 10 + PER) Roll Success: 5
... so, I'd be looking for this (one line) type of output ...
Slough Perception (SV 10 + PER) Roll :|: Success: 5
Feedback, thoughts, ideas always appreciated! ... Walts