Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Calculation in input, autocalc issues

Hi everyone, I've been searching for some hours how to handle that but couldn't find a solution. Here's the thing : I've been trying to implement an input [ text ] that should contain an equation and get the result of that equation in another input [ number ]. If that equation is empty, the result value should be 0. Similarly to the pathfinder community sheet :  See :  I kinda found a way to do so with the disabled and autocalculation But if the input [ text ] is empty, I got no values at all in the result See :  I need that result in another calculation and in a roll. Until now, the only way I found to get a "0" in that result input was with value="[[@{macro} - 0]]"   But the console would fire an error "cannot parse or is out of range". I tried looking at the Pathfinder sheet code too, But tbh the code of that sheet is way too high level for me, from what I understood it was handled with the sheet/worker, and I'm not even sure about that My actual code with that macro : < button type = "roll" value = "/r 1d10 + @{macro_bonus}" > Roll </ button > < input type = "text" name = "attr_macro" placeholder = "#/Équation..." /> < input type = "number" name = "attr_macro_bonus" value = "@{macro}" disabled /> I'm kinda running out of idea how to do so, if anyone has any idea to unlock me I'd really appreciate Thanks for reading me !
Mh, there were pictures after the "See :" Anyways, I don't think they were really relevant They were litterally just an empty input text with a placeholder followed by an input number with a value equals to "0" in the first picture, and without value in the second one.
1713807423
GiGs
Pro
Sheet Author
API Scripter
For pasting pictures, I don't paste them directly into roll20 - its glitchy enough thatand that fails frequently or takes a long time. I normally paste them in a different site (like imgur), and copy the link to paste it here.
1713807579

Edited 1713812790
GiGs
Pro
Sheet Author
API Scripter
It sounds like you are trying a conditional operation ("If this cell is empty, do this instead") and you can't do that with macros. I think the only way to do what you're trying to do is with a sheet worker.
Damn I hoped there would be an other option using the autocalc Thanks anyways buddy