OCD Inventory control

This script is, to put it nicely, fucking awesome. Thanks!

Now, question. What is the order of operation when it comes to each action? Is it done by action type, or down the list? For example:

Gnollish pie tin: Autosell
lime: Mall sell
Sneaky Pete's key: create Sneaky Pete's key lime pie
wad of dough: Autosell

I want to cook the key lime pies and then get rid of the excess. What happens?
 
It goes by order of action type, so it will... create first, pulverize next (I think) then mall sell, then autosell, then gift. I think is the order?
 
Order of action type. First code (for those who care), then english translation:

Code:
		if(act_cat(make, "MAKE", "") && !check_inventory(StopForMissingItems))
			return false;
		if(act_cat(untink, "UNTN", "") && !check_inventory(StopForMissingItems))
			return false;
		if(act_cat(usex, "USE", "") && !check_inventory(StopForMissingItems))
			return false;
		if(act_cat(pulv, "PULV", "") && !check_inventory(StopForMissingItems))
			return false;
		
		act_cat(mall, "MALL", "");
		act_cat(auto, "AUTO", "");
		act_cat(disp, "DISP", "");
		act_cat(clst, "CLST", "");
		act_cat(clan, "CLAN", "");
		if(count(gift) > 0)
			foreach person in gift
				act_cat(gift[person], "GIFT", person);
		if(count(kbay) > 0) {
			foreach type in kbay
				act_cat(kbay[type], "KBAY", type);

In other words:
  1. create
  2. untinker
  3. use
  4. pulverize
  5. mall
  6. autosell
  7. display
  8. closet
  9. clan stash
  10. gift
  11. kBay
 
Relay OCD db Manager Updated!

  • New features adapted from code by rlbond86:
  • Item image displayed!
  • Item image links to KoL pop-up
  • Item name links to KoL wiki page!


Not quite exactly the same as rlbond86 suggested, but I suspect some of that is because he didn't want to take too many liberties.

rlbond86: Thanks for the code you provided!

Now I need to get off my butt and add a minimum mall price for each item that OCD won't ever price below.
 
Last edited:
Relay OCD db Manager Updated!

  • New features adapted from code by rlbond86:
  • Item image displayed!
  • Item image links to KoL pop-up
  • Item name links to KoL wiki page!


Not quite exactly the same as rlbond86 suggested, but I suspect some of that is because he didn't want to take too many liberties.

rlbond86: Thanks for the code you provided!

Now I need to get off my butt and add a minimum mall price for each item that OCD won't ever price below.

Glad to help a great script get a little better!

I just noticed one bug though. On line 393,

Code:
return  "<a title = \"Open wiki page in a new window\" href=\"javascript:wikiitem('" +doodad+ "');\">" + doodad +"</a>";

should be replaced with something like

Code:
string fixed_doodad = replace_string(to_string(doodad), "'", "\\'");
return  "<a title = \"Open wiki page in a new window\" href=\"javascript:wikiitem('" +fixed_doodad+ "');\">" + doodad +"</a>";

Otherwise, the javascript code will have an error when running for a code with an apostrophe in it, like the dead guy's watch.
Sorry I didn't notice sooner, that bug is my fault. I don't program in JavaScript very often and forgot it uses ' instead of " :/
 
Last edited:
Now it looks very OCD. A picture for everything and everything with a picture. <beep beep> Sadly, I smacked down Hodgman today and he dropped a book. Working on it!
 
Something that I've noticed off and on is that, while crafting small amounts of items are great, if you end up needing to buy large amounts of components, it ends up rather troublesome. I know it would take some database reworking, but any chance of a "max value for creation" being added? If it's even possible... I just noticed that once again, I was buying toast for 10k. :) I like making people happy, but not THAT happy.
 
Fair enough, and that's about the best I can hope for. Since we're invoking create at that point, there isn't really an easy way to tell how much we're paying to create, unfortunately.

