OCD Inventory control

Hmm.

> call scripts/OCD Inventory Control.ash

Unknown variable 'OCD' (OCD Inventory Control.ash, line 54)

The relay script works well for adding "closet" items. And, having done so, a "Closet" tab is available. Good!
 
Please download OCD Inventory Control again. And pretend that I'd been smart enough to use verify the first time. :o

Any chance of getting the option to check the (5th) mallprice of an item vs the autosell value? I think I would like to have it presented as a ratio between the 5th mallprice and the min mallprice (for easy use of just one number). If it is close to 1 I know that it is probably just as well to autosell it instead of dumping it into the mall.

It's actually impossible for the ratio to ever be less than 2. (Minimum mall price is twice autosell.)

I'm not likely to add that since the layout is getting tight on my monitor.
 
Please download OCD Inventory Control again. And pretend that I'd been smart enough to use verify the first time. :o



It's actually impossible for the ratio to ever be less than 2. (Minimum mall price is twice autosell.)

I'm not likely to add that since the layout is getting tight on my monitor.

I can understand that. I'll have to make do some other way then. Also, I wanted to compare min mall price with mall price, not autosell value. Thus 1 and up.
I could've said 2 times autosell and mall price but that would've meant hat I had to remember how many times higher the min mall price was than the autosell value :)
 
I failed reading comprehension again. :(

If you really are willing to add this yourself, change lines 394-406 to
Code:
		write("<th>Price Ratio</th><th>Keep</th><th>Action</th>");
		if(act == "Crafting")
			write("<th>Craft into a</th>");
		else if(act == "Gift List")
			write("<th>Send to</th><th>Message with Gift</th>");
		writeln("</tr>");
		foreach doodad in cat {
			write("<tr><td><a href=\"javascript:descitem('" +desc[doodad.to_int()]+ "');\">"+doodad+"</a></td>");
			if(act == "Keep")
				write("<td align=center>"+item_amount(doodad)+"</td>");
			write("<td>");
			OCD[doodad].q = write_field(OCD[doodad].q, "q_"+doodad.to_int());
			write("</td><td>"+to_string(mall_price(doodad)/ autosell_price(doodad)/2)+"</td><td>");

Then change line 337 to
Code:
				writeln("<tr><th>Item</th><th>Have</th><th>Price Ratio</th><th>Keep</th><th>Action</th><th>... information</th></tr>");
Finally change line 315 to
Code:
	write("</td><td>"+to_string(mall_price(doodad)/ autosell_price(doodad)/2)+"</td><td>");

That should probably do it. Note: Extremely untested.
 
Seems to be working. Needed to change line 315 to take into account items with an aotusell of 0 but it is now going through my inventory and finding the ratio. Let's see where that ends up :)
 
Hmm.

display 2 cyclops eyedrops, 1 depleted uranium seal figurine, 5 goth kid t-shirt, 1 sawblade shield, 1 solid gold bowling ball, 1 wholeberd

closet 2 cyclops eyedrops, 1 depleted uranium seal figurine, 5 goth kid t-shirt, 1 sawblade shield, 1 solid gold bowling ball, 1 wholeberd

In ocd_inventory,
Code:
	act_cat(disp, "CLST", "");
should be
Code:
	act_cat(clst, "CLST", "");

Having done so, I don't actually see anything that moves items from the clst list to the closet. Adding
Code:
		case "CLST":
			put_closet(quant, it);
			break;
to the switch statement in act_cat fixes that.

Having made those changes, the script worked flawlessly. Thanks!

Well, other than the startup message:

New Version of Bale's OCD Inventory Control Available: 3.22
Upgrade Bale's OCD Inventory Control from 3.23 to 3.22 here: http://kolmafia.us/showthread.php?t=1818
Countdown: 1 second...
Waiting completed.

;)
 
Well, other than the startup message
;)
That is an issue with ZLib: it only checks for new versions in the forum threads once a day, and compares it to the string supplied by the local copy of the script. Since you had run it today before the thread was updated, "3.22" was stored as the latest version, and since it doesn't match the "3.23" in the current version of the script, ZLib issues a warning.
 
A couple of feature requests:

Code:
transform 105 broken skull into bone rattle
Verifying ingredients for bone rattle (105)...
You need 14 more skeleton bone to continue.

Is it possible for the script to make up to the number available and maybe output that it could have made more with extra ingredients? Similar to the "Make as many as possible" tick box?

Code:
You cannot transform a salty dog into a slap and tickle. There's a problem with your data file.

I didn't understand this at first, I had the right ingredients to do the creation. But I'm thinking it could be because my box servant had blown up and I've got mafia set to only craft when one is present? If that's the case then I'm very happy with how it works! :) But can the error message be made more obvious?
 
Last edited:
Code:
You cannot transform a salty dog into a slap and tickle. There's a problem with your data file.

This shouldn't happen:
Code:
> ash import "OCD Inventory Control.ash"; count_ingredient($item[salty dog], to_item("slap and tickle"));

Returned: 1
 
- Run a script (which I will write) to pull aftercore items from my display case
Feel free to use these. I run them daily because I want the items in my DC when JickenWings gets their dump, but also want to use things daily.

The data file is sample.
 

Attachments

