OCD Inventory control

Banana Lord

Member
I've been having a look at the softcore stocking feature, and I was wondering if there was any facility for handling transformable items like jub-jub birds where I only want one from the complete set, not one of each type?
 

Bale

Minion
Nope. As it is, you'd have to list only one of them or all of them. Though honestly, do you need to stock that? I'd think it would be something that you'd simply want to keep in inventory all the time. It's not consumable, after all.

Perhaps I'll add disjunctives like that as a future feature. First I have to get TPS and expensive item support functioning.

Are there any other disjunctive choices like that?

And how should I handle items that you'd make different choices about depending on your next run being muscle, moxie or mysticality?
 
Last edited:

Banana Lord

Member
Though honestly, do you need to stock that? I'd think it would be something that you'd simply want to keep in inventory all the time. It's not consumable, after all.
True. But OCD demands that I be pedantic :p

Are there any other disjunctive choices like that?
Putty, cheese, ice and the LLK come to mind. They're the foldables people are most likely to pull in SC anyway.

And how should I handle items that you'd make different choices about depending on your next run being muscle, moxie or mysticality?
Doesn't matter all that much to be honest since they can easily be transformed in run. I think it'd be a good idea if you put up a dialogue box asking the user to select the primestat of their next run. That would allow you to expand into stocking stat-tuned items like corpse drinks and hi meins (which would be out-of-this-world epic).

Now that I've finally got around to having a look at that optional second parameter you added to ocd_control() I'm wondering how to use it. Something along these lines?
Code:
import <zlib.ash>;
int [string] default_ocd_data;
load_current_map("NCF_Default_OCD_Data", default_ocd_data);
ocd_control(False, default_ocd_data);
Thanks again for adding this feature by the way. Apart from making life simpler for new adopters of NCF.ash, it might even encourage some of them to start using OCD.

EDIT: I assume I'd be formatting NCF_Default_OCD_Data.txt in the same way as OCD's data file?
Code:
heavy D	AUTO	0
 
Last edited:

Bale

Minion
Now that I've finally got around to having a look at that optional second parameter you added to ocd_control() I'm wondering how to use it. Something along these lines?
Code:
import <zlib.ash>;
int [string] default_ocd_data;
load_current_map("NCF_Default_OCD_Data", default_ocd_data);
ocd_control(False, default_ocd_data);

Noooooo! That's too many steps and too complicated. I made it easier than that.

Like this:

Code:
ocd_control(False, "NCF_Default");

That assumes you have a datafile called OCDdata_NCF_Default.txt which needs to be the same as any other OCDdata file.
 

Banana Lord

Member
Ooooh, shiny! I can still use load_current_map though can't I? If users have to download a data file it sort of defeats the purpose of trying to reduce complexity. And of course load_current_map has the benefit of allowing me to update the data if I need to (Zarqon I salute you).

So at some point in my script I'd have the following to make sure the user has an up to date OCDdata_NCF_Default.txt file?
PHP:
import <zlib.ash>;
int [string] default_ocd_data;
load_current_map("OCDdata_NCF_Default", default_ocd_data);
map_to_file(default_ocd_data, "OCDdata_NCF_Default.txt");
And when I wanted to call OCD I'd do this, yes?
PHP:
ocd_control(False, "NCF_Default");
Would I actually need to call map_to_file()? Or will load_current_map() update the file in the user's data folder itself? And what happens if the user doesn't have OCDdata_NCF_Default.txt because they haven't run the script yet, will load_current_map create the file? Sorry for the slew of questions.
 

Bale

Minion
That should work just fine if you fixed the datatype for default_ocd_data. It is not int [string] as you listed it.

PHP:
record {
	string action;
	int q;
	string info;
	string message;
} [item] default_ocd_data;


You need the map_to_file. If the user doesn't have OCDdata_NCF_Default.txt it isn't a problem since you're creating it with load_current_map() and map_to_file().
 

Banana Lord

Member
When I first looked at that I had no idea what it meant. 2 minutes later I was just as lost. Then suddenly I looked at it and it made sense. Yay! Progress! I guess that education thing really does work. Thanks Bale!
 

AlbinoRhino

Active member
I am having a strange issue with the stocking function. OCD takes all of the items it is looking for from the clan stash, then proceeds to purchase the item as well. If I keep re-running the script it eventually works everything out.

Dropping items into stash (request 4 of 4)...

