Page 4 of 4 FirstFirst ... 2 3 4
Results 31 to 38 of 38

Thread: My personal Meat farming script

  1. #31
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    12,968

    Default

    The first one is the only one that has bothered me; Testudinada has been off-line twice. The first time, so was Noblesse Oblige, so a backup buffbot would not have helped. The second time, N.O. was online. In both cases, restarting the script just picked up where it left off, and, Testudinada having come online, it worked fine.

    I only have one character who doesn't know Ode, otherwise, I might feel more motivation to finish that feature.
    Originally Posted by Veracity View Post
    I use buffy. Buffy doesn't even need meat to know which buff to cast. Here's a snippet from my farming script.

    Code:
    	if(!have_skill($skill[The Ode to Booze]) && have_effect($effect[Ode to Booze]) < inebriety_limit() - my_inebriety()) {
    		cli_execute("send to buffy || The Ode to Booze");
    		cli_execute("wait 30; refresh status");
    	}
    I assume that you're already planning to use is_online() to choose between buffbots.
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


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

    Default

    I already use is_online() to detect that my chosen buffbot is not available. I'll just need to have all three - Buffy, Testudinata, and Noblesse Oblige - ranked (presumably with Buffy first since she is free. Always? Once a day?) and go to the best one which is currently online before aborting.
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  3. #33
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    12,968

    Default

    (presumably with Buffy first since she is free. Always? Once a day?)
    Originally Posted by Veracity View Post
    Buffy runs on a point system. You get 3000 MP worth of buffs a day. Casting Ode to Booze costs 42 MP (for 25 turns) out of the 3000 MP available to you. So... well, if you do nothing else with buffy other than Ode to Booze it is basically unlimited. She also has a web interface HERE.
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


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

    Default

    Now that I'm done with Chakras, I'm back to this script. I uploaded a new version to the first post. Lots of little fixes and a few new features:

    - Flush out wanders in a Hidden City shrine before going into the DMT, as suggested.
    - Initial support for Sweet Synthesis.

    Spleening is more complicated, now, since it involves both Sweet Synthesis and Numberology, but it works nicely. Since it's an interesting function, I insert it here for your amusement, no need to download the script.

    Code:
    void spleen_up()
    {
        void use_spleen( int spleen )
        {
    	item candy1;
    	item candy2;
    
    	void choose_candy( effect target )
    	{
    	    if ( target == SYNTHESIS_GREED ) {
    		candy1 = $item[ bag of W&Ws ];
    		candy2 = $item[ bag of W&Ws ];
    	    } else if ( target == SYNTHESIS_COLLECTION ) {
    		candy1 = $item[ Milk Studs ];
    		candy2 = $item[ Milk Studs ];
    	    }
    	}
    
    	// Synthesize to get configured farming effect
    	if ( can_synthesize && synthesis_target != NO_EFFECT ) {
    	    int turns_remaining = my_adventures();
    	    int current_effect = have_effect( synthesis_target );
    	    // Fudge factor: +25 to accomodate extra turns from wads or Pantsgiving
    	    int synthesis_casts = min( spleen, ( turns_remaining - current_effect + 29 + 25 ) / 30 );
    	    choose_candy( synthesis_target );
    	    while ( synthesis_casts-- > 0 ) {
    		if ( !sweet_synthesis( candy1, candy2 ) ) {
    		    break;
    		}
    		spleen--;
    	    }
    	}
    
    	// Chew wads for rest of spleen
    	if ( spleen > 0 ) {
    	    chew( spleen, TWINKLY_WAD );
    	}
        }
    
        int current_spleen = my_spleen_use();
        int max_spleen = spleen_limit();
    
        if ( current_spleen >= max_spleen ) {
    	return;
        }
    
        print( "Poisoning your spleen" );
    
        // We can combine spleen with Numberology
    
        int calculations_used = get_property( "_universeCalculated" ).to_int();
        int calculations_available = get_property( "skillLevel144" ).to_int();
    
        while ( current_spleen < max_spleen ) {
    	int spleen = max_spleen - current_spleen;
    	if ( numberology_available && calculations_available > calculations_used ) {
    	    for i from 0 to spleen {
    		if ( reverse_numberology( 0, i ) contains numberology_goal ) {
    		    spleen = i;
    		    break;
    		}
    	    }
    	    if ( spleen == 0 ) {
    		cli_execute( "numberology " + numberology_goal );
    		calculations_used += 1;
    		continue;
    	    }
    	}
    	use_spleen( spleen );
    	current_spleen = my_spleen_use();
        }
    }
    This will be better once Sweet Synthesis Phase 5 is done, but even with just this, the Meat/adventure yield of this script is much improved. Even with its suboptimal choice of consumables.
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  5. #35
    Senior Member ckb's Avatar
    Join Date
    Mar 2006
    Posts
    630

    Default

    This is interesting reading. Gets me thinking more about my own scripts and what they do, or could do. Thanks.

    On a side note, Looking at various scripts and scriptors is fascinating with regard to syntax. Veracity and Ezandora write long and very spaced code. zarqon avoids white-space like its a danger to his existence. Bale and I seem to fall somewhere in between.

  6. #36
    Developer
    Join Date
    Aug 2009
    Posts
    2,565

    Default

    Veracity's style looks like the same as the Mafia codebase, which isn't a surprise. I suspect a lot of Ezandora's code is generated, but it does follow Allman (BSD) style. I personally tend toward K&R style, myself. I suspect Bale / Zarqon are self-taught (and don't do this sort of thing for a living), so their individual styles are more organic (and not as easily attributable to a particular style).

  7. #37
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    10,532

    Default

    Well, I do cuddle braces, which is not the KoLmafia standard. But that's how I write C, so I do it in Java - and ASH - too.
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  8. #38
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    10,532

    Default

    By the way - use_spleen() is simplified, now that ASH can pick candies and synthesize for you.

    Code:
        void use_spleen( int spleen )
        {
    	// Synthesize to get configured farming effect
    	if ( can_synthesize && synthesis_target != NO_EFFECT ) {
    	    int turns_remaining = my_adventures();
    	    int current_effect = have_effect( synthesis_target );
    	    // Fudge factor: +25 to accomodate extra turns from wads or Pantsgiving
    	    int synthesis_casts = min( spleen, ( turns_remaining - current_effect + 29 + 25 ) / 30 );
    	    while ( synthesis_casts-- > 0 ) {
    		// Flags = 1 to choose "available" candies vs. "cheap" candies
    		if ( !sweet_synthesis( synthesis_target, 1 ) ) {
    		    break;
    		}
    		spleen--;
    	    }
    	}
    
    	// Chew wads for rest of spleen
    	if ( spleen > 0 ) {
    	    chew( spleen, TWINKLY_WAD );
    	}
        }
    I chose to use candy in inventory because all of my characters have a years worth of cheap candies and are thus immune to market swings.

    There is also the issue that disabled player stores show up in mall searches and artificially lower the "expected" price you'll pay for some candies. I think that is a KoL bug: why does a mall search even show you the stores of disabled players, since there is no indication you can't buy it before trying and being told "nope"?

    I'll submit a bug report...
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

Posting Permissions

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