auto BHH and friends

Is anyone using this script? Just tried it out and got the following:

> call bounty.ash
Expected ), found = (bounty.ash, line 195)
 
Is anyone using this script? Just tried it out and got the following:

> call bounty.ash
Expected ), found = (bounty.ash, line 195)

Change line 195 from

if (count(argv) = 2) {

to

if (count(argv) == 2) {

and you should be good to go.

Or heck, I'm not shy about uploading. Here is a fixed copy.

This is due to a very recent change in Mafia.
 
You also need to change quite a few lines after that (210 is one of them, I think)...

I'd upload the fixed copy, but my fixed copy is slightly modified besides that (it's optimized for being called by another script).
 
Revisited this a bit ago. Thanks to the new to_plural() function, a field can be removed from the map file. Also, converted it to use the in-progress CanAdv tool (link in sig). So not only is the script more modular and mafia-integrated, but both the script itself and the data file are smaller! Win.

It should swap right over to the new data file, but if not, you may need to delete bounty.txt.
 
Last edited:
Hmm, a couple of days ago my bounty.ash (probably really old) started doing this:

Code:
Checking bounty hunt possibility in none...
Checking bounty hunt possibility in none...
Checking bounty hunt possibility in none...
You have 25 filthy lucre.
Bounty hunt successful.

I updated to this most recent version, got canadv.ash, deleted my bounty.txt and the behaviour persists ...

Code:
> call bounty.ash list

Updating bounty.txt from '2009-06-11T02:57:13-05:00' to '2009-06-11T02:57:13-05:00'...
Bounty count: 24
...bounty.txt updated.
1: easy bounty, 0 13 from none (0 Mox)
2: normal bounty, 0 40 from none (0 Mox)
3: hard bounty, 0 5 from none (0 Mox)

> call bounty.ash *

Checking bounty hunt possibility in none...
Checking bounty hunt possibility in none...
Checking bounty hunt possibility in none...
You have 25 filthy lucre.
Bounty hunt successful.

Any ideas?
 
Zarqon, I have a wishlist item. :) I believe that if you have olefaction or a spooky putty sheet, it's far better to do whichever hunt requires the least items, since you can olfact/putty to accelerate the hunt. Could you put in an override (or, if you prefer, autodetect either/both of those cases) to always pick whichever bounty has the fewest options?

Or just tell me I'm misunderstanding the mechanic here.
 
@kain and ironsting: update your bounty.ash to the last one posted. If that is done, what does your bounty.txt look like? Are there plural item names in it?

@dj_d: an excellent idea. Probably want to make that a script option. I thought of a pretty sweet workaround for putty sheet owners too, to detect if their CCS used the putty sheet. I'll get to that soon.
 
Last edited:
After I downloaded the newest version (posted by you, above) and then deleted my old bounty.txt file, this is the contents of my new bounty file:

Code:
billy idol	40	0	none	0
bloodstained briquette	8	0	none	0
broken petri dish	40	0	none	0
bundle of receipts	17	0	none	0
burned-out arcanodiode	5	0	none	0
callused fingerbone	4	0	none	0
coal button	40	0	none	0
discarded pacifier	5	0	none	0
disintegrating cork	20	0	none	0
empty aftershave bottle	34	0	none	0
empty greasepaint tube	20	0	none	0
greasy dreadlock	11	0	none	0
hobo gristle	8	0	8-Bit Realm	0
non-Euclidean hoof	11	0	none	0
oily rag	6	0	none	0
pink bat eye	14	0	none	0
sammich crust	5	0	none	0
shredded can label	13	0	none	0
sticky stardust	6	0	none	0
triffid bark	3	0	none	0
vial of pirate sweat	5	0	none	0
white lint	8	0	none	0
wilted lettuce	7	0	none	0
worthless piece of yellow glass	6	0	none	0
 
Mine looks like this:

