Thanks, MCroft. I've fixed that bug as well as a number of others in the attached patch, and I think I've improved the error handling substantially. I cut out the rhino jar this time as the transmission of the patch over the wire does not appear to have worked correctly for you.
I think this is at the point I'd like to get this merged; the patch is starting to get out of control in terms of size. If that makes sense to folks, further improvements can be handled in separate patches. I also expect that people who start developing against this will find bugs fairly quickly! I will write further documentation on it later this week, and I'm happy to take any further suggestions.
The brief summary of the API is this:
- The ASH runtime library can be accessed via the global Lib, with each runtime library function attached to Lib as the camelCase version of its ASH self. For example, you can get your moods via Lib.getMoods.
- Enumerated types can be accessed via <Type>.get and <Type>.all. get takes a single number/string or a list of numbers/strings, and all takes no arguments. So, for example, Monster.get(33) returns zobmie, and Item.all() returns a list of all items.
Putting these together, you can do things like adventure in NEP with Lib.adv1(Location.get("The Neverending Party"), -1, "").
Consult scripts and combat filter functions are not currently supported, although you can of course still write a consult script in ASH. I don't expect this to be terribly hard to add so that will probably come soon. The patch also does not currently support relay or relay override scripts.
I've attached a test script, "pizzable.js"; you can call it with "pizzable <letter>" to get the list of pizzable items for that letter.