I'll just need to keep a close eye on major creations using cheap components. Least I did turn on the "don't spend more than aBPL when doing your price advisor stuff" setting, so it stopped suggesting I make hundreds of wrapped presents...
 
The way I'll probably implement protection is a checkbox for "Don't purchase ingredients to create this" on each item. It will also be a lot simpler for me to bound creation by createable_amount() than to total up purchasing costs for the missing ingredients.

When I eventually implement a solution to the problem.
 
Ah... that would certainly be easier than trying to hack through the creation system. :) Not that I'm needing this immediately, just that I'm looking forwards to its eventual awesomeness. Thanks in (major) advance.
 
I got into aftercore yesterday and added the previous discussed feature.

OCD Inventory Control Updated!
Relay OCD db Manager Updated!

  • Limit expenses for creating items.


If you go into the "Edit Database" subcategory for "Crafting" you'll find that each item has a checkbox for "No purchase". If checked, then creatable amount will be limited to what you can make without purchasing items. This is tracked separately for each item as you'd expect.
 
Using the new Relay script, if I go Edit Database and then Crafting, I end up back at the Information tab.
Tried restarting the window in the webbrowser, tried restarting Mafia. Same problem.
Further inspection show that none of the sub-categoies of Edit Database work, but all send me to the Information tab.

Using the "Get latest daily build"-script, so using r10940

EDIT:
Hmm, on my multi, it all seem to work though..

EDIT2:
And back on my main, it don't work..
My multiu had items left to uncategorized, and my main dont, could that have anything to do with it? Using the same daily build for both multi and main so that shouldnt affect, I think..

EDIT3:
Yup, now that I've used PAtoOCD.ash to sort all my uncategorized items, the subcategories of Edit Database all send me back to Information again, even on my Multi.
 
Last edited:
That leads me to believe that PAtoOCD is to blame.

I can't figure out what would cause such an error. Of course I've never used PAtoOCD, so perhaps someone who knows something about that will be able to chime in.
 
PAtoOCD is Zarqons invention. http://kolmafia.us/showthread.php?1818-OCD-Inventory-control&p=65950&viewfull=1#post65950
All that it do, if I understand it right, is to go through what an item can be created into and calculate what the most optimal use for each item is and then add them to the OCD data file. It just add the name, how many to keep and what to do with them. As far as I can tell, it don't do anything else than what I do if I flip through the lists manually and let OCD relay put the data into the data file. But then I do suck at reading code =S

I have not updated it for a long time and it was only now that I updated the relay that I got this error, trying to check what the new feature was like.

I logged in to my main now, randomly removed an item from the data file (since I could not do it in the relay). Ended up being the 7-foot mattock.
Opening the relay I can now go around in the Edit Database subcategories.
Using Add Item (to add the mattock again) I set it to pulverize the item, saved and now I can browse the Edit Database subcategories.

However, going to my character screen and re-starting the relay, I get the same bug where I cannot go to Mall, use or the other subcatagories.
 
Last edited:
Perhaps you should attach a bad OCDdata_*.txt here so I can see if the bug appears on my system as well. Then maybe I'll be able to figure it out.
 
Perhaps you should attach a bad OCDdata_*.txt here so I can see if the bug appears on my system as well. Then maybe I'll be able to figure it out.

Here is the one for my main. Sometimes I just delete the old one, and re-run PAtoOCD to see if any changes have been done to the market (and try to remember what items I wanted to keep!)
 

Attachments

I was not able to duplicate the bug with that data file. I downloaded it and switched my data to "ferdawoon". It loaded up your item data. (I have 122 items that aren't in your file.) I clicked "Edit Database." I clicked "Crafting." Everything was awesome. I clicked "Mall." Everything was still awesome.
 
I think what he said it, if you classified your 122 items that aren't in that file so that there are no unknown items, restart mafia, and try it again, then it should fail... right?
 
Back
Top