OCD Inventory control

zarqon

Well-known member
Didn't check out the data format for OCD's data file, but I think this is basically what you want:

PHP:
cli_execute("mirror non_ocd_items.txt");  // start logging CLI output
foreach i,num in get_inventory()
   if (!(ocddatafile contains i))    // make this check actually do something
      print("$item["+i+"]");
cli_execute("mirror");  // stop logging

Note that if you run this script again, contents will be appended, not overwritten.

Also note that if you're more ambitious, you could also use this to actually add new content to OCD's actual datafiles.
 

xKiv

Active member
Or mazbe somthing like (typed completely out of my head, without consulting anything, so buggy as hell)
Code:
creatorRecordType [item] itemlList;
file_to_map("OCDcreatorFileName.txt",itemList);
foreach i,num in get_inventory() {
  item it = to_item(i);
  if (!itemList contains it) {
    // populate the record with proper values here
    itemList[it].xxxx = yyyy;
    ...
  }
}
// write completed map back to the mapfile
map_to_file(itemList,"OCDcreatorFileName.txt");

(or use a different map for the new items, then map_to_file them to another file, edit that file, append by hand ...)
 

tgetgel

Member
Just wondering if this could integrate with PriceAdvisor.ash and get the best bang for the buck (mallsell, autosell or smash).
 

Bale

Minion
That would be a very different script. What you want is a script to automate PriceAdvisor. It wouldn't really have much in common with this script.

Incidentally, OCD Inventory Control is in the process of getting a massive rewrite/upgrade. It should be much improved soon.
 

philmasterplus

Active member
That would be a very different script. What you want is a script to automate PriceAdvisor. It wouldn't really have much in common with this script.

Incidentally, OCD Inventory Control is in the process of getting a massive rewrite/upgrade. It should be much improved soon.

I've actually been working on a script that uses PriceAdvisor, although only for autosell/mallsell/opening containers/smash/malus/multi-use crafting. The alpha stage is here, and I plan to incorporate an improved version of item_search.ash instead of having to list every item, as well as obeying singleton settings.

Too ambitious? Does it overlap with your plans? Could you please tell us what you are planning in detail without getting overwhelmed by my questions? :)

Here is my alpha script if you'd like to peek. It uses another library and a data file, so it won't work right now.
 

Bale

Minion
Your seems to be a wonderful (although modest) front-end for PriceAdvisor. I applaud it.

Does it overlap with your plans? Could you please tell us what you are planning in detail without getting overwhelmed by my questions? :)

It does not overlap with my plans at all. The next version of this script is basically the same, but hungrier to categorize the user's plans for every item that might enter inventory and with a few more options. OCD Inventory Control doesn't allow the script to make any decisions, that's why it is OCD.
 

zarqon

Well-known member
I should add a plug for StashBot here -- which automates PriceAdvisor to manage the "stash"'s inventory -- but I won't. ;)
 

tgetgel

Member
OCD Inventory Control is in the process of getting a massive rewrite/upgrade. It should be much improved soon.

I look forward to the update. I know that the default OCD is set to your style of gameplay. Is there a listing of the items in KoL that segregates them into what you must keep x of, what you should keep, what is nice to keep, what you don't really need, etc? Or maybe, these give bonuses, these are ingredients you make the most money using, etc. It might help me adjust OCD to my style.

Thanks
 

Theraze

Active member
In KoL itself, probably nothing.
In the KoLwiki, possibly something, but likely horrifically out of date.
Using the KoL source files, you could generate something specific to your desires...

The biggest issue is, what you're asking about is something VERY specific. Whether or not keeping one or more rave whistles is a good idea depends on if you're a moxie class or otherwise using moxie weapons, as well as if you need a one handed moxie weapon that raises ML, as well as if you have something that better meets your needs, as well as how much cash you need RIGHT now and if you're planning on farming the giant castle some more...

Ultimately, each decision comes to the individual user and item... Unless you decide you're all about the credits and anything that can sell, should be...
 

philmasterplus

