PDA

View Full Version : Familiar Feeder



slyz
04-08-2010, 09:14 PM
Familiar Feeder 0.9 beta

Familiar Feeder requires htmlform.ash, SmashLib,ZLib, and daily build (http://builds.kolmafia.us/) 9600 or greater (14.7 will not work unless you have the most recent data files).

The Familiar Feeder is a relay browser script - it creates an interface that helps you decide what to feed to your Slimeling, Gluttonous Green Ghost or Spirit Hobo during an ascension. One important feature is the possibility to 'hide' items from the script - players who have misclicked and fed a part of an outfit can understand how nice this is.

Keep in mind this is an ascension-oriented script, I know using this in aftercore with a big inventory would be mildly overwhelming.

Note that this is still a work in progress, and you should look at the possibilities offered with a critical eye.

This script is very conservative, and will never consider an item that will take a turn to create. There is also the possibility to specify how many of what items you do not, under any circumstances, want created (or used as ingredients) and fed.

If you want to play around with the script, you can disable the actual feeding/creating by editing the script and changing the debug variable at the top to true. The commands will be printed in the gCLI instead of being executed.

What does it do?

A list of feedable items you can craft with ingredients from your inventory or NPC stores is generated.
For each item you can create or have in your inventory that fills the requirements*, a meat per MP ratio is computed with either the autosell value or the pulverized value, and the amount of MP your familiar gives with each charge. In the case of creatable items, the cost is the sum of the values of all the basic ingredients (or the autosell value if it's higher).
The Feeder_keep.txt data file is loaded. It contains items you want to keep, as well as the quantities to hold. If you are on a pathed run, food and/or booze will not be considered as items to keep.
All the items you can feed are sorted by their ratio of Meat/MP, and listed.
Items you want to keep X of are listed only if you have more than X and colored blue.
The amounts of createable items take into account items you want to keep, if they happen to be one of the ingredients.
Items that would give you more MP by using the meat gained from autoselling are colored red
Items can be added to the 'items to keep' list through the interface.
When feeding the slimeling, items created from meat stacks are listed in a separate frame so they are easy to find. Note that they do not add MP charges, even though Mafia adds it.

* Items that lack an autosell value, are not tradeable, or are NPC items are not considered. Furthermore, the script considers items to keep only if you have more than the limit fixed in the data file.

You can also find "Chewing-gum on a string" listed among the items you can feed your Slimeling. Choose this to use chewing-gums and feed the resulting starter items. The script will closet (then uncloset) starter items if it gives you a better chance of avoiding unfeedable chewing-gum items. Note that any worthless item you obtain will stay in your inventory and won't be closeted.

How to use it:

Download relay_FamiliarFeeder.ash to Mafia's /relay folder.
Download Feeder_keep.txt to Mafia's /data folder.
Download htmlform.ash, SmashLib and ZLib to your /scripts directory.
If mafia was running when you downloaded the script, use the [Re] link in the top pane.
Select FamiliarFeeder in the top pane dropdown.


How to feed items:

If your familiar is in the terrarium, use the Take [familiar] out button.
Check items you want to feed in the Feedable Items section.
The current and creatable items you can feed are listed like Mafia's food/booze/spleen manager. Next to each item, there's (X possible, Y current) which indicates you have Y in your inventory, and can create X - Y (so you can feed up to X).
Configure the amounts to feed in the Feed Stuff section.
Use the Feed button to feed you familiar.


"Feed Stuff" options:

Feed All Current - Feed the quantity you have in your inventory (nothing is created).
Feed All Current But One - Feed the quantity you have in your inventory minus one (nothing is created).
Feed All - Feed as many as possible (items are created if needed).
Feed quantity - Feed the quantity specified (items are created if needed).

All the quantities listed and fed exclude the items you want to keep, even if they are only used as ingredients.

How to configure the items to keep:

Check items you want to keep in the different sections (the Items to Keep section shows the current list, if you want to modify it).
Configure the amounts to keep in the Keep Stuff section.
Use the Keed button.


To do:

Find someone that can help me make the script more ergonomic (item data presentation, putting the familiar's images in there somewhere, aligning stuff etc...)
Wait for bugs and squash them!


Changelog

04.08.10 - ver. 0.1 alpha posted.
04.11.10 - ver. 0.1 beta: move the keep map to a data file, revamp the script to resemble KoL's Autosell page, add notify and version checking.
04.12.10 - ver. 0.2 beta: add item creation, remember toggle state of sections with a cookie.
04.14.10 - ver. 0.3 beta: change name to FamiliarFeeder, add support for GGG and Hobo, add 'Keep Stuff' section, cleanup code, check autosell vs pulverize
04.18.10 - ver. 0.31 beta: fix issue with saucepans
04.19.10 - ver. 0.32 beta: fix a couple of little logic errors
04.28.10 - ver. 0.4 beta: consider cost of meat paste when necessary, use autosell value instead of cost for items (balloons) that actually autosell for more than their parts, only show the meat stack items when considering the Slimeling, collapse the 'Feedable' and 'Creatable' section into one
04.29.10 - ver. 0.41 beta: removed that '!' that prevented v0.4 beta from working, remove items to keep when you can't consume them (for pathed runs).
05.01.10 - ver. 0.42 beta: fixed (X possible, Y current) so that items in inventory are counted in X, fixed displaying of meat stack items.
06.09.10 - ver. 0.5 beta: added the Items to Keep section, removed meat stack items from the items to Feed since they don't give MP, a couple of aesthetic changes.
06.16.10 - ver. 0.51 beta: fixed a typo that was removing foods to keep when you couldn't drink, added more default ascension-relevant items to keep in Feeder_keep.txt, added logic to keep only the worst hats for the hatter buff, drum and guitar for the Lair
07.11.10 - ver. 0.52 beta: fixed a little bug that sometimes caused meat stack items to not be recognized as such
07.30.10 - ver. 0.53 beta: only basic meat items and the gnollish autoplunger give meat stacks
10.06.10 - ver. 0.6 beta: changed the default data file and the script to account for recent (and not so recent) changes to starter items and crafting. Fix a few aesthetics bugs and added logic for feeding the hippy outfit and chef's hat.
10.11.10 - ver. 0.61 beta: added support for starter items from chewing-gums on strings. Import SmashLib.ash instead of smashlib.ash.
11.09.10 - ver. 0.62 beta: added support for Bart Ender beers
07.12.11 - ver. 0.63 beta: bugfix for the new fullness/inebriety data files
07.24.11 - ver. 0.7 beta: use knoll_available() instead of in_muscle_sign(). No need to load data files for food/booze consumption data anymore.
07.29.11 - ver. 0.8 beta: charrrms bracelets have a power now, and are circular concoctions. Prevent infinite recursion in get_cost().
09.06.11 - ver. 0.9 beta: remove Clip Art items from the concoctions map

icon315
04-08-2010, 10:06 PM
i would take a look at it, but i don't have a slimeling :P

slyz
04-08-2010, 10:36 PM
It works even if you don't have a slimeling: you can look at it, but of course you won't have a 'Feed' button.

heeheehee
04-09-2010, 01:07 AM
Looks like line 138 was throwing it off for me, since my familiar doesn't have any equipment. (Error message received: "[none] has no matches.")

Simple fix, really: insert if(familiar_equipped_equipment(fam)!=$item[none]) to the beginning of that line.

Anyway, back to the script: it's functional, and it's not overly cluttered. That's generally good enough (in my opinion, I mean, and I'm probably totally wrong).

zarqon
04-09-2010, 03:18 AM
Great! Next, make it work for ghosts and hobos as well, showing the appropriate category of consumables depending on current familiar, with "Take Out Your XXX" buttons for whichever familiars you have.

If you made that, I would use it so hard. Unfortunately I still don't have a slimeling so I can't give this one a proper test..

icon315
04-09-2010, 03:26 AM
i can't seem to download the script

heeheehee
04-09-2010, 03:33 AM
Well hey, you're almost out of your current run, so I could plausibly get you a slimeling tomorrow? (Not free of course; that alt's poor! Just enough to cover costs, pretty much.)

Ideally you'd have the tube set up in advance (squeezes and all), and I'd have my alt hop on over. But it's really up to you. (Y'know what, just contact me in-game.)

