
One of my scripts is using the Inline Processor to get complex die rolls from Roll20's chat command and everything about that works just fine, with one small exception... In the script, there is a variable "diceformula" that holds the requested formula, either from a chat argument or from an attribute (like HD_Formula.current = "5d6+5d8+30"). That formula is sent to the Inline Processor and I get a result just fine... UNLESS the formula is not in a format that Inline Processor can accept. Since the formula is from user input and not pre-assembled, when an invalid formula is sent up, it gets the familiar Syntax Error and the rest of the script fails out. So, the question is... Is there a way to evaluate a string to see _IF_ it is a valid formula before sending it to get the actual die result? Ideally something that returns true/false so I can add something like " if(IsFormula(formula)) { InlineProcessor(formula); } "