BHH script, etc

holatuwol

Developer
Re: Auto-BHH

[quote author=Crowther link=topic=1152.msg5461#msg5461 date=1186705102]
Now that a version of KoLmafia has been released without a restriction on "bhh.php" ...
[/quote]

Publicly releasing this kind of script was actually banned in an announcement, but ... I'm tired of limiting potential abuse of KoLmafia (it feels like a never-ending struggle that I'll inevitably lose), so I've taken down the banned script list.

I still disagree with this script in spirit, and I freely admit I'm worried about the implications of an automated bounty hunting script, but I'm just going to do what I enjoy and leave you to your own devices. :)
 

Crowther

Active member
Re: Auto-BHH

[quote author=holatuwol link=topic=1152.msg5463#msg5463 date=1186707779]Publicly releasing this kind of script was actually banned in an announcement...[/quote]
Yikes! I'm very sorry. I still only see "Remove bounty hunter URL restriction" in announcemnts when I search for bounty hunter and BHH here, but there's so many places you could say such things. Please feel free to delete this thread. I'll remove my script.
 

asturia

Minion
Re: Nevermind

thanks for your script, it will help me a lot on days when I can't do it manually.
(I downloaded it while it was still available.)
 

holatuwol

Developer
Re: Nevermind

I removed the banned script list thread, so it won't turn up in any searches. :)  The announcement containing that ban on bounty hunter scripts (along with login-through-exit and mining scripts) is probably why wubbie mentioned in their script that it wouldn't auto-pick a bounty for you.

There are a lot of scripts I disagree with in spirit, because I think KoLmafia exists to make it easier to interact with the game and a lot of scripts are written explicitly to avoid interacting with the game.  So, I (personally) wouldn't weight my agreement with a script too heavily in a decision to release, because chances are high that unless it's an information-providing script or a relay override script, I'll disagree with it at some level.

I've missed bounties on more than one occasion due to not turning my bounty in before logging off, only to turn it in on my next login the next day, but I'm fairly ambivalent about missing lucre.  However, I can understand that those who are more serious about getting to 200/300 would get really angry at missing even one since it's a full day setback and it might happen fairly often.

KoLmafia's concurrent instance restriction limits a lot of the abuse that's been going on (as opposed to players who are using KoLmafia just to avoid burnout), so after some deliberation, the idea of a blacklist is no longer necessary and taking down that list feels like it's not a bad idea. I won't object if you re-release your script, or someone else chooses to do so.
 

asturia

Minion
Re: Nevermind

here is the script we are talking about:
I modified 1 line in it so it will adventure in fernwarthy's ruins correctly.
 

Attachments

  • doBHH.ash
    2.7 KB · Views: 719

Crowther

Active member
Re: Nevermind

I only saw wubbie's thread when searching for the announcement. I don't keep up very well. I often get days behind on the KoL forums mafia thread. The only thing I follow daily is the SVN change log, which is why I took the lifting of bhh.php requests as significant. At some point, it would only make sence to lift such a ban.

What's abuse and what isn't will always be a subjective decision. While I don't always agree with your choices, I do my best to respect them, because there are some very serious potential abuses and because without mafia I doubt I would still be involved with KoL.

I often miss my BHH reward even with the script, because I'll abort the script for some reason and never finish until the next day. Often, like you, I only forget to collect my bounty. It doesn't really bother me, since I'm having a hard time taking this new game as seriously as I did preNS13. Mostly I find the BHH quest boring, but it's the only SC skill I'm missing.

Anyway, enough drama. I don't play this game for interpersonal strife. I see the script has been reposted here and I have no problem with that, but I won't contribute. Hola's discomfort is enough of a reason for me. Remember people, KoLmafia is only tolerated, not condoned.
 

Ethelred

Member
The script doBHH.ash doesn't work for me. It always prints "Missed 3" and doesn't spend any turns or collect a lucre. Has anyone else used it successfully?
 

asturia

Minion
[quote author=Ethelred link=topic=1152.msg5516#msg5516 date=1187101355]
The script doBHH.ash doesn't work for me. It always prints "Missed 3" and doesn't spend any turns or collect a lucre. Has anyone else used it successfully?
[/quote]
it works like a charm for me.
Are you sure that it adventures in an area available for you?
 

charred

Member
it has worked great for me so far, up until it kept trying to get the bounty from the knoll while im a muscle sign. oh well, 1 day i had to do it manually :)
thanks alot again
 

iain7

Member
ok, i got it before you removed it. so how do you select which bounty to go for? whenever i run the script, nothing happens 0_o
Seeing as i dont log in much, i will only use the script that much XD so im not going to overuse it.
 

DoctorRotelle

Developer
In an attempt to give people another script to grab ideas from (and to comment on my coding practices...) I offer my version of the bounty hunting script, which I use, for perusal. Please comment freely as I am new to coding for mafia and love feedback of all types.

-DoctorRotelle

## You must visit the Bounter Hunter Hunter's Shack and pick a hunt to go on before activating this script.
## This script returns a boolean true when it successfully completes a bounty hunt.

As for automatically picking a bounty, I have no proper logic with which to program a "best" choice. I feel this ends up being a personal preference as some want bounty hunts that aid in trophies while others may want to go for the stat gains from the higher level bounty... I certainly didn't like the choices picked for me by doBHH.ash. So, remember to visit the hunter first, choose a hunt and _then_ launch this script!

Additional note: If you pick the spooky forest, and have the wooden stakes in your inventory, this script will equip them for you. It will then set the corpse to be looted to the sauceror corpse, the vampire choice adventure will be set to inter the vampire (combat) and skip the adventure for trading in the vampire hearts.

Other items include setting the wheel to mysticality position in the castle, and printing an error for muscle signs who chose the degrassi knoll bounty hunt in error.

So, what did you think?
 

Attachments

  • bounty.hunt.ash
    7.3 KB · Views: 139

macman104

Member
Probably should be in it's own thread. But I really like your script. Also, from a readability/updating standpoint, are you familiar with maps and records. I've reworked your script to use a map, and it cuts way down on the execution code required.

First attachment is the code I wrote up to create the map file, since creating it by hand I find tricky.
Second file is the map that is created.
Third file is the execution code.

Code:
foreach bounty in bountyMap
	{
		BountyInfo tempBounty = bountyMap[bounty];
		if(currentBountyItem != tempBounty.bountyItem)
		{
			print("Current Bounty Item: " + currentBountyItem + " does not match " + tempBounty.bountyItem);
		}
		else//(currentBountyItem == tempBounty.bountyItem)
		{
			print("Entering if statement for bounty: " + tempBounty.printBountyInfo());
I was having a little bit of an issue with checking currentBountyItem == tempBounty.bountyItem. So this is why the if/else code is executed the way it is. It seemed to work properly for me. The only difficult part was incorporating the special handling for the choice adventures and the spooky forest, but, yea...I think it worked out ok.

I've also attached an excel file. I really like building the add functions for maps like this. I just copy the cells into the text file and do a replace all for tabs replacing them with an empty string. Works like a charm.
 

Attachments

  • bountyHunter.ash
    3.6 KB · Views: 119
  • bounty.txt
    2.8 KB · Views: 124
  • bounty.hunt.ash
    4.9 KB · Views: 112
  • Bountys.xls
    17.5 KB · Views: 104

izchak

Member
I really liked your script, macman. Especially the datafile it produced, and the record you used for each bountyhunt option.
I added a boolean to your record, which I use to indicate if -combats or +combats is preferred for that particular bountyhunt. I have updated the datafile, and attached it (and the script to produce it) to this post.

I have also written a script to generally facilitate scripted bountyhunting, although it will not actually do your bountyhunting for you. 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.
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 (this one is still undergoing testing)
Code:
boolean can_access_hunt(BountyInfo hunt)
This final function attempts to figure out if you can access the particular bountyhunt zone.

It's possible that this warrants its own thread, but its definitely inherited from macmans script, so I put it here.
Perhaps someone else will find it useful!

EDIT: the first attached script is my script, the second attached one is macmans slightly modified script to produce the third attached file.

EDIT:Updated the data generation script, and the data to better handle Olfaction usage. The only update to the actual library file is to handle this updated data. No new functions for the library, basically. See this post for details
 

Attachments

  • bountyhunting.ash
    11.8 KB · Views: 81
  • bounty.txt
    3.8 KB · Views: 89

izchak

Member
Soooort of. I've added some code to my BHH script so that it can tell my CCS consult script which monsters to use Olfaction on. Basically, the record that my BHH script uses for each bountyhunt (fun house, HiTS, degrassi, etc) now has an additional property, a string. This string should loosely match the name of the monster who drops the bountyhunt item in question. My BHH script is basically a library for another script to use, in order to facilitate general bountyhunting, but it doesnt actually handle the 'adventure here' part.
I've attached the updated script to generate this new data, and the output here. I'll see about adding a small scriptlet to do some basic automated bountyhunting, with some basic code to handle Olfaction usage.

EDIT:I made an auto BHH script, which will use the olfaction skill if you have it. It also demonstrates basically how I use the aforementioned string to track monsters with my custom combat script. You can find the auto BHH script, and all my BHH related scripts, here.
 

MacGregor

New member
can anyone help me on checking the BHH for discarded pacifiers and if he has them grab that quest but if not, it doesnt get any of them?

i wanted to incorporate this into one of my farming scripts

i dont have any experience with .ash since i just started making scripts yesterday and my only programming experience (besides VB) was java with a teacher whose response to any question was "find someone whose code is working and compare it with yours."
 
Top