Croebh / Avrae-Customizations

A place for me to store and update all of my Avrae aliases and customizations.
GNU General Public License v3.0
28 stars 23 forks source link

[Bug] !use #34

Closed mrrobinhood5 closed 3 years ago

mrrobinhood5 commented 3 years ago

What alias/snippet is this for? !use

Describe the bug Error: Error evaluating expression: Unexpected input on line 1, col 4: expected INTEGER, got (

When using "ccnum"

To Reproduce Steps to reproduce the behavior:

  1. !cvar quickheal {"fail": "True", "d": "-1d{(((MonkLevel // 5) * 2) + ((MonkLevel // 11) * 2) + ((MonkLevel // 17) * 2) - ((MonkLevel //10) * 2) - ((MonkLevel // 15)*2) + 4)}-{proficiencyBonus}", "cc": "Ki Points", "ccnum":"2","title": "[name] uses Quickened Healing!", "desc": "As an action, you can spend 2 ki points and roll a Martial Arts die. You regain a number of hit points equal to the number rolled plus your proficiency bonus."}
  2. The above cvar produces the error but without the ccnum key, it does not error out.

Expected behavior "ccnum":"2" should not affect "d" evaluation or vice versa

Screenshots If applicable, add screenshots to help explain your problem.

Additional context this error also comes up when creating the CVAR code with !use like this: !use fail -d "-1d{(((MonkLevel // 5) * 2) + ((MonkLevel // 11) * 2) + ((MonkLevel // 17) * 2) - ((MonkLevel //10) * 2) - ((MonkLevel // 15)*2) + 4)}-{proficiencyBonus}" -cc "Ki Points" -ccnum 2 -out quickheal

But does not when ommiting -ccnum 2

Croebh commented 3 years ago

Wow! This was one heck of an edge case. It basically would break any annotation (anything inside {}) if any of the individual digits in the annotation was also an argument. So because you had -ccnum 2, and were multiplying by 2, it was replacing that with True which was breaking everything

Should be fixed now.