Feature JSON in ash scripts

Stardock

Member
Hey, I'm working on something that needs to move data from Javascript to KoLmafia and it seems to me the easier way would be through JSON. I was wondering if we could get JSON parsing capabilities added to ash.

Thanks for the consideration.
 
Last edited:
FWIW, though I can't for the life of me remember why, I do recall considering making this request myself at some point. I think I was hoping for some clan info from api.php, which doesn't look likely, but still... I could see the use, certainly.
 
Would be somewhat tricky. One way that I can see it working is Mafia returning a mapping of fully qualified names (e.g. "obj.key1.key2.val") to value in a string[string] map. Of course, circular references are somewhat sucky and likely to break this, but that's an edge case and can be documented.
 
To be fair, I personally lean toward the idea of "if mafia already has ways of parsing json built-in that would be easy enough to expose to ash functions, this would be aweseom; if it would be a great deal of work to do so... meh" philosophy. ;)
 
To be fair, I personally lean toward the idea of "if mafia already has ways of parsing json built-in that would be easy enough to expose to ash functions, this would be aweseom; if it would be a great deal of work to do so... meh" philosophy. ;)

This is also my opinion. I can use maps as a workaround if needed.
 
The main issue, really, is that ASH doesn't have support for objects with arbitrary/self-referential structure, so there's no good way to format a javascript object.
 
Back
Top