Added in r26623. I'm not married to the name, and I definitely want to augment it, but lets talk about what it does, what it could do, and what it should do.
KoLmafia will "automate" adventures for you - via the GUI, via the "adventure" command, via the adventure() and adv1() ASH functions. Valid locations are in adventures.txt and are internally represented by the KoLAdventure object. Many are adventure.php - and the adventure ID is the "snarfblat". But, there is also mining, various bosses, Sorceress Tower crowds, and so on. Adventures are grouped into zones from zonelist.txt
Before it attempts to go to a location, it does a lot of validation.
1) validate1 - is the location available to you at all?
You may have to be a particular level, have a suitable zodiac sign, be at a particular place in a quest, have unlocked access to a zone, and so on. There may be other conditions that need to prevail, but we don't check them here.
If this returns false, there is nothing you can do to go to this zone right now.
1.5) Checks for combat strategy, antidotes if poisonous monsters, and so on.
2) Do recovery and call betweenBattleScript, if any.
If you need to wear an outfit, have a particular familiar, have a particular status effect or need to do anything else to actually make the zone accessible that a script can do without adventuring, do it here. That could include buying or pulling an item.
3) validate2 - are ALL the conditions needed to go to the location active now?
i.e. has the between_battle script done everything it needed to do, if the area had any special requirements.
----------------------
I added location_available(loc) which returns true or false based on step 1 - validate1.
Note that validate1 will return true for a Charter zone or Wormwood, say, because your betweenBattleScript COULD use a day pass or a bottle of absinthe - even buying or pulling.
I am thinking of adding a couple of steps.
1a) If you are under Standard restrictions, all sorts of zones are off limits. You will not have access to a Machine Elf or Snowglobe to go to the Deep Machine tunnels. Your elemental charters are not active and day passes are unavailable.
1b) If you are in Hardcore not in Standard, you (might, depending on path) have your familiars. You might have items dropped by familiars or equipment. So, out-of-standard areas MIGHT be accessible to you.
Otherwise - not in Standard, not in Hardcore - you might have familiars and items and you might be able to buy and/or pull an access item, so everything is fine.
1a and 1b will go into validate1 and hence into location_accessible().
Thoughts? Suggestions? Bugs?
KoLmafia will "automate" adventures for you - via the GUI, via the "adventure" command, via the adventure() and adv1() ASH functions. Valid locations are in adventures.txt and are internally represented by the KoLAdventure object. Many are adventure.php - and the adventure ID is the "snarfblat". But, there is also mining, various bosses, Sorceress Tower crowds, and so on. Adventures are grouped into zones from zonelist.txt
Before it attempts to go to a location, it does a lot of validation.
1) validate1 - is the location available to you at all?
You may have to be a particular level, have a suitable zodiac sign, be at a particular place in a quest, have unlocked access to a zone, and so on. There may be other conditions that need to prevail, but we don't check them here.
If this returns false, there is nothing you can do to go to this zone right now.
1.5) Checks for combat strategy, antidotes if poisonous monsters, and so on.
2) Do recovery and call betweenBattleScript, if any.
If you need to wear an outfit, have a particular familiar, have a particular status effect or need to do anything else to actually make the zone accessible that a script can do without adventuring, do it here. That could include buying or pulling an item.
3) validate2 - are ALL the conditions needed to go to the location active now?
i.e. has the between_battle script done everything it needed to do, if the area had any special requirements.
----------------------
I added location_available(loc) which returns true or false based on step 1 - validate1.
Note that validate1 will return true for a Charter zone or Wormwood, say, because your betweenBattleScript COULD use a day pass or a bottle of absinthe - even buying or pulling.
I am thinking of adding a couple of steps.
1a) If you are under Standard restrictions, all sorts of zones are off limits. You will not have access to a Machine Elf or Snowglobe to go to the Deep Machine tunnels. Your elemental charters are not active and day passes are unavailable.
1b) If you are in Hardcore not in Standard, you (might, depending on path) have your familiars. You might have items dropped by familiars or equipment. So, out-of-standard areas MIGHT be accessible to you.
Otherwise - not in Standard, not in Hardcore - you might have familiars and items and you might be able to buy and/or pull an access item, so everything is fine.
1a and 1b will go into validate1 and hence into location_accessible().
Thoughts? Suggestions? Bugs?