Misshapen Animal Skeleton Familiar Checker/Creator

eitak

New member
Misshapen Animal Skeleton Familiar Checker/Buyer/Creator

This is kind of in between Informational and Item-handling, but I'm posting it here. It can be moved if it's the wrong category.

A friend of mine wanted a Misshapen Animal Skeleton script and we noticed that an older one was deleted. I remembered how nice Spiny Twizzler and Rosa N.'s TPChecker.ash script was, and realized that it would do basically the same thing, so with Spiny's permission I'm posting this script (thanks!).

This script does four things, all of which can be turned on and off in the settings (except #2, which just prints out the graph).

1. Uses your piles of dusty animal bones
2. Checks and makes a table of the dusty animal bones you have/don't have
3. Buys the bones that you do not have yet, based on the budget you specify
4. Creates the dusty animal skeleton (requires you to run the script again after buying them all)

It accounts for if you have a Dusty Animal Skull in your inventory, in which case it won't buy the two bones required to make the skull. Buying the skullbones and the regular bones are in separate settings.

Let me know if there are errors and I'll try to fix them (I've tested it as thoroughly as possible though, and so has the friend I wrote it for). I am SNIG.
 

Attachments

  • misshapen.ash
    16.7 KB · Views: 1,024
Last edited:

Bale

Minion
I was going to posted a link to the several different scripts posted in this thread here which are not deleted, but honestly you've put them to shame so I have to complement you on writing the definitive misshapen animal assembly script.

Quite nice. I only regret that I've already made my familiar and cannot do so again.
 

zarqon

Well-known member
This is nice, I'll recommend it for those looking to get the skeleton.

A few coding suggestions. You can replace lines 43-142 (where you build the map of bones using item names) with this:

PHP:
for i from 1802 to 1899
   bone_list[count(bone_list)] = to_item(i);

Would have saved you a lot of typing!

Also, you can replace the entire contents of your dusty_animal_skull_exists() function with this:

PHP:
return (available_amount($item[dusty animal skull]) > 0);

since available_amount() considers pulling from storage. This also gives you the added benefit of the function returning false if you've used up your daily pulls.

One last thing. When you have something like this:

PHP:
if (condition) 
   return true;
else
   return false;

You can express that more cleanly like this:

PHP:
return (condition);

Thanks for sharing this script!
 

eitak

New member
I was going to posted a link to the several different scripts posted in this thread here which are not deleted, but honestly you've put them to shame so I have to complement you on writing the definitive misshapen animal assembly script.

You know, I did see those, but I mainly just coded it for fun for a friend to familiarize myself with KoLMafia scripting so I didn't mind :). Plus I really liked how beautifully Spiny's script worked. Glad you enjoyed it.

Zarqon: Thanks for your suggestions! I'll take a look at them later on when I have a few minutes.
 

slyz

Developer
Nice script, thanks. It should be easy and informative to have it print what the cost of buying the missing pieces would be when buy_missing = false.
 

moooo566

New member
Thanks, great script. Had to break into the script to change the settings myself, becuase i couldn't find a way to do it in mafia, but apart from that, worked perfectly. Saved me the hours it took on my multi.
 

Darzil

Developer
Thanks, definitely like this !

A suggested enhancement, though. Would be nice if the total cost was listed at the bottom of the costed missing parts list. The reason being that you can't scroll up to check whilst the "Do you want to buy?" message is displayed.

Nice work, though.
 

fronobulax

Developer
Staff member
I wrote this several years ago. It would try and buy one of every bone I needed (i.e. didn't already have in inventory). My recollection is that I ran it and then either bought, manually, what it couldn't get or changed my autobuy limit and ran the script again. There's probably a better way to script it but I only needed to run it once.
 

Attachments

  • Bones.ash
    9.8 KB · Views: 11
Top