Stocking up on requred items!
Verifying ingredients for scroll of ancient forbidden unspeakable evil (1)...
Pulling items from stash...
You acquire an item: disintegrating quill pen
Pulling items from stash...
You acquire an item: tattered scrap of paper
Creating scroll of ancient forbidden unspeakable evil (1)...
You acquire an item: scroll of ancient forbidden unspeakable evil
Successfully created scroll of ancient forbidden unspeakable evil (1)
Pulling items from stash...
You acquire thin black candle (1,916)
itrace: thin black candle = 1921
Searching for "thin black candle"...
Search complete.
Purchasing thin black candle (3 @ 288)...
You acquire thin black candle (3)
itrace: thin black candle = 1924
Purchases complete.
Anticipated monetary gain from inventory cleansing: 306 meat.

> call scripts\OCD Inventory Control.ash

stash put 1916 thin black candle

Dropping items into stash...
itrace: thin black candle = 8

Stocking up on requred items!
Pulling items from stash...
You acquire inkwell (63)
Searching for "inkwell"...
Search complete.
Purchasing inkwell (1 @ 341)...
You acquire an item: inkwell
Purchases complete.
Nothing to do. I forsee no additional meat in your future.

> call scripts\OCD Inventory Control.ash

stash put 63 inkwell

Dropping items into stash...

Stocking up on requred items!
Nothing to do. I forsee no additional meat in your future.
Requests complete.

> call scripts\OCD Inventory Control.ash


Stocking up on requred items!
Nothing to do. I forsee no additional meat in your future.

Also, the "required" in "Stocking up on requred items!" is missing an "i". (ocd) ;)


EDIT:

It appears that it also pulls from stash and then creates (as well as buying).

Stocking up on requred items!
Pulling items from stash...
You acquire Mae West (47)
Verifying ingredients for Mae West (4)...
Verifying ingredients for rabbit punch (4)...
Pulling items from stash...
You acquire bottle of Domesticated Turkey (4)
Pulling items from stash...
You acquire raspberry (4)
Creating rabbit punch (4)...
You acquire rabbit punch (4)
Successfully created rabbit punch (4)
Creating Mae West (4)...
You acquire Mae West (4)
Successfully created Mae West (4)
Anticipated monetary gain from inventory cleansing: 84 meat.

> call scripts\OCD Inventory Control.ash

stash put 47 Mae West

Dropping items into stash...

Stocking up on requred items!
Nothing to do. I forsee no additional meat in your future.
Requests complete.

> call scripts\OCD Inventory Control.ash


Stocking up on requred items!
Nothing to do. I forsee no additional meat in your future.
 
Last edited:

Banana Lord

Member
Roughly every second auction OCD sends to kBay (I'm only sending Klaw items, and I'm using the default data to do so) gets sent back because no one bid on it. Perhaps the default data should be changed slightly (prices brought down a little, or duration extended again)? Obviously I (and other users) can change our own data, but I just thought I'd mention it in case it was something you wanted to change yourself.
 

Bale

Minion
I am having a strange issue with the stocking function. OCD takes all of the items it is looking for from the clan stash, then proceeds to purchase the item as well. If I keep re-running the script it eventually works everything out.



Also, the "required" in "Stocking up on requred items!" is missing an "i". (ocd) ;)


EDIT:

It appears that it also pulls from stash and then creates (as well as buying).

It's only pulling from the stash because you told KoLmafia that it can acquire items from the stash at will. It obeys that preference.

As for the rest... I'd have to know what you data file looked like to figure it out.

Roughly every second auction OCD sends to kBay (I'm only sending Klaw items, and I'm using the default data to do so) gets sent back because no one bid on it. Perhaps the default data should be changed slightly (prices brought down a little, or duration extended again)? Obviously I (and other users) can change our own data, but I just thought I'd mention it in case it was something you wanted to change yourself.

I would appreciate your advice on where the thresholds should be set. I don't think that extending duration is the answer since it is already approximately as long as other auctions last for. Anyone who cares to seems able to bid. Are the prices too high or should I insist on more items to be sold at a time?
 

AlbinoRhino

Active member
It's only pulling from the stash because you told KoLmafia that it can acquire items from the stash at will. It obeys that preference.

As for the rest... I'd have to know what you data file looked like to figure it out.

I'm aware of that. I want it to use the stash. However, it is pulling the total amount of items from the stash, rather than just what it needs, then it is obtaining what it needs by other methods (buying, creating) even though the requirement is satisfied (way over-satisfied) by what it took from the stash. Then on the next run it places the items taken from the stash back into the stash. Do you need the OCD file or the stock file data ? Or both ? Should I just attach them here ?
 

Bale

Minion
Oh. I've found the reason for the bug. It's really annoying. Unfortunately I don't have the time and concentration to fix it right now. I'm going to have to make it more complicated than I originally thought.

