Feature Add Choice Adv control for Reflection of a map

Rinn

Developer
Specifically a setting to automatically run chess solve when on choiceadv443 as I can't seem to manually set that setting to something to automatically solve the chess board.
 

Bale

Minion
Well... if you were doing this as part of a script, then you can use the cli command:
chess solve
 

Rinn

Developer
I can't call use(1, $item[reflection of a map]) from a script without mafia aborting because of an unrecognized choice adventure. I have already set the initial choice to select the chessboard, but as far as I can tell there aren't any relevant settings for the chessboard choice besides 'walk away' which is worse then aborting because I'd just waste a map, and because the script would abort (or I guess I could have it show in browser but for all purposes that's the same as aborting as far as a script is concerned) it would never call 'chess solve'. So basically what I was doing earlier was calling use(1, $item[reflection of a map]) from the cli then when mafia aborted I calling 'chess solve'. That's not an ideal solution.

You and I both know I could manually script this out with two visit_url and a cli_execute, but that doesn't help anyone without scripting ability who would want to acquire a queen cookie automatically.

If there's a choice adventure setting to solve (2 maybe? I didn't think about checking until after my character overdrank) sure I could use that. A drop down setting would still be nice.
 
Last edited:

Bale

Minion
You and I both know I could manually script this out with two visit_url and a cli_execute, but that doesn't help anyone without scripting ability who would want to acquire a queen cookie automatically.

Dang, I was just about to suggest that. :) Yeah, you're right. Mafia should be able to do this.
 

Cheese Loaf

New member
Posted the same thing (basically) in the KOL forums a few days back- seems to have gotten lost in the shuffle:

Quick feature request- apologies if it's been posted before.
Under the items tab (in the choice adv) menu, it would be nice if DRINK ME potions had a drop down menu. I'm going for queen cookies, and each time it's a series of three or four clicks (including a refresh of the browser to show the menu) plus a CLI input (chess solve). Be nice if I could just set it like a llama gong to always follow a particular action- solve the chessboard, hit the field of strawberries, whatever...
Thanks for everything, as always.

Hopefully it'll make it into a future build.
 

Tath

New member
I support Cheese Loaf's idea. The unsupported noncombat is troublesome and, attempting to get queen cookies, I ran a self-made script, but can't seem to get around Mafia aborting after using the reflection of a map. Any tips on this? Or is a Features Add the only way?


This is what I would try to start (please excuse the messy code).
PHP:
cli_execute("use reflection of a map");

visit_url("choice.php?pwd&whichchoice=442&option=5&choiceform5=The+Great+Big+Chessboard");
cli_execute("chess solve");

cli_execute("inv queen cookie");
cli_execute("inv reflection of a map");
print("");

After cli_execute("use reflection of a map"), it would say "unsupported choice adventure (number)" and abort.


I ended up doing this (basically reverse, after using map):

PHP:
visit_url("choice.php?pwd&whichchoice=442&option=5&choiceform5=The+Great+Big+Chessboard");
cli_execute("chess solve");


cli_execute("inv queen cookie");
cli_execute("inv reflection of a map");
print("");

print("GET READY! GET READY! GET READY! GET READY! GET READY! GET READY! GET READY!");

cli_execute("use reflection of a map");
print("Ready!");
 
Last edited:

Bale

Minion
You can prevent mafia from aborting like this:

PHP:
if(cli_execute("use reflection of a map")) {}

visit_url("choice.php?pwd&whichchoice=442&option=5&choiceform5=The+Great+Big+Chessboard");
cli_execute("chess solve");

cli_execute("inv queen cookie");
cli_execute("inv reflection of a map");
print("");

What that does is to capture the error condition. There are several other ways to do it:

PHP:
(! cli_execute("use reflection of a map"));
boolean test = cli_execute("use reflection of a map");

The important thing is that if you make use of the return value, mafia does not abort.
 

Tath

New member
Thanks, Bale.

However, I tried both of those samples and they didn't work; earlier when I said 'it would say "unsupported choice adventure (number)" and abort', I meant it would simply say "unsupported choice adventure" and then stop, no actual phrase "abort" in the log. Again, it's still saying the choice adventure is unsupported even after using the boolean test~, the (! cli_execute~, and the if(cli_execute~, separately, and also with (! cli_execute~, and boolean test~ together (as in your second code box). If I understand correctly (which could be the error), using those lines would be "making use of the return value", but it doesn't seem to stop it from stopping dead in its tracks after the reflection is used.

It's...slightly possible that it might be my version of Mafia, though I updated it just last week-I'll try again tomorrow after updating and post any changes.
 

Bale

Minion
I guess that is a case where the error state cannot be trapped. My bad.

PS. Don't use (! cli_execute~, and boolean test~ together! That's silly since if it worked, it would use the reflection twice. I intended those as two separate examples -- I just didn't want to create two entirely separate code boxes.
 

halfvoid

Member
Wondering if this was ever decided on, or if anyone else found a viable non-aborting workaround. I'm working on a script that would benefit greatly from not aborting at this point. Willing to share it once its completed and tested with whoever has a workaround.
 
A solution?

Attached you will find a patch against current Mafia sources which (partially) implements automated handling of maps. You will of course have to recompile Mafia for this to work. Once the new code is in place, you can select the path to follow from either the GUI (Choice Advs -> Item ->Reflection of a Map) or the CLI (the "rabbitmap" command).

What works or at least should work:
- automated acquisition of queen cookies
- getting to the chessboard and letting the player solve it by hand
- visiting class-nonspecific versions of the Field of Strawberries, the Caucus Racetrack and the Croquet Grounds

What remains to be implemented:
- second-level choices for class-specific locations
- full support for the Duchess' Cottage

Please let me know what you think!
 

Attachments

  • kolmafia-automate-reflection-of-a-map.patch
    12.4 KB · Views: 54

Greenen72

Member
Choice adv automation fails on using Reflection of a map

> use reflection of a map

Using 1 reflection of a map...
Encounter: A Moment of Reflection
Unsupported choice adventure #442
Click here to continue in the relay browser.

choice 1: The Field of Strawberries (Seal Clubber/Pastamancer item, or yellow matter custard)
choice 2: The Caucus Racetrack (Sauceror/Accordion Thief item, or delicious comfit?)
choice 3: The Croquet Grounds (Disco Bandit/Turtle Tamer item, or fight croqueteer)
choice 4: The Duchess' Cottage (you have 1/5 of the items needed for an ittah bittah hookah)
choice 5: The Great Big Chessboard (get a chess cookie)
choice 6: Put the map away (skip adventure)

Using latest version, and I am just assuming that the automated choices is supposed to function for this.
 

Theraze

Active member
That looks like you haven't set your choice... what do you have set where, in terms of "automated choices" that are supposed to handle this?
 

Greenen72

Member
choice%20adv.png


Under the Adventure> Choice Advs tabs
 

roippi

Developer
Since it told you the choice adventure is unsupported, chances are that the choice adventure is in fact unsupported. Making this a feature request.

One I am merging with the previous feature request.
 

Greenen72

Member
So do those options for reflection of a map actually do anything? It led me to believe that it was previously working was unknowingly broken.
 
Top