
I want to minimize the use of the API and do as much work as possible in macros. This is to allow the character sheet I'm modifying to work even for non-subscribers by substituting the API bits with less convenient but still functional macro substitutes, like replacing an API function to find the range penalty with a query asking the user for the range to their target. This also allows users to modify the macros to handle stuff like houserules or rules exceptions without needing to dig into the API. However, I don't know how I can make an API function that simply returns a value to a macro, rather than sending a message to the chat (and thus needing the entire line to itself). For example, {{attack= [[@{skill} + !rangepenalty + ?{Modifiers|0} - 3d6]]}} where !rangepenalty is an API script that just returns a number like -4 for use in the macro. How would I go about this?