Hopefully I'll fix it later, but no promises since my computer is broken right now and I'm on a friend's computer. :(
 

AlbinoRhino

Active member
Oh. I've found the reason for the bug. It's really annoying. Unfortunately I don't have the time and concentration to fix it right now. I'm going to have to make it more complicated than I originally thought.

Hopefully I'll fix it later, but no promises since my computer is broken right now and I'm on a friend's computer. :(

No worries. I'm just glad to hear that it's actually a script problem and not something stupid that I am doing (which is usually the case). :) Hope you get your e-life back soon ! (I know how much it sucks to have no computer.)
 

Banana Lord

Member
Does the int that OCD returns include ALL the meat it makes/predicts it will make? Because if so I don't see a way to tell how much of that came from autoselling and using items and so avoid counting that amount twice when NCF works out how much someone's made in a day (currently I compare how much meat the character started with to how much it finished with).

Also, I'm not seeing a final readout ("Anticipated monetary gain from inventory cleansing...") from OCD when I run it. Have I missed a setting or is something else going on?

EDIT: OK, noticing some weirdness with OCD. I have been calling the script from daily farming script with ocd_control(false) (resulting in the final readout not being printed), but on calling it directly I see this in the GCLI:
Code:
> ocd inventory control.ash

Saving outfit: Backup
Outfit saved
Taking off everything...
Everything removed.
send to mallmulti Monkey Lord: 3 "DRINK ME" potion, 1 7-ball, 1 accidental cider, 1 bilge wine, 4 black & tan, 2 blue pixel potion, 1 boilermaker, 4 bottle of popskull, 1 bottle of vodka, 3 bowl of lucky charms, 192 BRICKO brick
Sale price for this line: 0

send to mallmulti Monkey Lord: 12 BRICKO eye brick, 7 coconut shell, 12 dry noodles, 2 especially salty dog, 2 extra-spicy bloody mary, 2 Knob Goblin lunchbox, 3 little paper umbrella, 2 Mick's IcyVapoHotness Inhaler, 15 prismatic wad, 5 scratch 'n' sniff apple sticker, 6 scratch 'n' sniff rock band sticker
Sale price for this line: 0

send to mallmulti Monkey Lord: 1 scratch 'n' sniff unicorn sticker, 2 scratch 'n' sniff UPC sticker, 4 scratch 'n' sniff wrestler sticker, 1 seal-clubbing club, 8 sugar shard, 6 tasty tart, 14 ten-leaf clover, 3 white lightning
Sale price for this line: 0

Transferring items to store (request 1 of 3)...
Items offered up for sale.
Transferring items to store (request 2 of 3)...
Items offered up for sale.
Transferring items to store (request 3 of 3)...
Items offered up for sale.
kBay "VIP Klaw Stuffies" 3 stuffed Baron von Ratsworth @ 1000, 2 stuffed key @ 2000, 2 stuffed Meat @ 1000, 3 stuffed mink @ 1000, 1 stuffed monocle @ 1000, 1 stuffed teddy butler @ 1000, 2 stuffed tin of caviar @ 1000, 7 stuffed treasure chest @ 2000
Minimum bid for this lot: 30,000

Minimum biding for all auctions = 30,000

Minimum biding for all auctions = 30,000
Putting on outfit: Backup
Equipment changed.
Anticipated monetary gain from inventory cleansing: 60,000 meat.
In other words it's printing the final readout, but it's trying to send stuff to my mall multi. On checking, it seems that instead of actually sending those items to my multi it put them in the mall at max mall price (I have automatic pricing selected, and those items are in my OCD database).
 
Last edited:

Bale

Minion
I've got PC problems, so there isn't a lot I can do right now to investigate, but I'll answer a few questions.

There is a setting for using your mall multi that is separate from the name of your mall multi. Please make sure that the checkbox to use the mall multi is checked. I am suspecting that I made an error that gives you incorrect feedback if you gave a mall multi name, but did not check the box to actually send it to that name.

There is a setting that controls if something is put into the mall at max price or min price. You probably have it set to use max price.

Finally, the return value is the final readout. That is actually printed in main. I did it that way as a guide to how you can call the function. Please look at main()!
 

Banana Lord

Member
Mall multi name entered, but checkbox unticked (I don't want to use my mall multi, it just makes my OCD happy to have the name stored there).

I do not have mall pricing set to max, it's on automatic.

Point taken, sorry, that question didn't really need asking.
 

Bale

Minion
OCD Inventory Control Updated!

Found and fixed both bugs. I'm pretty sure. Please test it and let me know.
 
Top