[[On a slightly related note, it wouldn't be -too- difficult to add a dropdown menu and change what items show... Maybe later.]]

Edit: icon315 -- the one that you posted? (I don't see any other scripts anywhere in this thread... =P)

bleary
04-09-2010, 03:37 AM
This is great! I'll get right to work testing and maybe coming up with some improvements. 'frilly shirt' probably ought to be 'frilly skirt' in line 66. Maybe also add the bugbear outfit and stainless/plexi/brimstone stuff to the exclusion list? I'm always afraid I'm going to accidentally feed one of my ascension rewards to my slimeling.

icon315
04-09-2010, 03:42 AM
Yes, i click on it, it starts to try to load, then stops.

also, how much would it be to "cover the costs?"
the only thing i can get is double nodules

forgot my password
04-09-2010, 03:45 AM
This doesn't ever feed equipment, does it?

heeheehee
04-09-2010, 04:01 AM
Frilly skirt (and bugbear outfit) should also be ignored if you're in a muscle sign. =P

"Covering the costs" usually runs around 1 million for me (including cost of instance, chamoix, and squeezers, so if the instance is already set up, just 700k). Of course, there's a minor catch -- while you get the larva (and slime skill, if desired), I get everything else (bitter pills for later runs, epic wads to mitigate costs). Well, there's always the option to negotiate for the other loot, so if you want nodules as well, let's say, that'd be an extra... however much bitter pills happen to cost. Or an actual bitter pill.

zarqon
04-09-2010, 05:05 AM
heeheehee, SNIG? I will be popping out of HC today or tomorrow (probably tomorrow unless I'm lucky) and would definitely be interested in setting this up. Adding Slimeling support to SS would be the first thing I'd do.

heeheehee
04-09-2010, 05:32 AM
Yep (SNIG). Would you be able to set it up in your clan by then?

zarqon
04-09-2010, 06:28 AM
We'll see, hope so. I'll kmail you today.

slyz
04-09-2010, 09:08 AM
I'm going to work on cleaning up the code a little and moving the items to keep list into a data file. I also had a couple of ideas for the presentation. What I would like is a KoL 'autosell' page presentation, but with the possibility to enter different amounts for each item. This would mean 'Feed All', 'Feed All But One' and 'Feed quantity' options for the items selected.

@ heeheehee: thanks for finding that.

About the dropdown menu: I wanted to show all the items you could feed it, so you could enter how many of which you wanted fed in one go. Of course, there could be a dropdown instead of a text field to choose the amounts.

@ zarqon: I didn't think of that, but it would be neat. I should be able to buy a GGG soon too, so that's another incentive to add that functionality.

@ bleary: ascension rewards are not tradeable, so they are not feedable. I added the bugbear outfit.

@ icon315: What error does Mafia give in the gCLI?

@ forgot my password: Not unless you edit the script and set the debug variable at the top to false. I feed it saucepans to test, and that seems to work. With the debug variable set to true, it only prints in the gCLI the command it would execute, and also adds 'debugging' at the top of the page.

icon315
04-09-2010, 04:08 PM
Not kolmafia, i just can't seem to download the script here, any chance you can send it to icon315@gmail.com?

reverkiler
04-10-2010, 12:29 AM
Is it possible you could put the 'keep' items in a map file? I think that would make it a bit more portable and less hard coding

slyz
04-10-2010, 03:10 AM
Yup that's the plan. I wanted some help for the look of it, but ended up copying the KoL Autosell page. I'll post the revamped version once I get it to actually work :D

I'm also adding buttons to add items to the keep data file... I hope it won't be too cluttered.

zarqon
04-10-2010, 10:53 AM
This should also have a one-click interface for creating and feeding meat stacks!

slyz
04-11-2010, 06:39 PM
@zarqon: I guess PriceAdvisor's treatment of concoctions opened the road for that, I will definitively look into that. I would like to add a confirmation pop-up for creation though, as it would use more resources than simply equipment in your inventory (eventually costing turns too), but I have no idea of how to do a nice one (javascript?).

Version 0.1 beta posted. This WILL feed stuff to your familiar, so start using with caution. See the first post for instructions.

heeheehee
04-11-2010, 09:30 PM
Muscle signs get Innabox, so no turns spent crafting meat-stack items! Yaaay!

Also, the JS equivalent of ASH's user_confirm() is simply confirm().

slyz
04-11-2010, 09:43 PM
Looks like meat stack items are popular, I'll add those first.

heeheehee
04-11-2010, 10:05 PM
Primarily because of slime stacks, I'd guess.

zarqon
04-12-2010, 06:10 AM
Oooh, the new arrangement is very nice! But... I was just about to edit this to make your table user-sortable!

For columns I was thinking item name, item value (autosell if mall == mallmin), MP gain, and profit (meatpermp*MP gain - value), with selectors in front. I was also thinking about adding createable items to the table, colored or flagged as creatable.

Haha, oh well. This works quite nicely too.

I did make one small change that you might like to add. Jason's htmlform doesn't support separate labels for checkboxes, which is unfortunate in this case. So, I added a little code to make the item names labels for the checkboxes. What this means is that you can click the item name to select the checkbox. It's a small usability change, but a nice one. Only changed two lines:



if ( num%2 == 1 )
writeln(" <tr>");
writeln(" <td valign='top'>");
write (" ");
attr("id='it"+Feedable[i].it.to_int()+"'");
write_check( false, "it"+Feedable[i].it.to_int(), "");
writeln("");
writeln(" </td><td>");
write (" ");
writeln("<label for='it"+Feedable[i].it.to_int()+"'><b>"+color+Feedable[i].it+"</font></b></label> (" + Inventory[Feedable[i].it] + ")" );
writeln(" <br>");

slyz
04-12-2010, 02:33 PM
Thanks Zarqon, I included this.

I have another question: the 'Feedable Items' section can be toggled by clicking on the title (through simple javascript). Kol uses a cookie to remember if a section is toggled or not... Is there any philosophical objection to a cookie doing the same thing here?

I'm adding a 'Creatable Items' section underneath it, so we can have it 3 ways:
- both sections are showed (when you start the script AND each time you hit a button)
- both sections are hidden (when you start the script AND each time you hit a button)
- a cookie is used to remember the state of each section every time a new instance is called.

Another solution would be to have a form toggled by clicking on the section title. This would allow to store the state of the sections via ash, but I have no idea if that's possible.

zarqon
04-12-2010, 03:27 PM
Since it's a relay script, I personally would prefer a cookie over another mafia preference -- especially for something like that. In fact, I love that idea.

I hope at some point you will be factoring in the value of slime stack charges for feeding basic meat stack gear... :) Not to rush things or anything.

slyz
04-12-2010, 08:51 PM
New version posted.
- Creatable items are now supported. I was very conservative with this: items that would take a turn to craft are not considered.
- I use a cookie to remember if a section was toggled or not.

Next up: add support for the Hobo Spirit and the GGG!

jcowley
04-13-2010, 07:43 PM
Pretty good, I've had a quick play about with it. Something else I would like to take into consider for HC especially, is the ability to compare the slimeling MP to the PULVERIZE value of the item. So 2 twinkly powders is worth 60 meat, etc. Not sure how much of a pain this is to be added, but that would be nice. So if an item sold for 40 meat but pulverized to 2 twinkly powder, it'd be 60 meat. Likewise, if it sold for 100 meat but pulverized to 3 powders, it'd use the autosell value.

heeheehee
04-14-2010, 12:03 AM
aqualectrix's SmashLib would be rather handy for anyone who wants to tackle this. Just tossing that out there.

Edit: Also, Bale's Universal Recovery generates your meatpermp, which would also be useful. Presumably.

slyz
04-14-2010, 06:30 PM
New version: Familiar Feeder 0.3 beta

Lots of new things! Check out the first post for updates (Hobo/GGG supported added).

EDIT:

@ Zarqon: sorry for the mess I did while discovering Registry.ash. Apparently I can't unregister relay_Feed.ash, could it be removed from your site?

jcowley
04-15-2010, 09:25 PM
Awesome slyz, this is great! Thanks! Everything seems to be going well from what I've seen, I'll keep an eye out for anything though.

zarqon
04-16-2010, 09:28 AM
Wow, this is getting pretty impressive.

I have yet another suggestion. Interface-wise, I'd prefer createables and current inventory to be sorted together. A listing like in mafia's Item Manager would be excellent:

Hell ramen (14 possible, 4 current)

Then the feed/create forms in your top interface would also merge, perhaps with the following options:


Feed all current
Feed all current but one
Feed all possible
Feed quantity ____


The first two options would never create items. The last two would create if possible/necessary.

This would have the added effect of making the script a little easier on the eyes as well, since you could have two forms where you now have three. Also, when looking for the best value, you wouldn't need to scroll between inventory and createables.

Sorry -- I keep making suggestions for this script because I love it and see myself using it whenever I need to feed any of these familiars!

Since it came up earlier in this thread, I'd also like to publicly thank heeheehee for a quick and cheap Slimeling run! He is a gentleman and a scholar. I hope to add Slimeling support to SS this weekend (while I'm fixing the foreach issue with DB combos).

slyz
04-16-2010, 05:03 PM
I thought a little about this suggestion, and I'm going to try and sort things out so everything is displayed as Zarqon suggested, but with the possibility to toggle off the crafting.

I guess I can also add a "ask for confirmation" toggle, and another frame at the top that resumes what will be used and the actual cost in meat and inventory items.

By the way, make sure you re-download the data file too. I added things like spices,noodles, reagents and garnishes, to make sure ACs and good food don't show up. I'll need to get around to adding a way to show and configure the items to keep.

jcowley
04-16-2010, 09:17 PM
A few things... Swashbuckling pants and eyepatch aren't blue (the "keep one" colour), and as a non-muscle sign, for creatable items such as the balloon helmet, it does NOT factor in the cost of meat paste, AND the price for the balloon helmet is shown to be 44 meat ( 2 skinny balloons), not 60 meat (autosell of the balloon helmet). So there's some little things, but on the whole I am really loving this script, and I approve of Zarqon's suggestion, that's one of my favourite things about KolMafia.

zarqon
04-17-2010, 03:06 AM
Before you go to the effort -- I'm wondering if anyone would remove createable items from the list, given that you can easily avoid feeding them. Mafia users are accustomed to seeing/using items in this fashion (X possible, Y current). Not a big deal, but might be needless effort on your part.

Also, how about changing the "Feed:" text under each item into a quick link that feeds one of that item? Would be a nice usability feature.

I'm trying to keep you from getting bored.

slyz
04-17-2010, 09:59 AM
I went and copied KoL's interface, and forgot I could steal Mafia's own interface!
About the link to 'Feed', I think I could do that (now that I found simple javascript tutorials).

@ jC: thanks, I'll factor all those things in.

Regarding eyepatch and swashbuckling pants, they are considered items to keep only if you don't have pirate fledges, or if you have pirate fledges but can't equip them (myst < 60 ). Since you generally only have one of them, they will only be shown when you can feed them (hence why you never see them colored blue).

slyz
04-18-2010, 01:40 PM
I just ascended and started using this in-run. I ran into a little problem when trying to feed a saucepan:


> slimeling 1 Saucepan

Verifying ingredients for 17-alarm Saucepan (1)...
Verifying ingredients for 5-Alarm Saucepan (1)...
Verifying ingredients for heavy hot sauce (1)...
You need 1 more big rock to continue.


This might cause problems for people with a big rock in their inventory, so I added a couple of lines to make sure saucepans won't be considered, until a solution is found (the worst case scenario would be to use visit_url() to do the feeding instead of using the CLI command).

EDIT: the fix was simple enough, now the script will append a 0 to all quantities.

Muhandes
04-19-2010, 08:53 PM
Just found this, and I must say it's awesome. All the micromanagement was the main reason I wasn't using the slimeling as much as I could, this makes much of the hassle much easier.
Thanks!

heeheehee
04-19-2010, 11:18 PM
EDIT: the fix was simple enough, now the script will append a 0 to all quantities.

Presumably this means "insert a 0 before all quantities" (e.g. "slimeling 01 Saucepan"), for those keeping track at home. At least, that's what the discussion in the other thread seems to indicate (and the other option would just be absurd). Just clearing up some potential confusion.

slyz
04-20-2010, 08:39 AM
Sorry for my english =)
Yeah, the zero goes in front (prepend?). The contrary would be awkward.

zarqon
04-23-2010, 04:22 PM
Another easy suggestion. I'd appreciate the title at the top of the page being a link to this thread. :) Don't forget "target='_new'". :)