This is kinda edge case and I doubt many people really care what the text reads. I'd rather not do this since I don't want to clutter the configuration section. The more stuff there, the harder it is to pick out the important things. However I may be able to accommodate you. I think I'd rather just change the message in the script since I cannot imagine it would cause a problem for others.

Tell me what you think the message should read to avoid troubling bots, while being slightly informative.

The bot wants "deposit" or nothing. This is not terribly descriptive so if you'd rather just leave it as is, I'll just edit the script myself. Not a big issue at all.

As for the duct tape wallet thing, I am impressed! :)
EDIT: I'm still impressed, however there seems to be a small problem. The "Craft into..." option isn't available for duct tape. Perhaps because it's not mallable and they go together?



Re: the price ratio edits in post 164:
I have a few changes. "Keep" and "Price Ratio" were transposed in line 394 and 337. And lines 315 and 406 have a divide by zero problem with items with zero autosell cost. My really terrible solution is to add 1 to all autosell prices. :p I'm sure somebody can do better, but at least this generates some amusing price ratios for Mr Store items.

If you really are willing to add this yourself, change lines 394-406 to
Code:
            write("<th>Keep</th><th>Price Ratio</th><th>Action</th>");
        if(act == "Crafting")
            write("<th>Craft into a</th>");
        else if(act == "Gift List")
            write("<th>Send to</th><th>Message with Gift</th>");
        writeln("</tr>");
        foreach doodad in cat {
            write("<tr><td><a href=\"javascript:descitem('" +desc[doodad.to_int()]+ "');\">"+doodad+"</a></td>");
            if(act == "Keep")
                write("<td align=center>"+item_amount(doodad)+"</td>");
            write("<td>");
            OCD[doodad].q = write_field(OCD[doodad].q, "q_"+doodad.to_int());
            write("</td><td>"+to_string(mall_price(doodad)/ (autosell_price(doodad)+1) /2)+"</td><td>");

Then change line 337 to
Code:
                writeln("<tr><th>Item</th><th>Have</th><th>Keep</th><th>Price Ratio</th><th>Action</th><th>... information</th></tr>");
Finally change line 315 to
Code:
    write("</td><td>"+to_string(mall_price(doodad)/ (autosell_price(doodad)+1) /2)+"</td><td>");
 
Last edited:
Price ratio:
PHP:
to_string( mall_price(doodad) / max(2*autosell_price(doodad),100) )
:D

That should technically fix some issues you'd have with stuff with low autosell value. (Just, y'know, insert it into the above code snippets)
 
Released a new update.

I found the duct tape problem. It was an interesting issue and had nothing to do with mallability. Should be fixed now, though it's a bit less elegant that I'd prefer. I'll have to try tidying it up later. If anyone wants to give me some help with the regexp on line 262 of the db Manager, I'd be grateful. Right now it only works because of the previous line.

Veracity, thanks for unraveling my closet mess. Fixed.

A couple of feature requests:

Code:
transform 105 broken skull into bone rattle
Verifying ingredients for bone rattle (105)...
You need 14 more skeleton bone to continue.

Is it possible for the script to make up to the number available and maybe output that it could have made more with extra ingredients? Similar to the "Make as many as possible" tick box?

I gather you've turned off mall purchasing. I'll take care of this fix next.

You cannot transform a salty dog into a slap and tickle. There's a problem with your data file.

This shouldn't happen:
Code:
> ash import "OCD Inventory Control.ash"; count_ingredient($item[salty dog], to_item("slap and tickle"));

Returned: 1

This is still puzzling me.
 
I'm sure somebody can do better, but at least this generates some amusing price ratios for Mr Store items.

I did the following:
Code:
	if(autosell_price(doodad) == 0 && historical_price(doodad) != 0)
		write("</td><td>"+ to_string(historical_price(doodad) + " (mallprice)</td><td>"));
	else if(autosell_price(doodad) != 0 && historical_price(doodad) != 0)
		write("</td><td>"+to_string(historical_price(doodad)/ autosell_price(doodad)/2)+"</td><td>");
	else
		write("</td><td>"+"Cannot be sold"+"</td><td>");

Ahh yes, I also changed to historical_price to not do a bazillion of server hits every time I save the datafile...
 
Last edited:
Price Ratio Version

I've incorporated Bale's changes to add the "Price Ratio" column to the relay script. I've also added my fix to the transposed column headers and Winterbay's more elegant solution to zero autosell price items. All of this in relay 1.24 which has different line numbers than the ones referenced in previous posts.

This should make it easier for others to try the Price Ratio version. Please be aware this fork has not been tested that much and has been fiddled with by rank amateurs such as myself, so use caution.
 

Attachments

This might be just as good a place to post this as any, maybe not. Let me know if you'd prefer this in a PM or whatnot.

I just did the most recent update and now when I run the script, I get nothing. I run it and the CLI shows:

> call scripts\OCD Inventory Control.ash

Then nothing else, and it doesn't do anything. It (obviously) was working just fine before.

Thanks
 
That doesn't really make sense to me, so I'd like to ask that you run a version that I'm attaching to this post. It's got a bunch of extra debugging lines to help me find out when things go awry. Please copy-paste the CLI output here.
 
Last edited:
Back
Top