Active member
There is a classification of items called "singletons", which work similiarly to mementos. However, these work only from the Item Manager, and will (probably) not affect the CLI/ASH. These singletons follow special settings adjustable from the Item Manager, which look like "usable2HWeapons", "usablePants", "usableHats", etc. which you can modify. For example, if you want to keep enough Stainless Steel Skullcaps to be usable and smash the rest, you can make it a singleton, adjust the usableHats setting to 2, and check "all but usable" in the Pulverize interface.

I really, really wish they'd do something about the whole mememto-singleton mess. From my limited experience browsing into KoLmafia source code, it seems that singletons are handled in a weird and inconsistent manner.
 

Bale

Minion
As promised, I am releasing a major upgrade to this script. The biggest difference is the relay script. That relay script brings some sanity to the process of categorizing every single item in your inventory. Check it out and be amazed. Screenshot below:

gifts.png


Now OCD Inventory Control will not do anything to an uncategorized item. That makes this script a thousand percent safer to use. I feel much better about other people using it now. There are also many more options for what you can do with your inventory. If you run OCD Inventory Control with uncategorized items in your inventory, the script will prompt you, asking if you want to abort and use the relay script. If you say no, then it will keep all uncategorized items. That means it is safe to run with incomplete data. (You might even prefer to run it that way.)

A feature of particular note is that it will now send items to your mall multi if you set it at the relay script's configuration tab. Just leave that blank to use your own mall store.

Note that the OCD data file is now in a completely different format. For the sake of old users, I am attaching a script to convert your old data file into the proper format for version 3.0. You'll find that utility at the bottom of this post.

Thanks to Cieka who actually commissioned me to rewrite OCD Inventory and provided some of those new ideas. Without him I probably would have left this script as the half-complete thing it used to be. I probably surprised him with what I did to his ideas, but I know that the seed was his.
 

Attachments

  • OCD Data Converter 3.0.ash
    1.6 KB · Views: 50
Last edited:

bumcheekcity

Active member
That looks fantastic, Bale. I've always been a bit OCD myself about my inventory but afraid to use the heavy-handed approach of the original script, so I made a crappy version myself, but I'll be getting home and trying out yours soon.
 

Bale

Minion
I'm very glad that you find it less scary now. It's much more useable.

Incidentally if someone wants to call this script from another script of their own, but dislike the idea of getting a pop-up for uncategorized inventory, it is possible to suppress the pop-up.

Code:
import <OCD Inventory Control.ash>;

ocd_control(false);

The parameter "false" tells the script to keep running without prompting the user. This way you can use it to sell just a few items that you expect to get without bothering to categorize your entire inventory. How's that for a useability feature?
 
Last edited:

Banana Lord

Member
JAWDROP. Absolutely love the addition of display case management. It was the biggest hole in my OCD life, which, as you may or may not remember, I was attempting to fill with an additional script which integrated with OCD. This is much simpler. And ten times better. Thanks once again for making my life easier!
 

Bale

Minion
JAWDROP. Absolutely love the addition of display case management. It was the biggest hole in my OCD life, which, as you may or may not remember, I was attempting to fill with an additional script which integrated with OCD. This is much simpler. And ten times better. Thanks once again for making my life easier!

Glad it helps. Oh, and that screenshot doesn't show it, but the script allows you to pulverize items as well. (The sub-tabs only show up if they won't be empty and I didn't have any pulverization in my OCD database.)
 

zarqon

Well-known member
This looks beautiful, Bale. I too was afraid of running the previous version on my rather packratty inventory, but I will definitely give this one a whirl.

Is there a PriceAdvisor option (do what PA says is most profitable)? If not, there should be (and I could send you some code you could adapt for it).

Also, link to your scripts in your sig, you fool! I just spent like 5 minutes thinking I knew where to find the CounterChecker thread. >.< Speaking of your sig, congrats on the balloon trophy! I also think it's cool that the trophy will have so much meaning for you now. I feel the same about my bat collection (which recently grew by an item -- the fossilized bat skull!).
 

Winterbay

Active member
Is there a PriceAdvisor option (do what PA says is most profitable)? If not, there should be (and I could send you some code you could adapt for it).

No there isn't, but that would be brilliant. Especially for someone like me who have no idea about the worth of almost any of the thing in my inventory...
 
Top