slyz
04-23-2010, 04:35 PM
"target='_new'" is to open in a new tab?

zarqon
04-23-2010, 05:14 PM
Yes. But... no, I misremembered. That should be "target='_blank'".

slyz
04-28-2010, 06:23 PM
New version: Familiar Feeder 0.4 beta

Lots of new things! Check out the first post for updates: jC's and Zarqon's requests have been implemented, some logic has been fixed.

I need help with HTML/CSS stuff - I can't get the 'Keep Stuff' section to be the same size as the 'Feed Stuff' one. That, and I think my HTML structure is an out of date mess.

I also need people to tell me how they would like item info to be presented: the current way seems a little bit of a clutter, but I'm hesitant to use more color.

EDIT: Zarqon, I tried turning the script's name into a link, but I can't get it to appear white. Could Someone look at lines 616 and 658 and tell me what I'm doing wrong?

Muhandes
04-28-2010, 08:08 PM
I'm not sure what went wrong, but in the new version the "Feedable Items" area includes creatable items instead of the ones I have in my inventory, which are no where to be seen. But as I only have a "Feed Stuff" area, I can use those either. In other words, the new version is completely unusable for me. I hope my explanation goes through the alcohol fumes.

slyz
04-28-2010, 08:18 PM
Now there's only the "Feedable Items", which includes you current and creatable items, like Mafia's food/booze/spleen manager. Next to each item, there's (X possible, Y current) which indicates you can create X of an item, and have Y in your inventory.

