Rolisteam / DiceParser

Powerful dice Roller is used as discord bot, irc bot, cli tool and inside Rolisteam : 1d20+4, 1L[head,arm,leg,belly,chest], 1d6+1d8, 8+5*3
http://www.rolisteam.org/
GNU General Public License v3.0
125 stars 31 forks source link

expand macro commands #75

Open SaltatorMortis opened 4 years ago

SaltatorMortis commented 4 years ago

as @maximilianmaihoefner mentioned it would be cool to expand the macro syntax he already suggested in #74 !macro move 3 5

i would add

example with relative/negative position based on debug:

!macro skill\((.*?),(.*?)\) \1(\2);d20+$1;d20+$2;d20+$3;(§2+§3+$-1)/3 1
!macro acrobatic\((.*?)\) \1int;\1char;\1dex 1
!macro bobint 12 0
!macro bobchar 15 0
!macro bobdex 8 0

!macro debug !skill(acrobatic,bob)

bot replies:

!skill(acrobatic,bob) !acrobatic(bob);d20+$1;d20+$2;d20+$3;(§2+§3+$-1)/3 !bobint;bobchar;bobdex;d20+$1;d20+$2;d20+$3;(§4+§5+$-1)/3 !12;15;8;d20+$1;d20+$2;d20+$3;(§4+§5+$-1)/3