OCD Inventory control

Theraze

Active member
Yes, on protecting your files. Two different ways.
One, copy the files off to somewhere else after you finish. If you're not very OCD and you only want to manage 200 items and only those 200 items, keeping the static backup should protect you.
Two, use a versioning system. Microsoft has VSC in newer versions of Windows, Dropbox has versions, etc. When you mess up your stuff, revert it back to a version you like.

Yes, on disabling the button. That's one of the beauties of SVN... break your own version to not have the data button anymore, make sure it's both in the relay and svn's relay folders, and you should always have that button broken. Until Bale moves it around in the script, but... safe until then.
 

deusnoctum

New member
Yes, on disabling the button. That's one of the beauties of SVN... break your own version to not have the data button anymore, make sure it's both in the relay and svn's relay folders, and you should always have that button broken. Until Bale moves it around in the script, but... safe until then.

More that I'm so OCD that I wanted to make sure I knew what was happening with each item--I only ever got as far as 100 before I'd bork it with the button.

I didn't realize SVN would make updates line-by-line, so I thought the first change anywhere in the file would blow my changes away. Thanks for that bit, I'm sure it will be quite useful elsewhere.

If anyone else has the same issue, removing lines 814 and 815 seems to have done the trick (the "foreach" loop and its guts). Thanks for your help!
 

Winterbay

Active member
1) DO changes in the /svn-folde rof OCD
2) Open Mafia
3) RUn "svn sync" and your changes will migrate over to the "live" script
4) WIth the next update your changes will be merged with the new edits unless a conflict is detected in which case ity will tell you to resolve it yourself.
 

Bale

Minion
Is there a way to disable the "add data" button or revert the changes it makes? Three times now I've clicked it without thinking and had a ton of changes made to my database, which requires a reinstall. If there's some workaround, I'd be interested in that possibility also. Thanks!

I hope by "reinstall" you mean that you deleted the data file, not the entire program. Other people have already given some good advice, but I'll drop my own 2 cents.

  • The simplest method would be to keep a backup copy of your settings as Theraze suggests.

  • The next simplest solution of salving your problem would be to use dropbox. That has the added benefit of allowing you to use the same KoLmafia settings when you switch computers. (Just make your base KoLmafia folder inside of the dropbox folder and run it from there.) The feature I am suggesting it for is that it keeps track of all changes to files. You can use it to roll back any file to an earlier version. Then if you make the error again you could just restore the previous version of the file.

  • Another solution is to categorize every item. That way there won't be a button to "Add default information". Even if you only mark all the items as "KEEP" you will be protected.

  • Finally, you could disable the button permanently with a little bit of script editing. Since this script is on SVN, if you do it properly, the script will keep your changes even when it updates. I see that Winterbay has already given you instructions on how to do this, but I have written a more detailed explanation HERE.
 
Last edited:

Tarko

Member
I was having this trouble as well. After poking around, I discovered that the created data was being stored in OCDstock.txt, while my character's stock file is OCDstock_dameoshi.txt. Copying OCDstock.txt to OCDstock_dameoshi.txt gave the expected results. Most likely this is a problem that mainly occurs if you run more than one character in mafia since that causes the _character.txt suffix by default I think?


Aye, it worked for me too, thanks a lot for finding the issue!

Bale, is there a chance this fix will be implemented in the next version?
 

Bale

Minion
Two things... First of all I don't understand the cause of his problem.

Second, I think that stocking of purchasable goods is probably a thing of the past now that you can buy stuff from the mall during ronin and immediately pull those purchases from Hangks. I think the problem doesn't even matter anymore.
 

halfvoid

Member
Unexpected error, debug log printed.
Script execution aborted (null): (OCD Inventory Control.ash, line 780)

Debug log attached.

Has been occurring the last 3 days I've run OCD. Shows up after the waiting to Kbay messages and the Autosatisfywithcloset message.
 

Attachments

  • DEBUG_20130915.txt
    7 KB · Views: 41

Veracity

Developer
Staff member
Try revision 12630. This should throw a useful ASH runtime exception when a script attempts to remove the non-current element of a map within a foreach, rather than waiting for the ConcurrentModificationException to show up later.
 

bumcheekcity

Active member
Bale, could you add some sort of tabs to the manager to split items up into categories?

For example food, booze, spleen, various equipment types (hat, pants, ...), combat items, and other things? It'd probably help people running it for the first time who have thousands of items get over the initial shock, and also help it load a little more quickly.
 

Tarko

Member
Two things... First of all I don't understand the cause of his problem.