In the "Feed Stuff" section:

Feed All Current - feed the quantity you have in your inventory (nothing is created).
Feed All Current But One - feed the quantity you have in your inventory minus one (nothing is created).
Feed All -feed as many as possible (items are created if needed)
Feed quantity - feed the quantity specified (items are created if needed)


Keep in mind this is an ascension-oriented script, I know using this in aftercore with a big inventory would be mildly overwhelming.

EDIT: and of course, all those quantities DO NOT take into account the items you choose to keep. In theory at least (as long as this is marked a beta).

Muhandes
04-29-2010, 08:07 AM
I was a bit too drunk yesterday to notice that change. However, that's not the main problem.
But none of my current items show in the list. I have at least 20 items in my inventory that can be fed.

slyz
04-29-2010, 04:07 PM
Could you tell me what feedable familiars you have, and what items didn't show up? I guess it's simply a matter of configuring Feed_keep.txt, but maybe not.

One thing that the script is being perhaps too conservative about is hiding items that are in your inventory, but have an item to keep as their ingredients. For example, I put the cocktailcrafting garnishes in the default Feed_keep.txt, with a quantity of -1 to indicate that all garnishes should be kept (coconut shells for examples won't be considered when the script is looking for items to feed to your slimeling). If you also own a Hobo Spirit, Advanced Cocktails and Superhuman Cocktails will never show up either, because they have garnishes for ingredients, and nothing that can be made from them is considered.

I did the same thing for spices and noodles, if you have a GGG.

I decided to filter things like this because this is an ascension-oriented script, and I think anyone in HC/Ronin would like SHCs and reagent pasta to be filtered out.

I added a way to add stuff to keep, but I need a way to show the list of things to keep in order to make configuration easier. Or the script could check for HC/Ronin and only filter out items in that case. I don't see myself regenerating MP with those familiars in aftercore though.

zarqon
04-29-2010, 04:55 PM
In that case, your filtering should also take into account a couple more things, if it doesn't already:

1) Pathed runs -- can_drink() and can_eat() would be what you want for that. There's no need to save cocktailcrafting garnishes on a Teet run.
2) vars["is_100_run"] -- if you're doing a 100% run with one of the familiars, any considerations that factor in feeding things to one of the other familiars should be ignored. In other words, the script should basically consider have_familiar() to be false for the owned-but-never-going-to-be-used familiars. I'd recommend a wrapper function for have_familiar().

