Page 1 of 22 1 2 3 11 ... LastLast
Results 1 to 10 of 211

Thread: My personal Meat farming script

  1. #1
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    10,950

    Default My personal Meat farming script

    I posted this a while ago, but I have developed it considerably since then. In particular, it works for my main (who has all the skills and items) as well as my various multis, who farm Meat for no other reason than to have as much as they might need to test KoLmafia.

    I have a bunch of hard-coded food, booze, and spleen choices, and I suppose I could use Somebody Else's Code to make better choices, but I just don't care. These are Good Enough.

    I post this because it has a few things that might make other peoples' lives simpler. For example:

    - I combine filling my spleen (with twinkly wads, which are not optimal, but I have, literally, 10s of thousands of them on every character) with numberology.
    - Here is working code to take the "greasing the tracks" quest (when available) in Dinseylandfill at Barf Mountain - where I would go anyway - and fulfilling and redeeming it.

    And so on. This does, literally, everything that I care about to use my turns, use my Daily Deeds, and so on, with no thought, for my main and all my multis.

    As I said, this will suit nobody's needs other than my own, but parts of it may very well help others, so, enjoy!

    Edit: Uploaded newest version. It is much more of a "real script" now:

    - main_function call tasks in individual functions, making it easier to adapt/eclude/edit
    - configuration variables at top.

    and a whole bunch more functionality, documented at top.

    Edit 2: Uploaded newest version.

    - Heavily commented to, one hopes, make it easy to figure out how to configure.
    - All sorts of little bugs fixed.
    - Additional functionality.

    Edit 3: Uploaded newest version

    - Bug fixes
    - Flush out wanderers before going into Deep Machine Tunnels
    - Initial support for Sweet Synthesis
    - Cumulative records: total meat and total turns spent running this script

    Edit 4: Now on SVN!

    Code:
    svn checkout https://svn.code.sf.net/p/veracity0/code/meat-farm
    It will put VeracityMeatFarm.ash into your scripts folder.

    - Bug fixes
    - Support for portable Mayo clinic
    - If you really want to use your Hobo Monkey when you have a Tot, you can configure that
    Attached Files
    Last edited by Veracity; 02-24-2017 at 10:46 PM.
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  2. #2
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    10,950

    Default

    (I moved this over to "Turn-Burning Scripts")

    I have continued to refine this and now it will bust ghosts, as appropriate. This was my introduction to combat filters. Here is the code:

    Code:
    string bust_ghost_filter( int round, monster mon, string page )
    {
        boolean [string] subtypes = mon.sub_types;
    
        if ( subtypes contains "ghost" ) {
    	switch ( round ) {
    	case 0:
    	    return "skill Summon Love Gnats";
    	case 1:
    	case 2:
    	case 3:
    	    return "skill shoot ghost";
    	case 4:
    	    return "skill trap ghost";
    	}
        }
    
        return "";
    }
    
    item protonic_accelerator_pack = $item[ protonic accelerator pack ];
    item talisman_o_namsilat = $item[ Talisman o' Namsilat ];
    
    void bust_ghost()
    {
        location paranormal = get_property( "ghostLocation" ).to_location();
        if ( paranormal != $location[ none ] ) {
    	slot back = $slot[ back ];
    	item back_item = equipped_item( back );
    	if ( back_item != protonic_accelerator_pack ) {
    	    equip( back, protonic_accelerator_pack );
    	}
    
    	location palindome = $location[ Inside the Palindome ];
    	slot acc3 =  $slot[ acc3 ];
    	item acc3_item = equipped_item( acc3 );
    	if ( paranormal == palindome && acc3_item != talisman_o_namsilat ) {
    	    equip( acc3, talisman_o_namsilat );
    	}
    
    	try {
    	    adv1( paranormal, 0, "bust_ghost_filter" );
    	}
    	finally {
    	    equip( back, back_item );
    	    equip( acc3, acc3_item );
    	}
        }
    }
    
    void do_adventure( int turns, location loc )
    {
        if ( available_amount( protonic_accelerator_pack ) != 0 ) {
    	while ( turns > 0 ) {
    	    bust_ghost();
    	    adventure( 1, loc );
    	    turns -= 1;
    	}
        } else {
    	adventure( turns, loc );
        }
    }
    The Wiki says that when you bust a ghost, 50 turns later, you are given another opportunity - and my session logs confirm that. I don't know if we have a setting to track that -> lastBustedGhostTurn, or something. If so, it would be easy enough to bulk-adventure the exact number of turns needed to get the next notification, rather than doing 1 adventure at a time. No increase in server hits doing one at a time; it would simply cut down the processing time to validate the location. So, no big deal. I might look into it, by and by.
    Attached Files
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  3. #3
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,225

    Default

    I have continued to refine this and now it will bust ghosts, as appropriate. This was my introduction to combat filters. Here is the code:
    Originally Posted by Veracity View Post
    That makes sense considering your recent interests.

    Incidentally, my solution to the problem was to add code in my afterAdventureScript to detect if I have a ghost to bust. That way it fires regardless of what I'm doing to farm. Then for fighting the ghost instead of a function for the combat filter I use a macro:

    Code:
    adv1(ghostLocation, -1, "while hasskill Shoot Ghost; skill Shoot Ghost; if hasskill Trap Ghost; skill Trap Ghost; endif; endwhile;");
    The ability to add any arbitrary BALLS macro in place of a combat filter is kinda amazing.


    The Wiki says that when you bust a ghost, 50 turns later, you are given another opportunity - and my session logs confirm that. I don't know if we have a setting to track that -> lastBustedGhostTurn, or something. If so, it would be easy enough to bulk-adventure the exact number of turns needed to get the next notification, rather than doing 1 adventure at a time. No increase in server hits doing one at a time; it would simply cut down the processing time to validate the location. So, no big deal. I might look into it, by and by.
    Originally Posted by Veracity View Post
    Mafia tracks nextParanormalActivity which is the turn on which it will happen so...
    Code:
    int turnsToGo = to_int(get_property("nextParanormalActivity")) - total_turns_played();
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


  4. #4
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    10,950

    Default

    So... If your last adventure of the day reports paranormal activity, your afterAdventureScript will attempt to bust a ghost - which takes no turn, but you have to have a turn available?

    I don't think that's quite right.

    Also, I am attempting to have no scripts - except for my CCS and this script - needed to configure in order to Farm my Daily Meat.

    I'm now working on Witchess and a combat filter which will handle the Hobo Monkey better.
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  5. #5
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    10,950

    Default

    Here is the Hobo Monkey filter:

    Code:
    string hobo_monkey_filter( int round, monster mon, string page )
    { 
        static boolean gave_meat = false;
    
        if ( round == 0 ) {
    	gave_meat = false;
    	switch ( my_class() ) {
    	case $class[ Accordion Thief ]:
    	case $class[ Disco Bandit ]:
    	    return "pickpocket";
    	}
        }
    
        if ( my_familiar() == $familiar[ hobo monkey ] ) {
    	if ( !gave_meat ) {
    	    gave_meat = page.contains_text( "where did he find that?" );
    	}
    
    	return gave_meat ? "attack" : "item seal tooth";
        }
    
        return "";
    }
    
    void do_adventure( int turns, location loc )
    {
        if ( available_amount( protonic_accelerator_pack ) != 0 ) {
    	while ( turns > 0 ) {
    	    bust_ghost();
    	    adventure( 1, loc, "hobo_monkey_filter" );
    	    turns -= 1;
    	}
        } 
        adventure( turns, loc, "hobo_monkey_filter" );
    }
    Takes from 1 to (however many, at a 1/3 chance per round) to get the "familiar steals Meat" message and then just attacks.
    Last edited by Veracity; 12-01-2016 at 04:24 AM.
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  6. #6
    Senior Member Theraze's Avatar
    Join Date
    Mar 2010
    Posts
    8,659

    Default

    Code:
    adv1(ghostLocation, -1, "while hasskill Shoot Ghost; skill Shoot Ghost; if hasskill Trap Ghost; skill Trap Ghost; endif; endwhile;");
    Originally Posted by Bale View Post
    If it takes 0 turns for busting ghosts, shouldn't that -1 (calculate turns normally) actually be set to 0 (adventure doesn't take a turn)?

  7. #7
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,225

    Default

    I suppose it could. Though I'm still pretty sure that you actually need a turn to bust a ghost even though the turn isn't spent. So shouldn't I let mafia calculate it normally?

  8. #8
    Senior Member
    Join Date
    Apr 2009
    Posts
    1,657

    Default

    Isn't it one of the newishfangled "free if you win, but costs a turn if you lose" things, which is what requires that one remaining turn?

  9. #9

    Default

    You need a turn to be allowed to enter all the ghost zones, to trigger the combat, I'm fairly sure that was the same before the change. Pretty much the same as the game requiring you to have a turn to enter any location to trigger a digitized witchess piece, I think.

  10. #10
    Developer
    Join Date
    Aug 2009
    Posts
    2,630

    Default

    You need a turn to be allowed to enter all the ghost zones, to trigger the combat, I'm fairly sure that was the same before the change. Pretty much the same as the game requiring you to have a turn to enter any location to trigger a digitized witchess piece, I think.
    Originally Posted by the dictator View Post
    Isn't it one of the newishfangled "free if you win, but costs a turn if you lose" things, which is what requires that one remaining turn?
    Originally Posted by xKiv View Post
    As far as I'm aware, these changes were intended to eliminate certain bugs related to free fights (mostly infinite meat/certain items, iirc). Ronin-breaking not so much because that was "fixed" in a way that led to turn-saving exploits requiring 0 adv remaining (e.g. crafting in underworld, fighting NS with 1 adv remaining).

Posting Permissions

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