I've been through a number of Pokefam ascensions now and have engaged in many hundred of pokebattles in the relay browser. I'm starting to consider what would be the best way to automate them.
My first observation is that simply automating via a CCS is not likely to be useful. You may set up your favorite team, but your opponent's team can throw a wrench into your favorite strategy.
- tackle can send your front row familiar to the back
- ULTIMATE: Atomic Bomb (or what ever it is) can simply take out your back row familiar
And many others.
So, CCS is out, consult script is in. What does a consult script need to know?
For both teams, who is 1st, 2nd, and 3rd
Which powers are available this round to each of your familiars? Some are only available at the front, some only at the rear, and so on.
What is the opponent's next action? Which familiar, which action? That is available to you; it is called out in the HTML.
If your opponent is about to automatically take out your front or rear familiar, perhaps you want to use the soon-to-be dead familiar before they die? Or perhaps you want to disable that attack by tackling the foremost opponent and making the attack no longer valid? Or something. That is completely up to the script to decide; it is not KoLmafia's job to come up with a strategy, unless we want to build in an automated fambattle automation, which I am not proposing.
And the consult script needs a function to actually make such-and-such a familiar perform such-and-such an action.
- Each round of a battle, parse the current fambattle page and set properties to describe the current battle position
- Provide a function to perform a fambattle action.
- What is an action? It's a familiar-specific skill performed by a particular familiar. You can have multiple familiars in your team who can Backstab, for example, so an action is a combination of a familiar + a familiar skill.
Here are some URLs used in fambattle.php:
As you can see, it gives you the familiar doing the skill, which is specified by keyword and also with full "pretty" name.Code:// fambattle.php?pwd&famaction[ult_crazyblast-209]=ULTIMATE%3A+Spiky+Burst // fambattle.php?pwd&famaction[sting-98]=Sting // fambattle.php?pwd&famaction[backstab-209]=Backstab
You need to specify familiar + skill. How do you want to represent the skill?
By string, presumably, but both "pretty" skill name and "keyword" is needed.
Does anyone have a list of all possible familiar skills?
Those who have written (or would like to write) consult scripts or combat filters, please chime in now about what you would like KoLmafia and ASH to make available to you to simplify/clarify/reliablize you code.