EDIT: I just updated this, and had the same problem -- all my current items disappeared, it's only showing createables. I have all three familiars, running latest daily, current script and data file.

slyz
04-29-2010, 05:48 PM
Woops, a ! turned into a =, effectively filtering out inventory items. I'm not good at maintaining a biggish script. Let's hope I learn faster =)

I added Zarqon's suggestions for pathed runs. I didn't think of 100% runs... I guess I'll add that to the next update.

Muhandes
04-29-2010, 09:26 PM
It's working now. It is a bit confusing to see "0 possible, 1 current", but I guess I'll grow used to it.

Edit: oddly I get: Upgrade Familiar Feeder from 0.41 beta to 0.4 beta here: http://kolmafia.us/showthread.php?t=3919

icon315
04-29-2010, 10:13 PM
ok, wait so how did you fix it?

slyz
04-30-2010, 04:56 AM
Muhandes: That's what happens when you update the script twice in the same day... sorry!
Just type _version_slimeling_feeder = 0.41 beta in the gCLI.

EDIT: I don't remember now, and I can check: Mafia never shows (0 possible, X current) ? It only shows (X current)? That easy to change.

zarqon
04-30-2010, 05:36 AM
Mafia includes current in possible, so if current is nonzero, so is possible. (possible >= current)

slyz
04-30-2010, 12:42 PM
Oh, mine just shows how many you can craft, and how many you have. I'll change that in the next version. Thanks again!

