So, I've just done some work on a simple buff-tending script. (http://kolmafia.us/index.php/board,6.0.html) Along the way, I found some frustrating limitations in the information that the ASH interpreter provides about known items/effects/skills. In my case, I wanted to do some testing with all skills, in order to determine which to use.
The first thing I ran into: There's no way to iterate across all skills. I had to include a list of all the relevant skills in my script. That seems quite silly, as it means that both my script and mafia need to be updated whenever new skills are added. It's also error-prone, as I forgot Springy Fusilli on my first pass, and had to discover it in testing. I'm still not certain I didn't miss something else... I'll only know after either a thorough review or testing in many more situations.
The next thing I found was an inability to get metadata about skills. I wanted to reduce the number of requests mafia was making by equipping my JEW hat if necessary, once per script invocation, instead of every time a buff is used. As it is fully possible that on some invocations of the script, no switching is necessary at all, I didn't want to switch hats unless it was. There isn't any way to query mafia's metadata to determine whether a given skill is a buff or not, so I also had include that information in my script as well.
One of the next revisions I'd like to make to the script is reducing the number of use_skill calls it makes, by basing the first argument of the call on how many turns the buff will be applied for. Mafia has that information already. For me to get at it, I need to add even more data into my script: How many turns a single cast lasts for by default, whether the R&R Legend affects it, and whether the JEW hat affects it.
It's possible to derive all this information from what ASH gets you... But it's quite a lot of unnecessary pain, as it requires extra required script maintenance, debugging, and size.
Is it possible to add more direct access to these values somehow in ASH?
The first thing I ran into: There's no way to iterate across all skills. I had to include a list of all the relevant skills in my script. That seems quite silly, as it means that both my script and mafia need to be updated whenever new skills are added. It's also error-prone, as I forgot Springy Fusilli on my first pass, and had to discover it in testing. I'm still not certain I didn't miss something else... I'll only know after either a thorough review or testing in many more situations.
The next thing I found was an inability to get metadata about skills. I wanted to reduce the number of requests mafia was making by equipping my JEW hat if necessary, once per script invocation, instead of every time a buff is used. As it is fully possible that on some invocations of the script, no switching is necessary at all, I didn't want to switch hats unless it was. There isn't any way to query mafia's metadata to determine whether a given skill is a buff or not, so I also had include that information in my script as well.
One of the next revisions I'd like to make to the script is reducing the number of use_skill calls it makes, by basing the first argument of the call on how many turns the buff will be applied for. Mafia has that information already. For me to get at it, I need to add even more data into my script: How many turns a single cast lasts for by default, whether the R&R Legend affects it, and whether the JEW hat affects it.
It's possible to derive all this information from what ASH gets you... But it's quite a lot of unnecessary pain, as it requires extra required script maintenance, debugging, and size.
Is it possible to add more direct access to these values somehow in ASH?