Code:
billy idol	40	Goatlet	75
bloodstained briquette	8	Outskirts of The Knob	9
broken petri dish	40	Knob Goblin Laboratory	52
bundle of receipts	17	Knob Goblin Treasury	37
burned-out arcanodiode	5	Fantasy Airship	127
callused fingerbone	4	South of the Border	32
coal button	40	Ninja Snowmen	97
discarded pacifier	5	Giant's Castle	152
disintegrating cork	20	Haunted Wine Cellar (automatic)	175
empty aftershave bottle	34	Frat House	48
empty greasepaint tube	20	Fun House	27
greasy dreadlock	11	Hippy Camp	48
hobo gristle	8	Sleazy Back Alley	8
non-Euclidean hoof	11	Haunted Gallery	122
oily rag	6	Degrassi Knoll	21
pink bat eye	14	Bat Hole Entryway	21
sammich crust	5	Orc Chasm	94
shredded can label	13	Haunted Pantry	9
sticky stardust	6	Hole in the Sky	175
triffid bark	3	Spooky Forest	12
vial of pirate sweat	5	Pirate Cove	76
white lint	8	Whitey's Grove	45
wilted lettuce	7	Fernswarthy's Ruins	25
worthless piece of yellow glass	6	Dungeons of Doom	48

The one you posted looks like it was made by an older version of the script trying to read the new data file. (Note that it has five fields per line, whereas the current one should only have four.) Are you sure you have the very latest bounty.ash?
 
Huh, strange ... Once again I deleted bounty.ash and bounty.txt. I downloaded the version above (the one that includes canadv.ash)

When I go "call bounty.ash list" this is what I get:
Code:
Updating bounty.txt from '2009-06-11T02:57:13-05:00' to '2009-06-11T02:57:13-05:00'...
Bounty count: 24
...bounty.txt updated.
1: easy bounty, 0 8 from 8-Bit Realm (0 Mox)
2: normal bounty, 0 5 from none (0 Mox)
3: hard bounty, 0 5 from none (0 Mox)

Is it supposed to be downloading the bounty.txt file from somewhere? That's what the code looks like it's doing. And the file that gets downloaded is the same file as I posted above, with 5 columns.

So then I pasted YOUR bounty.txt into mine, saved and I still get:
Code:
> call bounty.ash list

1: easy bounty, 0 8 from 8-Bit Realm (0 Mox)
2: normal bounty, 0 5 from none (0 Mox)
3: hard bounty, 0 5 from none (0 Mox)
 
Code:
Variable threshold is already defined (bounty.ash, line 6)

have no clue whats up with this

Edit: ok i deleted lines 6 through 10 from bounty.ash and it works properly

Code:
int threshold = 4;
if (get_property("safetyThreshold") == "" && user_confirm("Your 'safetyThreshold' property is not set.  "+
  "Do you want to set it to "+threshold+" now? This property will then be used by all scripts designed to work with it."))
  set_property("safetyThreshold",threshold);
if (get_property("safetyThreshold") != "") threshold = to_int(get_property("safetyThreshold"));

not sure if this is defined in canadv.ash or zlib.ash and mafia doesnt like it being in there twice or what but removing those makes it work great for me, not sure if that means there is now no safetyThreshold though
 
Last edited:
For fun, here's the version that I am using, with the latest CanAdv, which is working flawlessly for me. I posted the previous one before I incorporated ZLib into CanAdv, so yes, those are the lines that you needed to remove.
 
Last edited:
Here's a crude update that lets you configure (via a const) if you want to choose the bounty with the fewest items or not. Set CHOOSE_FEWEST_ITEMS to True if you're using spooky putty or olfaction; false otherwise. This makes the bounty hunt ridiculously faster.
 

Attachments

I noticed an autoputty option in ironsting_prefs. How is it set? True, false? Or would it be set autoputty=monsterofchoice?

Laus Deo
 
I had to comment out line 8 "int threshold = 4;"

I tried changing the int threshold a few different ways and kept getting "Variable threshold is already defined (bounty.ash, line 8)"

Vista, Java 6.7, Daily build 7449
 
Ok, I've added some "choose smallest bounty" functionality, and in the process reworked this a bit to be more in my coding style. You'll note the script is even smaller than before! :)

There is now a variable at the top called dosmallest. If true, when selecting the bounty it will choose the possible hunt with the smallest number of items. If false, it will choose the most difficult possible hunt (previous behavior).

I also added additional handling to the "accept" parameter. You can now type "accept best" or "accept small|smallest" to accept the smallest or most difficult hunt regardless of dosmallest.

Also, additional print() commands so you have a bit more useful info on the screen.

Enjoy!
 

Attachments

Today, this chose filthy dreads (when set to smallest). Since I was high level, it then couldn't complete the quest.

How about avoiding any bounty where can_adv says you can't adventure?
 
That sounds like a problem with can_adv(), because this script does that.

Incentive for your participation in the CanAdv project, perhaps? :)
 
Back
Top