I've been working on visiting Madame Zatara and collecting the three daily items. CheeseFax is configured to respond appropriately, if you are in Bonus Adventures to Hell. How hard could it be? It was trickier than I anticipated, but after consulting with cheesecookie about how CheeseFax operates, I have it working. I might do some tweaking, but I'll release this now so others can try it out.
Here are the configuration options:
Code:
// Which fortune teller buff to request
//
// susie (familiar) A Girl Named Sue (Familiar Weight: +5, Experience (familiar): +5, Familiar Damage: +10)
// hagnk (items) There's No N in Love (Item Drop: +50, Food Drop: +50, Booze Drop: +50)
// meatsmith (meat) Meet the Meat (Meat Drop: +100, Gear Drop: +50)
// gunther (muscle) Gunther Than Thou (Experience (Muscle): +5, Muscle Percent: +100, Maximum HP Percent: +50)
// gorgonzola (mysticality) Everybody Calls Him Gorgon (Experience (Mysticality): +5, Mysticality Percent: +100, Maximum MP Percent: +50)
// shifty (moxie) They Call Him Shifty Because... (Experience (Moxie): +5, Moxie Percent: +100, Initiative: +50)
// none
string fortune_teller_npc = define_property( "VMF.FortuneTellerNPC", "string", "meat" );
// Go to Bonus Adventures From Hell and consult with CheeseFax
//
// send: pizza, batman, thick
// receive: beer, robin, thin
boolean consult_with_cheesefax = define_property( "VMF.ConsultWithCheeseFax", "boolean", "false" ).to_boolean();
Like other Clan Lounge things, VMF will look in your own clan for furnishings. So, if you want a buff - such as "meat" or "items" or whatever - specified via VMF.FortuneTellerNPC, you need the fortune teller in your own clan.
That is not the same for consulting with CheeseFax, though. You need the following:
- a VIP lounge key
- a whitelist to Bonus Adventures From Hell
- not being the clan leader, since if you are, you cannot leave the clan.
Given those, do this:
set VMF.ConsultWithCheeseFax=true
and VMF will get you some stuff each day. Here's gCLI output of today's test:
Code:
[color=green]> ash import <VeracityMeatFarm.ash>; consult_with_madame_zatara()[/color]
[color=green]Now pledging your allegiance to Bonus Adventures from Hell.[/color]
You are currently a member of Bonus Adventures from Hell
Visiting Hot Dog Stand in clan VIP lounge
Visiting Speakeasy in clan VIP lounge
Visiting Floundry in clan VIP lounge
Visiting Fortune Teller in clan VIP lounge
You enter your answers and wait for 3038166
Waiting for 3038166 to respond...
Visiting Fortune Teller in clan VIP lounge
You enter your answers and wait for 3038166
Waiting for 3038166 to respond...
Visiting Fortune Teller in clan VIP lounge
You enter your answers and wait for 3038166
Waiting for 3038166 to respond...
Visiting Fortune Teller in clan VIP lounge
[color=green]Now pledging your allegiance to Hardcore Oxygenation.[/color]
You are currently a member of Hardcore Oxygenation
Updating inventory...
Returned: void
02/04/20 11:02:29 AM - New message received from CheeseFax.
02/04/20 11:02:40 AM - New message received from CheeseFax.
02/04/20 11:02:51 AM - New message received from CheeseFax.
(The New Message lines did not appear until I opened the Relay Browser)
This is tricky, since you are interacting with a different KoL player.
Requesting a fax: sent a chat message, wait for a chat message in response. We have built-in support in KoLmafia to recognize the chat response and built in ASH functions to handle the whole transaction.
Asking for a buff from a buffbot: send an IM or kmail, receive a response. You can tell when it finishes by looking at active effects.
Madame Zatara: make a request to ask for a reading. Eventually, the other player responds and you get kmail.
We have the "fortune" command to make requests of Madame Zatara - "fortune CheeseFax pizza batman thick" will initiate the request, but not wait for the response. Looking at the request/response interactions with Madame Zatara, I see no way to probe her and see if you have an outstanding request, other than trying to make another request and being told you are waiting; you can't just visit her and learn that.
And once you know the request is complete, you can't see the results without looking at kmail.
I initially worked on setting up ASH access to KoLmafia's internal kmail functionality - no longer active; we used to have an "Ice Penguin" (play on "Firefox") GUI, but hola removed that a long time ago - but that turned into a whole lot of too much work. So I took inspiration from cc_ascend's interface to Madame Zatari (helpfully provided by cheesecookie) and rolled it into a simple version that suits this script's needs: As you can see from the above output, it works.
I am disappointed I could not use the built-in "fortune" CLI command for this. Perhaps I could add ASH functionality. But, visit_url, for now.
Here's the function I wrote, for amusement:
Code:
void consult_with_madame_zatara()
{
if ( !have_lounge_key || !consult_with_cheesefax ) {
return;
}
// Check how many times you've consulted with a clanmate.
// You are allowed three per day.
if ( get_property( "_clanFortuneConsultUses" ).to_int() >= 3 ) {
return;
}
try {
// We start out in home_clan
if ( home_clan != BAFH ) {
cli_execute( "/whitelist " + BAFH );
}
if ( BAFH != get_clan_name() ) {
print( "You are not whitelisted in " + BAFH + ". Fix that and try again.", "red" );
return;
}
// CheeseFax
int player = 3038166;
string name = get_player_name( player );
int retries = 12;
while ( true ) {
string page = visit_url( "clan_viplounge.php?preaction=lovetester", false );
page = visit_url( "choice.php?pwd=&whichchoice=1278&option=1&which=1&whichid=" + name + "&q1=pizza&q2=batman&q3=thick" );
if ( page.contains_text( "You can't consult Madame Zatara about your relationship with anyone else today." ) ) {
return;
}
if ( page.contains_text( "You enter your answers and wait for " + name + " to answer, so you can get your results!" ) ||
page.contains_text( "You're already waiting on your results with " + name + "." ) ) {
print( "Waiting for " + name + " to respond..." );
}
else if ( page.contains_text( "You can only consult Madame Zatara about someone in your clan.") ) {
print( name + " is not in the clan. Waiting...", "blue" );
} else {
print( "Waiting for " + name + " to respond..." );
}
if ( --retries < 0 ) {
print( name + " seems to be lost. Giving up.", "red" );
return;
}
waitq( 10 );
}
} finally {
if ( home_clan != get_clan_name() ) {
cli_execute( "/whitelist " + home_clan );
}
// New items arrive in kmail
cli_execute( "refresh inventory" );
}
}
Switching clans via "/whitelist" is easy, but weird. It submits a chat request, whose response has a JavaScript redirect to the appropriate clan recruiter page, which we submit.
And the output looks prettier if you have CheeseFax in your contact list - although it is not necessary.
Revision 224.