The Castle and the Encounters List

Metraxis

Member
I'm currently working on my own Hardcore Ascension script, but have hit a snag. So far, I've been lucky in that I've always gotten the Wheel adventure twice while satisfying the main castle goal (Get all of: needle,fur,journal, heavy d, candle), but this is not guaranteed to be the case. Is there a way in ASH for a Script to become aware of the state of the Wheel, either by looking at the "Encounter Listing" or some other way?
 

holatuwol

Developer
The best way is to use the giant castle map and check to see if you've acquired a quantum egg.  If not, then add one more choice adventure condition and go.  Use it again when the condition is satisfied, and if you still have no egg, repeat one last time.
 

Metraxis

Member
But doesn't that require that the number of adventures be batched together? This is problematic for me, as the main loop of the script issues adventures one at a time, to allow for things like buff maintenence, custom recovery and adjustment of the MCD. Or is there a non-destructive way to check conditions? (ie When issuing "conditions check" from the graphical cli, it always seems to clear out any pending choiceadv conditions. Obviously this is less than optimal when you need to see if the choiceadv condition is satisfied)
 

Nightmist

Member
Thats the problem, as far as I know of, there is no way to check if you have or have not been in a choice adventure in your "last adventure". Unless you override "adventure" and turn it into a home-brew visit_url complex which sets a variable... but that sounds a "little" bit too much of a hassle. You have to do this since you cant check if the "choice adv" condition has been met or not within a script. (By "have to" I mean, "as far as I know of")

Oh and Metraxis was asking if there was a way to check what position the wheel is in, without having to adventure in the castle to check I assume.
 

Nightmist

Member
[quote author=Alexander Daychilde link=topic=545.msg2694#msg2694 date=1162274557]
I don't think there's a way for KoLMafia to know where the wheel is at until you hit a choice adventure or you get some stats..
[/quote]
Heh but when one is on a fresh ascension, you know a certain giant needs to be on trash, which gives us the important position. If you also record the direction you spin the wheel in that ascension you also know where the wheel will be over sessions since it doesn't reset unless you jump the gash, which resets it to a known position. (True that you can't tell when your in the middle of an ascension and its the first time you run mafia until it hits one of the wheel adventures though)

Conditions wont work for this guy since he has said he runs his adventures in a 1 adventure per loop and theres no "boolean No_Conditions_Remaining()" function. (Although I could be wrong, I haven't messed with conditions for a long time.)
 

Metraxis

Member
I am looking to determine the state of the wheel, but not neccesarily without adventuring. Mafia already collects the information I'm after (In 'Encounters Listing') and I'm just trying to find a way to get at it or something similar. The poster above is right about there being no function either of is aware of that will identify the last adventure by name.

To explain why conditions won't work in my case, here is the main loop:

Code:
while(!satisfied(WorldState.CurrentGoal) && my_level()==CurrentLevel && my_adventures() > 0 && have_effect($effect[Beaten Up]) == 0) {
	if(WorldState.CurrentGoal.type == "IA" || WorldState.CurrentGoal.type == "IT" || WorldState.CurrentGoal.type == "C" || WorldState.CurrentGoal.type == "L") {
		strategy();
		WorldState.lastadventure=adventure(1, WorldState.CurrentGoal.area);
	} else if(WorldState.CurrentGoal.type == "V") {
		dump=visit_url(WorldState.CurrentGoal.URL);
	} else {}
}

As you can see, conditions aren't compatible with this style of batching, since they can't be tested non-destructively. I'll admit I could have the script attempt to use the castle map after every adventure until it works, but that seems like an unkindness to the servers.

On an unrelated side note, I wonder if it is a sign of overthinking the project that this script makes me wish ASH supported inheritence, member functions and polymorphism.
 

holatuwol

Developer
Helping someone write an automatic ascension bot is terrible motivation for adding access to the encounters list, so that's not happening (unless, as was the case with visit_url, you help satiate a curiosity I have ... and I have no curiosities at the moment, so that option's out ^_~).  Anyway, while it's not easy to get at the information you want, it's not impossible.

What you can do is setup a combat consult script which sets a user property to indicate that a battle occurred and then completes the battle using the player's preferred combat tactic.  Before every adventure, blank out the property and set a different property indicating the player's preferred combat tactic.  If it's set after coming back from an adventure, you know a battle happened.  If it's not set, well, a noncombat happened.

The castle has well-defined patterns to what kinds of noncombat actions happen, and every one of them, save two, gives item drops.  One of them gives stat gains.  Because you're in hardcore, these stat gains ALWAYS give you a full stat point.  Track all of this. If no stat point change happens and no items dropped, you obviously hit the wheel.
 
It seems to me that if the original poster would have made use of the between battle action (unconditional in moods) having it call a script then they wouldn't need the to loop 1 adventure at a time which would make the conditions feature usefull again, and would allow counting the hits on the wheel by only adding 1 encounter at a time to the list. Saving this across sessions is then painless.

Now the concern with this may be that they want different buffs at different times in the script, but controlling a between battle script from a turn burning or questing script is made simple by creating custom properties in the main script, and reading them in the between battle script.
 

Metraxis

Member
I have seen references to 'consult' in a couple places, and while I find it to be an interesting option, I've not yet found the thread or article which explains exactly how it works.

And I do apreciate holatuwol's position on Cradle-to-Grave scripting, which is the reason I left all the 'useful' bits out of the code snippet I posted.
 
Top