phylll / mychs-macro-magic

A simple, sane, and friendly little scripting language for your Roll20 macros.
MIT License
0 stars 0 forks source link

Can the `rest` script work without tokens on the board? #74

Open phylll opened 5 months ago

phylll commented 5 months ago

Often we call the rest script outside of combat maps, where there are not always PC tokens on the current map. It would be nice if the script still worked.

phylll commented 5 months ago

So the problem here is that this rather sizable list of functions is used, all of which work with either a cOwnID argument or by pulling script.cOwnID:

Using token IDs is meant to ensure that scripts treat different (NPC) tokens representing the same character template differently: some might be uninjured, others already dying.

However, I suspect that all these functions may be refetching the argument ID as a token ID, which may not actually be necessary or useful. Maybe they could deal with Roll20 IDs the usual API way and just pass them through, trusting they are being called with the right kind of ID depending on the context. Worth investigating further...