auto BHH and friends

[quote author=raorn link=topic=1473.msg8387#msg8387 date=1214382604]
This may happen when: 1. not enought moxie for Wine Cellar, 2. War is started (Hippy Camp not available), 3. Muscle sign, Degrassi Knoll is no-adventure zone.
[/quote]

1 - I haven't opened it. So that explains that.

2 - I haven't started the war, I do have a dinghy to get out to the island. Not sure there.

3 - Yep - muscle sign on this run. So that explains that.
 
[quote author=Raven434 link=topic=1473.msg8394#msg8394 date=1214431850]2 - I haven't started the war, I do have a dinghy to get out to the island. Not sure there.[/quote]
Then you are L12 or higher. IIRC, bounty is not available once you have accepted L12 quest from Council. If there's a better way to check bounty possibility, let me know.
 
[quote author=raorn link=topic=1473.msg8395#msg8395 date=1214433089]
Then you are L12 or higher. IIRC, bounty is not available once you have accepted L12 quest from Council. If there's a better way to check bounty possibility, let me know.[/quote]

That makes sense.

I only bring it up because I found a weird combination of three conditions that makes what has been a very solid script for me, just kind of shrug its shoulders and go "Sorry Beavis".

:-)

Thanks for the hekp with figuring this one out.
 
I had a problem running my slightly hacked version of the original script(as posted above) today. It told me it couldn't anywhere to adventure for the bounty hunt, now the only available location should have been Knob Goblin Laboratory but the script was throwing an error "unknown location : Knob Goblin Laboratory"

Can anyone think of a reason why? I could adventure here manually (through mafia) and with another script.
 
So, I can't get rid of this error:

"Bad location value: "wine cellar" (bountyhunting.ash, line 211)"

I'm using the latest update, but had the same problem with the older versions...

Is there something painfully obvious I'm missing?
 
Thanks for this great script, I love it, only one suggestion, update the first post with the newer code that works with the haunted wine cellar. BUT SERIOUSLY!!! THANKS!!! YOU TOTALLY ROCK!!! (I was going to write something similar myself, but I saw yours, and since it works so well, I have no need!)
 
[quote author=bouzdreaux link=topic=1473.msg8654#msg8654 date=1218075071]
So, I can't get rid of this error:

"Bad location value: "wine cellar" (bountyhunting.ash, line 211)"

I'm using the latest update, but had the same problem with the older versions...

Is there something painfully obvious I'm missing?
[/quote]

Change line 162 to the following:
Code:
	} else if (where == $location[Haunted Wine Cellar (automatic)]) {

That got it working for me using build 6502.jar.
 
I've taken raorn's tweaked version of izchak's script and tweaked it still further to take advantage of a couple things I'm trying to help standardize:

1) The idea of a per-character "safetyThreshold" property that determines how far under the absolutely safe moxie it's OK to adventure. So many scripts deal with the safemox idea, and it would be great to have a single safety threshold per character, not per script.

This version will access the same setting accessed by Checklist, AutoMCD, and any other scripts that would like to use this feature. The first time you run one of these compliant scripts, it will ask if you would like to set the property, which will then be used by any of these scripts as your desired threshold for that character. To change it, type "set safetyThreshold => X" in the CLI (where X is the amount it's OK for you to be under safemox) or edit your character's preferences file.

2) Automatic data file updating! All you need is bounty.ash -- it will automatically download bounty.txt, and update it whenever updates are available. The file will probably be created in your scripts directory -- for a cleaner scripts directory you can move this to your data directory.

Further, if you use the First Things First custom combat script, Olfaction is taken care of automatically when you're on a bounty. So what was once an entire library of files is now just one. I also cleaned up the original code a bit. Enjoy!
 

Attachments

man i totally broke abh trying to update.... so many different files from different ppl....

can some one post a working one with all the required files.
 
I kind of just did. That one file is all you need. If you have Olfaction, you will also need to use the First Things First custom combat script (link in my sig).
 
does anyone else have problems getting hobo gristle? my level 35 DB gets stuck doing it sometimes and i dont realize it. is there anyway to make it NOT take that quest ever?
 
The easy way is to just use cli_execute() like this

PHP:
cli_execute("call bounty.ash *");

that would call the bounty.ash script with all of your adventures. You can replace the "*" with a number if you want it to have a limit.

hope that helps.

Ank
 
Last edited:
Recent changes to mafia broke the Map Manager, which in turn broke the script I posted above. Here's a working version (which does not automatically update bounty.txt) while I work out a solution for the automatic updates.
 

Attachments

That was something of a mis-statement. I assume this refers to the debug log I received which was an NPE running bounty.ash?

The symptom is this:

A script attempted to read a file (off the net - it was a URL) into a map. The file was not a data file; it was an html document. The map was indexed by "item" and HTML keywords don't parse into good item values. (Surprise!)

A "recent change" was making KoLmafia unwilling to accept completely bogus item names as items.

I taught the ASH function that parses items to gracefully reject bogus items.

Revision 7055 will no longer get an NPE when it fails to get a good mapfile to update bounty.txt. You'll end up with an empty map (well, not quite: there will be a line that looks like this - "none document.searchform.search.focus(); 0 none 0" - but that's not KoLmafia's fault).

If you have some other definition of "broke the Map Manager", I'm all ears.
 
The URL is only an HTML document for web browsers. For mafia, it is a map file. Appropriate headers are sent to mafia identifying it as a text file.

This problem (and probably your debug log, Veracity) happened earlier when the agent changed to the users' relay browser, thus spitting an HTML document out when it should have been a map.

However, even though the agent has changed back to KoLmafia, the remote auto-update still hasn't been working and I'm not sure why. I haven't changed anything since it stopped working January 13th or so. Somehow it broke, and nothing was changed in either the ASH script or server-side PHP script, so I assumed there must have been a mafia change that was the culprit.

As it now stands, the Map Manager is broken.
 
Interesting.

KoLmafia sets the user agent on requests that it makes to the KoL servers. It (again) sets it to KoLmafia-x.y - the version number.

I looked at bounty.ash to diagnose the NPE and I saw this: you construct a URL (http://whatever) and pass that as the filename to file_to_map.
Java turns that filename into an HTTP stream and gets the file over the net.
KoLmafia reads the data stream - and gets HTML.

Some observations:

- I did all my testing without logging in. After all, I only cared about looking at the data you sent me. It was HTML.
- Even if I had been logged in, KoLmafia did not set the headers - including user agent - on the HTTP stream. It simply did a URL.open() on the URL and let Java do anything it wanted with the connection.

I have no idea why Java would EVER have decided to use KoLmafia's version number as a user agent. Therefore, I have no idea why your web site would EVER have seen that as user agent when koLmafia connected there via file_to_map.
 
I don't either, but evidently something like that was happening, since the code (which explicitly checks for "KoLmafia" in the specified agent string) was previously working.

Thanks for the tip on where to look. I didn't realize file_to_map() and visit_url() would send different headers for URL fetching.

I tested with build 7055 and it specified "Java/1.6.0_12" as the agent for file_to_map() requests, not "KoLmafia xxx" as I had assumed.

So I've thrown out agent checking, instead checking the query string to decide what to output, and now Map Manager is working again.

Which means, here is the fixed version, with auto-updating onboard again.

Thanks for the help Veracity.
 

Attachments

Back
Top