Page 1 of 21 1 2 3 11 ... LastLast
Results 1 to 10 of 203

Thread: auto BHH and friends

  1. #1
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,270

    Default auto BHH and friends

    This script has gone through many versions and authors so I am creating this new post to introduce it. The original thread resumes in the next post.



    The purpose of this script is to automatically go to the Bounty Hunter Hunter, accept bounties, hunt them and turn in the completed bounties for lucre.

    To install this script, please copy/paste the following line into KoLmafia's CLI and press enter:
    svn checkout https://svn.code.sf.net/p/autobhh/code/
    Last edited by Bale; 05-23-2014 at 07:14 AM.

  2. #2

    Default auto BHH and friends

    This post is for my BHH library, and a small script to demonstrate both its usage (for your own scripts), and also to do some automated bountyhunting, if you dont want to write your own script to do so.
    The BHH Library is explained below. I started this new thread mostly so I could use degrassi's version checking script.
    The auto bountyhunt script features use of the olfaction skill (if you have it) to track the appropriate monster. It also features some interesting 'auto adventuring' code, of a style I've found myself using more and more often. Basically, it over rides mafias built in adventure() method, while still retaining the benefits of your battleaction (whether its a consult ash script, a basic CCS, or just 'attack with weapon'. whatever), your defined HP and MP restoration, and mood maintenance. This has use in a wide variety of places nowadays.
    An example of other areas where this is useful
    • [li]Throwing a butterfly at the first duck on the farm, during the islandwar quest[/li]
      [li]Identifying spheres in the hidden city zone by using them in combat[/li]
      [li]Identifying bang potions by using them in combat[/li]
      [li]Using flyers on monsters during the entire islandwar quest, if you have a flyer to use[/li]

    Just to name a few.

    I also use degrassi's interesting version tracking script, because its a cool script! (thanks, degrassi!)

    BTW: I haven't had a chance yet to test the auto bountyhunt script in an area with choice adventures, I'm not 100% sure if those will get handled correctly by the script.

    EDIT: Whoops, I forgot to include a string to make the version checking actually work. D'oh!

    [i][current version: 1.0]

  3. #3

    Default Re: auto BHH and friends

    About the BHH Library, bountyhunting.ash, bounty.txt, and 'make bountytxt.ash'

    These scripts make use of a clever idea by macman to store data about all the potential bountyhunts in a map file, so that you can access metadata about the various bountyhunts (how many items, which items, which zone, etc). This data file uses the following metadata for each bountyhunt.
    Code:
    record BountyInfo
    {
    	int bountyTarget;
    	location bountyLocation;
    	item bountyItem;
    	boolean muscleSignSafe;
    	# -1 means boost -combats, 0 means leave alone, 1 means boost +combats
    	int combats;
    	string trackableMob;
    	int [int] choiceAdventureChanges;
    };
    I think it's fairly self descriptive.
    "Bounty.txt" is the actual data file used, "make bountytxt.ash" is the script one can use to generate "bounty.txt".

    I have also written a script to generally facilitate scripted bountyhunting, although it will not actually do your bountyhunting for you. This script is "bountyhunting.ash". Of particular interest is a function which will report which bountyhunts are available, so you can make 'smart' scripted decisions as to which bountyhunt to take.
    I make use of this library file in "auto bountyhunt.ash".
    Code:
    # returns a map of bountyinfo objects
    # each one represents one of todays bounty hunting options
    # the first one is the 'easy' one, third one is the 'hard' one
    BountyInfo [int] bounty_options ()
    There are several other useful bountyhunt related functions.
    Code:
    # accept a given bounty hunt with the BHH
    boolean accept_bounty(item acceptplz)
    
    # return true if you have an outstanding hunt
    boolean have_bountyhunt()
    
    # return true if you've completed a hunt today
    boolean done_bountyhunt()
    
    # just in case you want to cancel
    void cancel_bountyhunt()
    
    # just in case you forget your current bounty
    BountyInfo current_bounty()
    And finally:
    Code:
    boolean can_access_hunt(BountyInfo hunt)
    This final function attempts to figure out if you can access the particular bountyhunt zone.

  4. #4
    Senior Member
    Join Date
    Apr 2006
    Posts
    132

    Default Re: auto BHH and friends

    wow, great script. worked awesome. especially with olfaction

  5. #5
    Senior Member
    Join Date
    Nov 2006
    Posts
    326

    Default Re: auto BHH and friends

    very spiffy ... very very ... I need to work my smell tome into my CCS (I should hit 200 lucres on Wednesday!!) (actually, I think it's your CCS! -- but modified a bit)

    I poked through the code, though, but I'm not seeing the "combats" flag activated anywhere. Is the functionality just not implimented? I'll poke into that as well, if not.

  6. #6
    Senior Member
    Join Date
    Mar 2006
    Posts
    488

    Default Re: auto BHH and friends

    [quote author=izchak link=topic=1473.msg6831#msg6831 date=1201313455]
    About the BHH Library, bountyhunting.ash, bounty.txt, and 'make bountytxt.ash'

    These scripts make use of a clever idea by macman to store data about all the potential bountyhunts in a map file, so that you can access metadata about the various bountyhunts (how many items, which items, which zone, etc).[/quote]You're too kind.

  7. #7
    Senior Member
    Join Date
    Nov 2007
    Posts
    225

    Default Re: auto BHH and friends


    I was attempting to get three triffid barks from the spooky forest, everytime it hit a choice adventure it got stuck in an infinite loop.

  8. #8

    Default Re: auto BHH and friends

    [quote author=Paragon link=topic=1473.msg7139#msg7139 date=1202675303]

    I was attempting to get three triffid barks from the spooky forest, everytime it hit a choice adventure it got stuck in an infinite loop.
    [/quote]

    I think, as suggested by izchak in his comments, run_combat doesn't handle the completion of choice adventures.

    Edit: I think I was able to fix this by changing

    Code:
    		} else if(contains_text(data, "choice.php")) {
    			# uhhhh, I *hope* this works!
    			run_combat();
                    }
    to

    Code:
    		} else if(contains_text(data, "choice.php")) {
    			adventure( 1, here );
                    }

  9. #9
    Senior Member
    Join Date
    Nov 2007
    Posts
    225

    Default Re: auto BHH and friends


    Oh, you beat me to it... I was just about to say that you could fix it by changing line 100 to
    cli_execute("adventure 1 "+to_string(here));

  10. #10

    Default Re: auto BHH and friends

    My fix apparently didn't quite work. Today in Sleazy Back Alley, the script would stop after hitting a choice adventure that didn't use up an adventure (e.g., Entertainer, Sleazy Back Alley, etc.).

    The best I can come with about how to modify the script to deal with that circumstance, is to change the logic of the while loop to remove the spend_to_here check, and just run the loop until the bounty is obtained. Can anyone think of a better way?



Similar Threads

  1. make friends support -- We miss our friend, Zarqon!
    By zekaonar in forum Scripting Discussion
    Replies: 24
    Last Post: 07-24-2014, 10:43 PM
  2. Bug - Fixed Chat command '/clannies' filters only friends
    By Lxndr in forum Bug Reports
    Replies: 3
    Last Post: 12-04-2012, 09:36 PM
  3. Bug - Not A Bug get_path() & friends
    By StDoodle in forum Bug Reports
    Replies: 11
    Last Post: 11-02-2010, 05:18 PM
  4. 7887 - Recognize /f shorthand for /friends
    By RSS Bot in forum Latest SVN Changes
    Replies: 0
    Last Post: 12-17-2009, 06:10 AM
  5. changing friends/ignore list
    By upthedale in forum Scripting Discussion
    Replies: 0
    Last Post: 05-11-2007, 01:02 AM

Posting Permissions

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