OCD Inventory control

Updated script above

I will try to keep it updated every couple days. I will leave it here until all beta testing is complete and I can release a solid version. Any feedback will be helpful.

Originally I was just going to build onto Bale's script.
This script has grown much larger than I set out to do but I cannot stop now.
 
AutoMall

Hey
I looked up the cli command list today and found something interesting.

automall - dump all profitable, non-memento items into the Mall.

So will issuing the command:
cli_execute("automall");
cli_execute("reprice");
Does anyone know if this can be a direct replacement to the last section of Bale's OCD inventory control?

I am in no position to test this, I will add it to my script at the end on the next beta release with a user confirm option.
 
The reprice command will price everything in your mall store that is at max price to at or slightly below the lowest price in the mall. This will often run you afowl of limit stores in the mall. IIRC, Bale's script uses commands that price based on the 5th store in the mall, drastically reducing the likelihood that you'll (for instance) sell all your dry noodles or reagents at 100 (to a mallbot).
 
So if I leave that out what exactly does AutoMall do?
Will it just dump everything to mall and price them at max price?
 
automall will put everything into the mall, except for memento objects. All of them, so you cannot define a specific number to keep. And it will keep the entire stock of everything that is a memento. Basically it is all or nothing, quite unlike the precise control that this allows.

And StormCrow42 is exactly correct about the perils of reprice. I've never used that since I found myself selling a few hundred reagents at 100 meat once. I glanced at my store log right after repricing and found that they were already snatched up by a purchaser (probably a mallbot) in about 5 seconds. A couple of other things were sold horrendously cheap also, but that was the most blatant so it is the one that sticks in my mind. This was back in the days when hi meins were the best food and reagents easily sold for 2000 each.
 
I understand
Your script subroutine works great so I will just implement that on the last day of a hardcore run.
Thanks
 
My OCD Inventory Control has gone through a few revisions since I posted it. Meanwhile it's gone out of date if only because item numbers now exceed 4000. The current version is leaner, more featured and most importantly it now reads inventory handling instructions from a mapfile. That makes it notably faster.

I've got a OCD Data Creator script that I used to convert the maps from the original script. If you want, you can just delete my data from the OCD Data Creator, copy/paste in your own data from your version of the old OCD script. Then when you run the OCD Data Creator, it will create a mapfile that will be read by the new version of OCD Inventory Control.

Once your "OCD Data.txt" you can run OCD Inventory Control at any time to clear out your inventory.

New Features:
- Provides a gift granting function to automatically give collectible items to various people. (disabled by default)
- Has support for pulverization.
- Separation of program and data makes it a lot easier to peruse.
 
Last edited:
other stuff similar to gift certificates that can be 'used' , yanked straight out of my own cleanup script

Code:
void use_stuff()
{
	useitem($item[Warm Subject Gift Certificate], 0);
	useitem($item[Evil Golden Arches],0);
	useitem($item[Penultimate Fantasy Chest], 0);
	useitem($item[pile of candy], 0);
	useitem($item[black picnic basket],0);
	useitem($item[old leather wallet], 0);
	useitem($item[old coin purse], 0);
	useitem($item[Gnollish toolbox], 0);
	useitem($item[Knob Goblin lunchbox],0);
	useitem($item[Hippy Army MPE], 0);
	useitem($item[Frat Army FGF], 0);
	useitem($item[pack of KWE trading card], 0);
	useitem($item[canopic jar], 0);
	useitem($item[ice-cold six-pack], 0);
	useitem($item[Orcish meat locker],0);
	useitem($item[pork elf goodies sack], 0);
	useitem($item[six pack of Mountain Stream],0);
	useitem($item[scroll of pasta summoning], 0);
	useitem($item[frozen Mob Penguin], 0);
	useitem($item[pack of chewing gum], 0);
	useitem($item[large box], 0);
	useitem($item[small box],0);
	useitem($item[ancient vinyl coin purse], 0);
	useitem($item[black pension check], 0);
	useitem($item[fruit basket], 0);
	useitem($item[fruit bowl], 0);
	useitem($item[briefcase], 0);

	// Change outfit to use drinks tickets
	// get round to this later :P
	//useitem($item[roll of drink tickets], 0);

	// Crimbo 08 crates
	//useitem($item[battered Crimbo Crate], 0);
	//useitem($item[dusty Crimbo crate], 0);
	//useitem($item[sturdy Crimbo crate], 0);

	// Crimbo doll hives / doll houses
	//useitem($item[Dollhive], 0);
	//useitem($item[Doll house], 0);
}
 
Is there any way to get the new version of the script without overwriting our old changes? I went through my entire inventory to make sure it kept what I wanted kept, I'd rather not do that again.
 
Do IOTM's have a flag in Mafia or anything like that?

IE: Would it be possible to have an option to never sell them, even when newer ones were implemented?
 
As far as I know, there is no such flag that mafia can be aware of. New IotM have to be added to the list or else this will eagerly pop them in your store at minimal price. The script is not just named OCD, it requires OCD to use it properly. ;)
 
Updated OCD Inventory Control

Now it takes advantage of mall pricelist sharing to reduce runtime. This is very helpful because clearing out an entire run's inventory can take like 5-10 minutes of checking prices in the mall. Now it is much faster since many of the necessary prices won't need to be checked during run time.

Oh, and I fixed a meaningless bug which kept it from properly reporting autosale price. No biggie.
 
Last edited:
Cheers (again) for another great script (possibly, havent try it yet).

I have 3 question linked to hit, if you dont mind:

1)When you use "visit_url("storage.php?action=takeall&pwd");" to empty the storage, could I use something simillar (visit_url("clanstash.php?action=takeall&pwd");) to empty my clan stash?

2)I looked at the code to see where it says you were pricing the object at the 5th value in Mall; couldnt find it. But my real question is: what(and where) piece of code would you add to: If 5th place== minimum_Mall_Value THEN AUTO_Sell. Since I dont spend any money on advertisement, I auto-sell everything that 'sells' for the minimum Mall-price (except Pixels in fact..)

3)In data creator, what does "save [$item[agua de vida]] = Y" actually do?

*edit*
4)What happens when the script encounter an item not specified in Data_Cretator? Leave it? Sell it? Mall it?
*/edit*

I would like to thank you again and Zarchon and everyone out there coding for Mafia, for the time you are putting in that! I learned VB a few years back and I'm having a hard time understanding your codes, but hopefully some day I will


Keep up the good work
 
Last edited:
1) That would only work if KoL supported the command. It's done by KoL, not KolMafia.

2) mall_price() and historical_price() return the 5th purchasable item. To answer your question, check to see if historical_price() == autosell_price(), then autosell it.

3) It will put information into a data file that the inventory control script accesses. That information says to save Y quantity of agua da vida and put any additional such items into the mall.

4) Everything that isn't listed in Data_Creator is sold, if it can possibly be put in the mall. :D I'm very glad you asked if that wasn't clear to you. This script is designed to make inventory vanish into the mall.
 
Shouldn't you check for historical_price() == 2*autosell_price()? I believe mall minimum is 2x autosell.
 
Hi! Great script.

I was wondering how can I change the script so that it will not sell items that are not in the list.

Thanks,
 
Back
Top