Second, I think that stocking of purchasable goods is probably a thing of the past now that you can buy stuff from the mall during ronin and immediately pull those purchases from Hangks. I think the problem doesn't even matter anymore.

Fair enough, the stocking part is now a moot point.

The OCD part of the inventory-control is still fubar though.

The issue is that the name of file under which the intended behavior is saved and the one the script looks for is different.

ex:
1.a)Running the script, the behavior file will be saved under OCDstock.txt
1.b)an empty file will be created under the name of OCDstock_tarko.txt
2)After running the script, it will look for the file named OCDstock_tarko.txt

Since it is empty, nothing happens and the message "Empty file" is shown.

Note that this behavior still happens even after I remove my name is the setup tab (4th I believe)

The current workaround is to the open OCDstock.txt copy it's content and paste it into OCDstock_tarko.txt
Not a big deal.
 

Bale

Minion
I'll explain why I don't understand your problem. OCDstock.txt is not created by your efforts. It is a file of default values which the script will use if you tell it to. It isn't customized to your needs. If you don't see OCDstock_tarko.txt, that doesn't mean OCDstock is the correct file, it only means that OCDstock_tarko.txt was never created. Go to the stock part of the relay script and make sure that you have properly created the stock file. Make sure you hit the save button.


Bale, could you add some sort of tabs to the manager to split items up into categories?

For example food, booze, spleen, various equipment types (hat, pants, ...), combat items, and other things? It'd probably help people running it for the first time who have thousands of items get over the initial shock, and also help it load a little more quickly.

I don't hate your idea, but it would be a lot of work and I don't feel motivated to do it right now.
 

halfvoid

Member
Ran today with latest daily build of mafia and received this error at the end instead.

Removing non-current key within foreach (OCD Inventory Control.ash, line 327)
 

Veracity

Developer
Staff member
When you edit the database with the relay script, it shows the image of each item. Two comments:

Code:
string image(item doodad) {
	return "<a title = \"KoL Pop-Up\" href=\"javascript:descitem('" + doodad.descid
		+ "');\"><img src=\"http://images.kingdomofloathing.com/itemimages/" + doodad.image + "\" height=30 width=30></a>";
}
1) It should use doodad.smallimage, which I added specifically for your benefit, for the folders.
2) It goes to "http://images.kingdomofloathing.com/itemimages/". It COULD go to "/images/itemimages" and take advantage of KoLmafia's image caching. Normally, KoLmafia converts the first into the second, as appropriate, but it does not munge the results of relay scripts, so that doesn't happen. If you cared, you could look at relayUsesCachedImages to decide which to use, but there's no real harm - other than disk space - if you always use /images. Especially if I make it non-optional. :)
 

Bale

Minion
1) Did that to my local copy. I forgot I hadn't pushed the changes. Ooops!

2) Thank you. I'll fix that right now.
 

Winterbay

Active member
Question: I seem to have trouble getting Drink Me potions to stick in the database. They keep coming back as uncategorized. Is there anything I'm doing wrong or is it just a weird item?
 

Bale

Minion
I've had them in my db for ages, so I deleted them and re-added them to examine the problem. I failed to replicate the error. Please describe exactly what you do which doesn't get them to "stick" in the database.

Is there anything I'm doing wrong or is it just a weird item?

If you don't tell me what you're doing, how can I tell if it is wrong? Their line in my file looks like this:
Code:
"DRINK ME" potion	MALL	10
Please copy/paste the line from your OCDdata_Winterbay. Assuming that it does get briefly saved into your file before it un-sticks.
 
Last edited:

Winterbay

Active member
I had that exact line there and then when I reopened the file to add some more clusters it disappeared and the potions showed up in the manager again. I added them back with the "default" button and so far they stick. I'll get back to you if it happens again.
 

Bale

Minion
I reopened the file to add some more clusters

"reopened" implies a text editor. Is that right? Did you use a text editor to add the clusters? I did ask you to "describe exactly" what you did. You only responded with vague information, leaving me to guess between the lines.
 

Winterbay

Active member
Sorry. With reopened I meant that I reloaded the relay browser and started the relay-script. I had just before that went through the text file with notepad changing my incorrectly tagged "PULVERIZE" to "PULV" for the items I had changed myself after the default-button had set them to "MALL".
I see no way where editing the file by "search and replace" in Notepad should make the first line in the file go away...
 

Bale

Minion
Thank you. I just don't like unclear terms in bug reports. If you see your entry for "DRINK ME" potion go away again, please let me know what you just did.

I'll try to continue thinking about the issue. It must be something I do not do though since it has never happened to me.
 
Top