Page 49 of 52 FirstFirst ... 39 47 48 49 50 51 ... LastLast
Results 481 to 490 of 520

Thread: My personal Meat farming script

  1. #481
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,571

    Default

    I often run VMF right after I finish a run. Since I am slow, many of my runs are five days or more. My skeleton garden, which was unharvested during run because it is out of style, has a Skulldozer. VMF does not fight the Skulldozer. At least twice, due to my repeated inattention, I have not had any adventures left after running VMF to fight it. Would you consider something that might save me from myself? Fighting the dozer is an obvious possibility or just stopping the script if the dozer is there is another. I can think of circumstances where someone else would not want either of those choices so I defer to your wisdom in this matter. Thank you.

  2. #482
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,491

    Default

    That would be in Veracity Garden Harvester. That should or could be configurable to ignore it. It would need code to fight it. I’ll take a look.
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  3. #483
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,491

    Default

    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:
    > ash import <VeracityMeatFarm.ash>; consult_with_madame_zatara()
    
    Now pledging your allegiance to Bonus Adventures from Hell.
    
    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
    Now pledging your allegiance to Hardcore Oxygenation.
    
    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.

  4. #484
    Senior Member Crowther's Avatar
    Join Date
    Nov 2006
    Posts
    1,528

    Default

    Collecting those automatically is really a pain. Easyfax will come visit your clan, assuming it hasn't been trapped as clan leader, which has been happening often since the once a week check was changed to daily.

  5. #485
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,491

    Default

    I didn't know EasyFax would do that too - and in your own clan. Will it linger, waiting for all three Madame Zatara requests?
    I could make this configurable to use either CheeseFax or EasyFax; the only difference would the clan switching - and doing whatever is needed to summon EasyFax.
    And I am sure that Frono will comment that his "doesn't have chat access" multi can't use "/whitelist" to switch clans.

    (I've noticed a lot of errors, right after rollover, from EasyFax saying "that monster is not available. Look at this file to see what is available" - and I look there and the monster is there. As expected, since we wouldn't have sent you a request if we didn't see it in the config file. Is that message the equivalent of "Help, I'm stuck in a clan and can't get out to go get that monster"?)

  6. #486
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,491

    Default

    And I have what is, essentially, an "inventory difference" function that I could use to extract what you got without having to look at kmail by comparing your inventory before consulting Madame Zatara with what it is afterwards (having refreshed inventory, which will account for the items that came in kmail).

    I'll try that tomorrow.
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  7. #487
    Senior Member Crowther's Avatar
    Join Date
    Nov 2006
    Posts
    1,528

    Default

    Will it linger, waiting for all three Madame Zatara requests?
    Originally Posted by Veracity View Post
    No, you have to make three requests which means it changes clans six times. Not the best designed.

  8. #488
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,491

    Default

    That would be in Veracity Garden Harvester. That should or could be configurable to ignore it. It would need code to fight it. Iíll take a look.
    Originally Posted by Veracity View Post
    I just planted a Bone Garden. I've had Tall Grass ever since it came out; it is the only Standard-compatible Garden, and I've pulled 4 Mu familiars out of it, which have more than paid for it.
    But I'm done with Standard for the year (6 Normal and 6 Hardcore ascensions) until the next challenge path, so I have time to try this out.
    Stay tuned.
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  9. #489
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,571

    Default

    *snicker*

    The chatless multi exists in that state to keep KoLMafia accessible to all. So I should be fine if a script requires chat :-)

    Thanks for the clan switching discussion. It explains some faxbot issues I have seen but not reported.

  10. #490
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,491

    Default

    Revision 225 soups up the Zatara consultations a few ways:

    KoLmafia has some existing properties, used by the "fortune" command and the ClanFortuneRequest:

    // clanFortuneWord1 default = pizza
    // clanFortuneWord2 default = batman
    // clanFortuneWord3 default = thick

    VMF now uses those values for word1, word2, and word3.

    Those are all "compatible" requests to CheeseFax's responses. If you want "incompatible" prizes from any question, change the appropriate word.

    I also save your inventory before doing the Zatara queries and, when you are done, after refreshing inventory, get the current inventory.
    I You can get other items in kmail and can lose items to PVP, so I filter on valid Zatara prizes and tell you what you got.

    None of the above has actually been tested in the wild. I will see for myself after rollover and fix any issues. Not that I expect any.

    New function:

    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;
        }
    
        string word1 = get_property( "clanFortuneWord1" );
        boolean compatible1 = word1 ≈ "pizza";
        string word2 = get_property( "clanFortuneWord2" );
        boolean compatible2 = word2 ≈ "batman";
        string word3 = get_property( "clanFortuneWord3" );
        boolean compatible3 = word3 ≈ "thick";
    
        print( "Consulting with CheeseFax seeking {" +
    	   ( compatible1 ? "compatible" : "incompatible" ) + ", " +
    	   ( compatible2 ? "compatible" : "incompatible" ) + ", " +
    	   ( compatible3 ? "compatible" : "incompatible" ) +
    	   "} prizes." );
    
        // CheeseFax
        int player = 3038166;
    
        // Unless CheeseFax is on your contact list, this will return the player ID.
        // Which works, even though responses from Madame Zatara will use the name
        string name = get_player_name( player );
    
        string consultURL =
    	"choice.php?pwd=&whichchoice=1278&option=1&which=1" +
    	"&whichid=" + name +
    	"&q1=" + word1 +
    	"&q2=" + word2 +
    	"&q3=" + word3;
    
        // Save current inventory
        item_to_int_map initial_inventory = get_inventory();
    
        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;
    	}
    
    	int retries = 12;
    	while ( true ) {
    	    string page = visit_url( "clan_viplounge.php?preaction=lovetester", false );
    	    page = visit_url( consultURL );
    	    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" );
    
    	item_to_int_map inventory_diff = item_map_difference( initial_inventory, get_inventory() );
    
    	// You can gain other items in kmail or lose things by PVP.
    	// Make a map containing only Zatara's prizes
    	item_to_int_map prizes;
    	foreach it, count in inventory_diff {
    	    if ( ZATARA_PRIZES contains it && count == 1 ) {
    		prizes[ it ] = count;
    	    }
    	}
    
    	if ( count( prizes ) > 0 ) {
    	    print( "The following iteme arrived from " + name + ":" );
    	    foreach it, count in zatara_prizes {
    		print( "&nbsp;&nbsp;&nbsp;&nbsp;" + it );
    	    }
    	}
        }
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •