OCD Inventory control

what if for some reason you cant copy and paste, ive tried typing it in but it is saying to specify valid svn url. ive tried multiple times with out success. any advice?
 
Not a problem. I'm curious what you could be doing wrong, but I'm not going to worry about it since there is a way to install it directly from the GUI.

From the menu bar of the main mafia interface -> Scripts -> Script Menu -> Install Tab -> Chit -> right-click and select install.
 
From the menu bar of the main mafia interface -> Scripts -> Script Menu -> Install Tab -> Chit -> right-click and select install.
Wrong script. But same methods.

Scripts->Scripts Manager->Install Tab->OCD Inventory Control->Right click->Install script.
 
I was using OCD today and I found myself copy pasting or typing a lot of the item to do a mall search.
So I added a little bit of code to simply click a button and get me the information in the CLI, that way I don't check 1000 of prices when I start OCD relay but only those I have doubt about the price. Is there a way to check how many was sold in the last week?

I changed the code for void add_item. There isn't a lot of new lines of code but I didn't keep track of the original line numbers so I copy/pasted the entire function here.

it can also be integrated with PriceAdvisor.ash if anyone is interested.
Code:
void add_items() {
	page.append("<fieldset><legend>Add Actions for these Items</legend>"); // write_box()

	int AddQ;
	foreach key in OCDefault
		if(!(OCD contains key) && item_amount(key) > 0) AddQ += 1; #{AddQ += 1; print(key);}
	int curr_items = curr_items();
	if(curr_items > 0 && AddQ > 0) {
		page.append("<p>");
		if(write_button("defaultdata", "Add default")) {
			foreach key in OCDefault
				if(!(OCD contains key) && item_amount(key) > 0) OCD[key] = OCDefault[key];
			save_ocd();
			curr_items = curr_items();
		}
		page.append(" Add default information for "+AddQ+" common item"+(AddQ == 1? " that is": "s that are")+" listed below.</p>");
	}

	boolean table_started = false;
	int CtrAdvisor= 1;
	foreach doodad in get_inventory()
		// Quest items are the only items that cannot be displayed, so check for is_OCDable()
		if(is_OCDable(doodad) && !(OCD contains doodad && OCD[doodad].action != "UNKN")) {
			if(!table_started) {
				page.append("<table border=0 cellpadding=1><tr><td>");
				write_button("mall", "Mall All");
				page.append("</td><td>Categorize all mallable items to be sold in the mall</td></tr><tr><td>");
				write_button("closet", "Closet All");
				page.append("</td><td>Categorize all uncategorized items to be stored in your closet</td></tr><tr><td>");
				write_button("keep", "Keep All");
				page.append("</td><td>Categorize all uncategorized items to be kept</td></tr></table>");
				
				page.append("<table border=0 cellpadding=1>");
				page.append("<tr><th colspan=2>Item</th><th>Have</th>");
				if(count(stock) > 0 && vars["BaleOCD_Stock"].to_int() > 0)
					page.append("<th>Stock</th>");
				page.append("<th>Advisor</th><th>Keep</th><th>Action</th><th>... information</th></tr>");
				table_started = true;
			}
			page.append("<tr valign=center class='item'");
			if(count(stock) > 0 && vars["BaleOCD_Stock"].to_int() > 0 
			  && stock contains doodad && stock[doodad].q >= item_amount(doodad))
				page.append(" style='background-color:E3E3E3'");
			page.append("><td>"+imagedesc(doodad)+"</a></td>");
			int q = 0;
			string act = "UNKN";
			string info = "";
			if(OCD contains doodad) {
				q = OCD[doodad].q;
				act = OCD[doodad].action;
				info = OCD[doodad].info;
			}
			page.append("<td align=center>"+item_amount(doodad)+"</td><td align=center>");
			if(count(stock) > 0 && vars["BaleOCD_Stock"].to_int() > 0) {
				if(stock contains doodad) page.append(stock[doodad].q);
				else page.append("0");
				page.append("</td><td align=center>");
			}
			if(write_button("Advisor"+CtrAdvisor, "Advisor")){
			print (doodad+" sells for "+mall_price(doodad)+" meat in the mall", "blue");
			print ("********");
			}
			ctradvisor +=1;
			page.append("</td><td>");
			OCD[doodad].q = write_field(q, "q_"+to_int(doodad));
			page.append("</td><td>");
			OCD[doodad].action = action_drop(act, doodad);
			page.append("</td><td>");
			OCD[doodad].info = write_field(info, "i_"+to_int(doodad), 14);
			page.append("</td></tr>");
		}
	if(table_started)
		page.append("</table>");
	else
		page.append("<p style='text-align:center; font-size:110%; font-weight:bold; color:#0000BB;'>Your entire inventory has already been categorized.<br />Nothing to see here, please move along.</p>");

	page.append("</fieldset>"); 	// finish_box()
}
 
Last edited:
Is there a way to check how many was sold in the last week?

CFStat will check (and maintain) a local cache for sales volume pulled from Coldfront.

I went for a cache because with multiple characters Coldfront was getting hammered and to be realistic, the volume data is not that volatile, at least for items that make sense to manage with scripts.
 
Not sure how to fix the issue I have. I've come across some type of error where the script it kinda derpy. I've deleted all of my folders for mafia and reinstalled it but to no avail it still doesn't work properly. Say I goto "items to stock" add the default list then click save. It won't save it for some reason. Not sure where I've went wrong thanks in advance.
 
Not sure how to fix the issue I have. I've come across some type of error where the script it kinda derpy. I've deleted all of my folders for mafia and reinstalled it but to no avail it still doesn't work properly. Say I goto "items to stock" add the default list then click save. It won't save it for some reason. Not sure where I've went wrong thanks in advance.

"derpy"? Really? Gonna be kind of hard to fix, isn't it?

Now that I have beaten back my inner snark, you really need to give us more information. The best reports include what, in a reasonable (as defined by the people trying to help) amount of detail did you do?, what happened? and what did you expect to happen instead? For starters there is no "add default list" command on the "Items To Stock" tab so it is not clear what you did, let alone what you were expecting.

We'd love to help but you need to give us something to work with :-)
 
There is a button called "new" in the items to stock tab. Which creates a softcore pull list, one day it was working fine, then It randomly disappeared. First I tried to add it back clicking then then saving all changes, after clicking saving all changes the new list generated doesn't appear after clicking save all changes. I tried readding it manually with copy paste, which works but the script doesn't seem to acknowledge that the stock list exists. If there is anyway I can provide better information please tell me how.
 
If on Windows, put your mafia folder on your desktop and see if you still have the same problem.
If on a Mac or other *nix... not sure. Will probably involve chmodding something, but no clue which part is wrong currently.
 
I believe that the files can have full permission while sitting in a folder that does not have write permission. Files are derpy that way.
 
I've made sure every folder has all permissions. I've deleted my kol mafia folder as well and started from scratch. It may be an issue with my computer but thanks for the suggestions.
 
Last edited:
I've reformatted my pc. Reput the folder on the desktop and double checked that all files/folders have read/write permissions. Still having issues with saving changes. I more or less cannot get the stock list to save or function even if I've manaully added items to the data file. If there is any way to log this and show it to you or for me to read it myself if it would help I would like to try that.
 
I was using OCD today and I found myself copy pasting or typing a lot of the item to do a mall search.
So I added a little bit of code to simply click a button and get me the information in the CLI, that way I don't check 1000 of prices when I start OCD relay but only those I have doubt about the price. Is there a way to check how many was sold in the last week?

I changed the code for void add_item. There isn't a lot of new lines of code but I didn't keep track of the original line numbers so I copy/pasted the entire function here.

it can also be integrated with PriceAdvisor.ash if anyone is interested.

After several months of consideration, I'm adding a new column to the OCD relay manager showing the current low price point in the mall which OCD will use if it malls an item. As always I welcome comments, especially if they differ from my own.

This is based on Grabuge's patch, so thanks Grabuge.
 
I currently don't allow OCD to run in hardcore because it raises the level of complication and I figure that people won't like their stuff to be disposed of before breaking the prism.

You're asking for a special dispensation to mall stuff from Hangks. I get where you are coming from, but I don't know if my script should check your closet and inventory for quantity if you don't want to sell all of an item and there are other issues as well, such as making sure that I don't mall any of the item that are in your inventory.

Also, a small technical note: I'm not sure that KoLmafia has the facility to sell stuff out of Hangk's storage. Could someone else tell me how that would work? Would I have to use a visit_url() call?
 
Back
Top