slyz
05-01-2010, 09:32 AM
@ Zarqon: fix posted!

zarqon
05-03-2010, 03:33 AM
I like it! All is working well. I'm in the middle of a Slimeling run so this has come in very handy! Thanks for writing and sharing it.

slyz
06-09-2010, 10:22 AM
New version: Familiar Feeder 0.5 beta



Added an Items to Keep section, so items can be removed from the To Keep list (or their quantities changed).
Removed items that have a meat stack as one of their ingredients from the Feedable Items section, since they don't give MP. The script also looks recursively at all the ingredients, since apparently items like Gnollish autoplungers (http://kol.coldfront.net/thekolwiki/index.php/Gnollish_autoplunger) also count as meat stack items.


Please report any issue you might have, or things that don't add up.
Could someone also confirm that items made from dense meat stacks don't creat slime stacks (and add MP charges)?

slyz
06-16-2010, 11:34 AM
New (small) update:

I was using !can_drink() instead of !can_eat() to remove food from stuff to keep
Added a few ascension relevant items to the default keep list (enchanted bean, glass of goat's milk, spooky mushroom, some more +ML stuff, drums and guitars for the Lair, hats for the +damage hatter buff...)
Added some logic to remove some items to keep from the list: only the hat/drum/guitar that you already have that has the worst meat/mp ratio is kept, the rest can be fed.

icon315
06-25-2010, 06:21 AM
W00t i got me a slimeling for my KoLaversary. so now i can use this.. the problem is that i have no idea how the slimeling works. Is there a way you can make like a mini-guide

lostcalpolydude
06-25-2010, 07:14 AM
W00t i got me a slimeling for my KoLaversary. so now i can use this.. the problem is that i have no idea how the slimeling works. Is there a way you can make like a mini-guide

The wiki should be adequate for learning what it does.

slyz
06-25-2010, 08:52 AM
W00t i got me a slimeling for my KoLaversary. so now i can use this.. the problem is that i have no idea how the slimeling works. Is there a way you can make like a mini-guide

Lost is right, the Wiki (http://kol.coldfront.net/thekolwiki/index.php/Slimeling) should be enough. The short version is: you feed it equipment, that gives him charges. With charges, it also acts like a starfish in combat.

Keep in mind that this script is ascension-oriented though, it will not show the most profitable equipment to feed in aftercore (which I guess would be antique armor).

And congratulations on your KoLversary!

Raven434
07-05-2010, 07:36 PM
Thanks. I just started my first slimeling run over the weekend and it helps a lot!

I was dumb ass and meant to take it out for a spin on a myst run, not a moxie run.

Oh well...

slyz
07-11-2010, 12:55 PM
Update: Familiar Feeder 0.52 beta


Items weren't always removed from the currently_considering map, causing is_meat_stack_item() to sometimes falsely return false. Detecting if an item has a meat stack as on of its ingredients should now work correctly.

heeheehee
07-11-2010, 03:50 PM
It's been brought to my attention that apparently items with $item[dense meat stack] as a component also do not add MP charges.

slyz
07-11-2010, 03:55 PM
Great, good to know! Simply uncomment line 431 to take that into account.

For some reason, I completely forgot to spade that...

slyz
07-15-2010, 09:42 AM
Sorry for double post:


I finally tried feeding a dense meat stack item (dense meat sword in this case) to an empty Slimeling. On the next combat, the slimeling had the expected 6 bursts, and I didn't get a slime stack.
I fed a Gnollish autoplunger (item made from an item that is made from a meat stack), did not get any MP from the slimeling, and got a slime stack.


I'll leave the script as it is:

It needs to look recursively in all the ingredients to check if an item has a meat stack nested as one of its ingredients.
Dense meat stack items give MP, not slime stacks.

mellissaleo
07-24-2010, 01:48 PM
I was trying to use your script on different versions of mafia daily builds and kept getting this error:

Bad item value: "Sledgehammer of the Vćlkyr" (relay_FamiliarFeeder.ash, line 229)
I don`t know anything about scripting, but I went to see what that particular line of your script says. And it says:

...available_amount($item[Sledgehammer of the Vælkyr])...

The thing is, `ć` is a letter in my language. But I do not understand why or how would mafia be reading a `æ` as a `ć`. This is not much of a bug report, as I doubt many people will be having the issue, but I just thought to let you know.

Anyway, I edited out that part of that line and the script works like a charm. And I must say, it is a really big help to not have to feed my slimeling one item at the time. Thank you for the scripting magic!

slyz
07-24-2010, 02:11 PM
I don't understand much about text file formatting, and didn't have any problem here with the "æ". The simplest would be to replace $item[Sledgehammer of the Vælkyr] with
to_item(4316). I'll add that to the next update.

Veracity
07-24-2010, 04:21 PM
Or, you know, you could use the name with character entity, just like KoL and KoLmafia.

$item[ Sledgehammer of the V&aelig;lkyr ]

heeheehee
07-30-2010, 02:36 AM
Did some minor spading, confirmed that the autoplunger did, in fact, give a slime stack, but the barskin cap (doesn't require armorcraftiness but has a basic meat helmet as one of its ingredients) gave MP. I guess... just basic meat items and the plunger give slime stacks?

slyz
07-30-2010, 10:56 AM
Apparently, I tested the only exception and concluded it was the standard. Even the repeating crossbow (also made from a meat engine) gives MP instead of a slime stack.

The script will be updated shortly to only show basic meat items and the autoplunger in the meat stack section.

th3y
07-31-2010, 12:19 AM
This is brilliant, thank you.

-Th3y thank you

slyz
09-11-2010, 04:01 PM
Can someone check if giving a drink to a Spirit Hobo with Ode active uses turns of the effects? And if not, maybe check if giving him an Imp Ale with Ode active still gives 2 charges?

Also: I apparently missed that food fed to a GGG doesn't take into account whether Milk is active or not, so I'll correct that in the next version. I should probably also stop people from feeding Key Lime Pies to a GGG, since you won't get the key back (Ill hard-code that in).

slyz
10-06-2010, 12:48 PM
New version: Familiar Feeder 0.6 beta

You will need daily build (http://builds.kolmafia.us/) 8657 or greater.
You can either use the new Feeder_keep.txt, or add this to your current one:


seal-skull helmet 1
seal-clubbing club 1
helmet turtle 1
turtle totem 1
ravioli hat 1
pasta spoon 1
saucepan 1
disco mask 1
disco ball 1
mariachi hat 1
stolen accordion 1
Hollandaise helmet 1
old sweatpants 1



Removed extra charges you could get from feeding your familiar with Ode or Milk active.
Added all the items obtained from using a Chewing gum on a string in the defaults Feeder_keep.txt file, so that you always keep one (and never get another one from a chewing gum).
Added logic for feeding the hippy outfit: If you have one of the war uniforms, the filthy corduroys will be removed from the items to keep. If you don't have a VIP key, the filthy knitted dread sack will also be removed. In both cases, if your data file is configured to keep all (-1) or more than 1 of these, this logic is overridden.
Added logic for feeding the chef's hat: if you can eat and don't have a chef-in-the-box/clockwork chef-in-the-box, it will be added to the items to keep. This can be overridden in the same way as above.
Added logic to never feed key lime pies to the GGG (you don't get the key back).

th3y
10-08-2010, 03:09 PM
Added all the items obtained from using a Chewing gum on a string in the defaults Feeder_keep.txt file, so that you always keep one (and never get another one from a chewing gum).

It seems to me that, assuming you have all the items to start with, you could feed one to the slimeling and then immediately buy a replacement for 50 meat (cost of one chewing gum use). So the meat per MP is 50 divided by whatever the charge value is. Sometimes this will be a favorable option, so I think you *would* want to have this option available even when you have only one of a given item.

User workaround, of course, is to remove the items from the keep list if desired.

-Th3y thank you

slyz
10-08-2010, 03:42 PM
I was thinking about some logic for this. Since they all have the same power (I think, I need to check), I want to add a 'starter item' entry. The script would feed extra ones (all of them if you remove them from the items to keep), then closet every starter item that is feedable and use gums until the amount you want to feed is obtained. This way you still have one of each if you want to get trinkets.

xKiv
10-09-2010, 11:14 PM
I have a nitpick. It's import "SmashLib.ash"; not just import "smashlib.ash". Case is important on some systems!

slyz
10-11-2010, 07:45 PM
New version: Familiar Feeder 0.61 beta

Added support for using chewing-gums on strings and feeding the resulting starting items to the Slimeling.

If you have all 3 worthless items and old sweatpants, the script will only closet enough starter items to guarantee you will won't get unfeedable items for the chewing-gums.
If you don't have all 3 worthless items and old sweatpants, the script will closet all the starter items you currently have to maximize your chance of avoiding unfeedable items. This is not the optimal method (it would be better to use the gums one by one and closet all the starter items you get to always have the lowest chance of getting an unfeedable item), but it's slightly more server-friendly for large amounts (>12).
In both cases, the script will put back any item that was moved, but any worthless item you get in the process will stay in your inventory.



I have a nitpick. It's import "SmashLib.ash"; not just import "smashlib.ash". Case is important on some systems!
Also done.

slyz
11-09-2010, 07:49 AM
New version: Familiar Feeder 0.62 beta

Added support for feeding Bart Ender beers to the Spirit Hobo. I only tested this with "debug" on, as I don't have a Spirit Hobo.

slyz
07-11-2011, 10:59 PM
New version: Familiar Feeder 0.63 beta
Temporary fix for the new fullness.txt and inebriety.txt data files. I guess I'll tweak the code a bit to use proxy field and speed-up slightly when you have a GGG/Hobo.

I'm going to try adding gggFullness and hoboFullness tracking to Mafia, like we currently do with the Slimeling. I hope it will make people start checking out this script and maybe give some advice on how to make it more user-friendly.

roippi
07-24-2011, 04:46 AM
The recent changes to charpane parsing seem to have done something to FF. Some percentage of the time after I hit "feed", it will load the charpane in the main window instead of refreshing the FF page. Oddly it doesn't happen 100% of the time, but it's probably more than 50%.

I haven't had time to debug further, sorry.

xKiv
07-24-2011, 12:24 PM
I got that too. I have charpane relay script, maybe there's some problem with that too (like that was part of the problem with the batch_close() issue)?
Or maybe things that trigger charpane reload make it steal the focus (there would probably be some kind of race condition)?

(ETA: except I am noticing it with the daily deeds relay script, not the feeder which I only use rarely)

slyz
07-24-2011, 01:46 PM
I'm seeing it too, I'll try to try to track this down.

In other news, v0.7 beta now uses knoll_available() instead of in_muscle_sign() to decide if meatcrafting takes a turn, and the script now uses proxy info instead of loading food/booze data files for data.

roippi
07-28-2011, 08:15 PM
Weird.. I'm getting a stack overflow with the latest version. I don't think any recent changes to mafia are the cause, but I could be wrong. Brain is not fully functional today.

debug log attached if it helps.

Alhifar
07-28-2011, 08:24 PM
The overflow seems to be when it's trying to get the value of "autoSatisfyWithStash"; specifically while it's checking if the key is a global property. Is there something different with autoSatisfyWithStash compared to other properties somehow?

slyz
07-28-2011, 08:33 PM
It looks like get_ingredients() is the culprit. Line 950 of ConcoctionDatabase.getAvailableIngredients()
is:

Preferences.getBoolean( "autoSatisfyWithCloset" )
which is a strange place to generate a StackOverflowError.

Preferences.java hasn't changed since r8924!

roippi
07-28-2011, 10:11 PM
Yeah. Like I said, weird. I haven't narrowed it down to anything yet, but I did manage to get a slightly different stack trace than the one before..


Unexpected error, debug log printed.
class java.lang.StackOverflowError: null
java.lang.StackOverflowError
at net.sourceforge.kolmafia.persistence.ItemDatabase. getCanonicalName(ItemDatabase.java:1275)
at net.sourceforge.kolmafia.persistence.ItemDatabase. getItemId(ItemDatabase.java:1230)
at net.sourceforge.kolmafia.persistence.ItemDatabase. getItemId(ItemDatabase.java:1216)
at net.sourceforge.kolmafia.persistence.ItemFinder.ge tFirstMatchingItem(ItemFinder.java:381)
at net.sourceforge.kolmafia.persistence.ItemFinder.ge tFirstMatchingItem(ItemFinder.java:351)
at net.sourceforge.kolmafia.textui.DataTypes.parseIte mValue(DataTypes.java:288)
at net.sourceforge.kolmafia.textui.RuntimeLibrary.get _ingredients(RuntimeLibrary.java:2891)
at sun.reflect.GeneratedMethodAccessor38.invoke(Unkno wn Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.sourceforge.kolmafia.textui.parsetree.LibraryF unction.execute(LibraryFunction.java:126)
at net.sourceforge.kolmafia.textui.parsetree.Function Call.execute(FunctionCall.java:166)
at net.sourceforge.kolmafia.textui.parsetree.Function Call.execute(FunctionCall.java:104)
at net.sourceforge.kolmafia.textui.parsetree.Operator .applyTo(Operator.java:392)
at net.sourceforge.kolmafia.textui.parsetree.Expressi on.execute(Expression.java:221)
at net.sourceforge.kolmafia.textui.parsetree.Conditio nal.execute(Conditional.java:78)
at net.sourceforge.kolmafia.textui.parsetree.If.execu te(If.java:67)
at net.sourceforge.kolmafia.textui.parsetree.BasicSco pe.execute(BasicScope.java:451)
at net.sourceforge.kolmafia.textui.parsetree.UserDefi nedFunction.execute(UserDefinedFunction.java:129)
at net.sourceforge.kolmafia.textui.parsetree.Function Call.execute(FunctionCall.java:166)
at net.sourceforge.kolmafia.textui.parsetree.Operator .applyTo(Operator.java:392)
at net.sourceforge.kolmafia.textui.parsetree.Expressi on.execute(Expression.java:221)

...repeat ad infinitum

I wonder if it's choking on a specific item that's in my inventory? I did just break the prism so... hm. Changing all autoSatisfy options to false doesn't help.

Theraze
07-28-2011, 11:48 PM
If it's checking ingredient items, you might want to throw in a check that there are multiple ingredients, sort of like:
&& count(get_ingredients(i)) > 1

Before I added this to EatDrink, it liked to get into infinite loops turning flat dough into wads of dough and back again...

slyz
07-29-2011, 12:05 AM
I was looking for instances of get_ingredients() too see if one of them could cause an infinite loop: even though I added a "currently_considering" map to prevent infinite recursion, I found this comment I wrote before get_cost() (which doesn't use "currently_considering"):


// the only circular concoctions are clovers, dough, and the charrrms.
// clovers have no autosell value, and shouldn't be fed, dough is an NPC item
// and charrrms can't be fed (Mafia doesn't have a power for them)


Charrrms now do have a power :)

Now, if I run the script with a charrrm bracelet and one of the charrrms in my inventory, I can reproduce this.

slyz
07-29-2011, 12:13 AM
New version to fix this is up (v0.8 beta).

Thanks roippi and Theraze.

roippi
07-29-2011, 12:53 AM
brilliant, that fixes it. Still have no idea how you figured out it was the charrrm bracelet :)

slyz
09-06-2011, 06:33 PM
Familiar Feeder 0.9 beta

Remove the Clip Art items from the concoctions map. If you have the items, you can still feed them, or put them on the "to keep" list.