DiceParser icon indicating copy to clipboard operation
DiceParser copied to clipboard

expand macro commands

Open SaltatorMortis opened this issue 4 years ago • 0 comments

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

i would add

  • !macro rm 3..5 remove macros 3 to 5

  • !macro debug "die command" run die command step by step to better identify failing step

  • !macro backup/export range(optional)

  • integer variables that are user specific(player stats?)

  • default value if empty; [];($1)d100 => [];($1|1)d100 or [];($1)d100|0

  • negative absolute commands $-1

  • $ absolute and § relative position reference(optional) alternative:

  • selective dice output; if a macro has many 'helper results/steps' give the ability to drop/select dice example with check if dice/number then run result times d100 else return 0: [\1];$1c[1..999];$2i:[0]{0}{(0\1)d100} you need only the last result the rest are only helper/steps or take this behemoth of skillcheck !10;10;10;10;[0];[0];d20;d20;d20;$7-($2+$5+$6);$8-($3+$5+$6);$9-($4+$5+$6);[$10,0]k1;[$11,0]k1;[$12,0]k1;$1-$13-$14-$15;$2-$7;$3-$8;$4-$9;[$17,$18,$19]kl1;$16+$20/2 yes i know i could add a ;"TAP*=$16,$22" to the end to make it human readable but for calling it with other macros (specially if nested) a simpler way to reference/filter would be cool regex check on creation

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

SaltatorMortis avatar Apr 09 '20 15:04 SaltatorMortis