Dwarven Factory - Factory puzzle solver

slyz

Developer
if the client can't handle it, they really shouldn't be using any sort of script. :)
I noted the smiley, but I can't resist pointing out that That FN Ninja's scripts are particularly user-friendly, and probably have many users who don't really need to understand ASH to enjoy them.

I don't think someone who uses one of his scripts (or any other script released for general public use) should be told to learn ASH when they point out a bug or make a feature request.
 

Theraze

Active member
Something else to note, besides the smilie... "if the client" not "if the user". :) I was referring to underpowered computers, not newbie users. ;)

Somewhat confusing because of the following 'they', but it was the intent to point out that 3 additional calculations shouldn't break most people's computers. Heh.
 
I had trouble earlier because in finding the item to make, have_item() only checks inventory and equiped, while my first two pieces were still in Hagnk's, so it tried going for the helmet instead of mattock.

Thank you for bringing this to my attention. I'm surprised no one has run into this problem yet. I will get it all ironed out for the next release.

@ Theraze & Slyz:

I'm not completely clear on what exactly is included in available_amount() and the wiki doesn't list that information. Does it consider the clan stash for example? I DO know that it includes the closet amount so the following code will result in inflated erroneous counts:

Code:
int item_count( string x ) {
   return available_amount( to_item(x) ) + closet_amount( to_item(x) ) +  storage_amount( to_item(x) );
}

Also, once someone has access to storage using available_amount() + storage_amount() will have the same problem. Items will be counted multiple times.
Also also, I don't think there is any need to use a string and convert it to an item.

I have a character who has just defeated the NS, so when I get a few minutes I'll test a fix. I am going to have it check the display case as well like PavoNariz mentioned.
 
Last edited:

Theraze

Active member
Okay, so after reading, available_amount is a horrid choice because it's different for the character, depending on HC/SC, BC or not, pulls remaining, clan storage rules, etc. Better would be the following, to check everything but your clan, since those aren't necessarily yours...
Code:
int item_count( string x ) {
   return closet_amount( to_item(x) ) + display_amount( to_item(x) ) + equipped_amount( to_item(x) ) + item_amount( to_item(x) ) + storage_amount( to_item(x) );
}

That should check your closet, display case, equipped, inventory, and storage, regardless of whether or not you can currently get your hands on them...
 

slyz

Developer
Woops, Sorry Theraze, I completely missed that.

And I learned something about available_amount()!
 
Dude, thank you so much! Those numbers were just giving me a headache. This script is the only reason I downloaded kolmafia in the first place.
You're welcome. ;)

Update v1.3

  • Re-factored code.
  • Converted aborts to exits and prints to vprints.
  • Fixed a bug in the outfit item selection logic.
  • Altered buying logic due to changes in miner.ash
  • Re-named according to previous Ninja script naming standards.
How come you don't call this one "Dwa Fa" ? :)
Veracity, that is a very good question indeed! I guess I forgot to consult my idiosyncratic script-naming convention reference card! :D
Good news. I found my idiosyncratic script-naming convention reference card! It was under my tenugui. Thanks Veracity for keeping this Ninja in line. Sometimes I get a little unruly.

Also, the ore buying logic has been altered due to some re-factoring in miner.ash. This is the order of the buying logic:

First dwafa.ash checks the script's buyore preference and if that is true it will try to buy all the required ore and abort if unsuccessful.
If buyore is false dwafa.ash passes control to miner.ash. Miner.ash tries to retrieve the ore, which means it might still buy it if autoSatisfyWithMall is true.
If miner.ash is unable to retrieve the ore it will then proceed to mine for the rest.
 

Theraze

Active member
If it's been officially renamed, maybe the sig should get updated so people properly -fa at it? :D

So, would the proper name for Miner be OreMi or something like that then?

Awesome scripts, btw. I'll need to verify that the current check code still happily works with my BM idiots who try to run DF sometimes, but looking forwards to it. :D
 
If it's been officially renamed, maybe the sig should get updated so people properly -fa at it? :D
Yeah, didn't have time to edit my sig this morning when I posted the updates.

So, would the proper name for Miner be OreMi or something like that then?
According to my card (it's like the English language - there's an exception to every rule), it would be "Minor - Mining ore the Mafia way", but I didn't want anyone to think it was under age.

Awesome scripts, btw. I'll need to verify that the current check code still happily works with my BM idiots who try to run DF sometimes, but looking forwards to it. :D
Thanks. Let me know how it goes in BM.
 
Last edited:

Theraze

Active member
Spiffy. Yeah, I was just looking at the little bit in your sig. AutOr didn't seem to make much sense, but OreMi (with Mi pronounced like Me/Mii) actually made a disturbing amount of sense. :D So would the official rename of DwaFa be "Dwarven Factory the Mafia way!" or something else? :)

I expect it to work... have_item() is item_amount and equipped_amount, and you add in closet_amount, storage_amount, and display_amount. It's not alphabetically sorted, but it includes all 5 of the possibilities. :D
 

tgetgel

Member
Running latest daily build with DwaFa v1.3, Miner v2.32, and options set to bye ore and include the delivery service!

15 turns and 40k meat and I have a brand new dwarvish war mattock.

Sweet! Thanks FN Ninja. :cool:
 
You're welcome sir!;) Who knows... maybe someday I'll get the dwarvish war uniform myself. The good news is that I ascended for the first time earlier this month and I will now pretty much be hardcore for life! The bad news is I already opened the DoD and forgot to get the hobo glyph in the greater than sign. :eek:
 

tgetgel

Member
The good news is that I ascended for the first time earlier this month and I will now pretty much be hardcore for life! The bad news is I already opened the DoD and forgot to get the hobo glyph in the greater than sign. :eek:
I agree, HC for life! I missed the glyph on the road to the white citadel and others this ascension. I only got 1!:(
 

Berserkas

New member
Hm... so i seem to be having this problem. I remember using the script quite some time ago.. worked fine. then quit KoL for more than a year, then started playing again. Whenever i try to run the script, i get this:

Function 'my_path()' undefined. This script may require a more recent version of KoLMafia and/or it's supporting scripts. (zlib.ash, line 271)

Got the newest mafia version (14.6), so... what's going on? My path? Is it something to do with Bad Moon?
I really don't have the slightest clue as to how any of this works, any help would be appreciated.
 

T_E

Member
Hello~

I tried to run this today and encountered this right off the bat:

Bad location value: "Knob Goblin Harem" (miner.ash, line 164)

Please let me know if I need to change something/provide additional information and I'll do so- thank you in advance!
 
Top