OCD Inventory control

@Lxndr: A convenient possibility might be a CLI alias which loads your data file and tells you what OCD is configured to do for a given item. Something like "ocdfor %%", where %% would be the name of an item. I believe the data file format has changed since the last time I picked through this script, but Bale or someone else more familiar with it could probably complete the missing pieces here:

Code:
alias ocdfor => ashq item it = to_item(%%); if (it == $item[none]) abort(%%+" is not an item."); <mapformat> ocdmap; file_to_map(<ocdfilename>, ocdmap); print("OCD's configuration for "+it+": "+<mapfields>)
 
This is what I've come up with based on Zarqon's suggestion.

Code:
alias ocdfor => ashq import <zlib.ash>; record OCDinfo {string action; int q; string info; string message; }; item it = to_item("%%"); if (it == $item[none]) abort("%%"+" is not an item."); OCDinfo [item] ocdmap; file_to_map("OCDdata_"+vars["BaleOCD_DataFile"]+".txt", ocdmap); print("OCD action for " + it + " is " + OCDmap[it].action);

You call it by typing ocdfor ITEMNAME in the gCLI. It only tells you what action OCD is set to do with an item but that will at least tell you which tab to find it on.

Example:
> ocdfor bubblin' crude

OCD action for bubblin' crude is MAKE

This tells me that ocd will try to make something with my bubblin' crude. So to find it, I'd go to the crafting tab in the OCD DB manager.
 
Last edited:
You could also add the other fields of the record to the print statement to get the full info, so if it's already configured the way you want it, you don't even need to run the relay script.
 
You could also add the other fields of the record to the print statement to get the full info, so if it's already configured the way you want it, you don't even need to run the relay script.

Code:
alias ocdfor => ashq import <zlib.ash>; record OCDinfo {string action; int q; string info; string message; }; item it = to_item("%%"); if (it == $item[none]) abort("%%"+" is not an item."); OCDinfo [item] ocdmap; file_to_map("OCDdata_"+vars["BaleOCD_DataFile"]+".txt", ocdmap); print("OCD action for " + it + " is: Keep " + OCDmap[it].q + ", Action " + OCDmap[it].action + ", To " + OCDmap[it].info);

Example output:
> ocdfor bubblin' crude

OCD action for bubblin' crude is: Keep 0, Action MAKE, To oil cap

The actual output could probably be better but I tried. This should at least give Lxndr an idea of what OCD plans to do with a particular item.
 
Since the demons of IT have conspired to place Microsoft Excel on every computer I happen to use for KoL I have found that loading the OCDdata file in Excel is a much better solution than any interface I could ask Bale to implement.
 
Shouldn't the relay script include "case $item[floaty sand]:" with the other exceptions in the is_pulverizable function since floaty sand can be malused to floaty pebbles? Also, same question for the is_wadable function in the script.
 
Looks like the right fix at this point is actually removing the other floaty items. Since they're now found in the pulverize.txt data file, so should return count() > 0 now...
 
Theraze, the items in pulverize.txt can be pulverized, but RazorSoup is talking about items that can be malused. I believe that he has the right of it. I cannot imagine why floaty sand isn't listed there.

svn update
 
I did notice that your is_pulverizable function is exactly the same as the example on the wiki page for get_related (pretty sure you are the one who added it). So, does the wiki page example need floaty sand added or does it need some other change (if any)?
 
I'm not sure if something is going weird with Mafia or this script.
But the past few days, when I try to manage my inventory in the relay browser, it pops up items that are not in my inventory as needing categorization. Most of these items are items that I've never had (pixel shield), some are items that I may have had long ago (meat from yesterday).

However, if I go into Mafia and refresh my item manager, it goes back to "normal."


EDIT: Apparently it is something going weird with Mafia - there's a known bug with the Manuel's horizontal display and item numbers?
 
Last edited:
One question and one proposal. Oh, and couple of notes afterward.

Question:

There are different behaviors of script in different places when I am set some items to keep and other to closet/mall/display. Let me demonstrate.

I have 500 Warm Subject Gift Certificates. Set 100 to keep.

Set Manager to closeting Certificates. Works as expected. 400 goes into closet, 100 remains in hands.

After that I have 400 Certificates in Closet and 100 in hands. And everything works not so bright.

- Running the same script again will place remaining items to closet too.
- Set Manager to place items into Mall or Display will place all this 100 Certificates to appropriate place too.

So conclusion: except closeting, script always takes into account closet items as equivalent of keep ones. Is it right? It really must work that way?

Proposal:
Can you, please, add to Manager field "Put X amount"? Specifically, I could appreciate it in Mall tab. I managed to kill my sales too often when placed too much amount of set item on sale. Now I am using closet to remove excessive items (manually), but having automatic way to do that would be much nicer... :)

Notices:
When testing different tabs, I noticed two strange things.

1. I have 450 as Minimum Sale Price for Warm Subjects. Neverless it goes for 99...999 to Mall. Is it right? What is purpose of this field then?

2. When I am changing action for item (i.e. Closet to Mall, 100 to keep for 99 to keep) and pressing save, my changes are saved. But item seems remains in the same tab (i.e. I still see it on Closet tab with action "Mall sale" and 99 to keep). But if I am trying to edit it again, and pressing "Save", item disappears from "wrong" tab and all last editions lost (i.e. if I am changing this 99 back to 100 and Mall to Closet, pressing "Save" will result only in item vanish from Closet. It will be on Mall tab with same 99.) So it seems, even if I see item in wrong tab, it's not actually here and cannot be edited.
 
So conclusion: except closeting, script always takes into account closet items as equivalent of keep ones. Is it right? It really must work that way?

That sounds like a bug. I'll check it out when I can.


Proposal:
Can you, please, add to Manager field "Put X amount"? Specifically, I could appreciate it in Mall tab. I managed to kill my sales too often when placed too much amount of set item on sale. Now I am using closet to remove excessive items (manually), but having automatic way to do that would be much nicer... :)

Not sure I understand. Are you asking to put X into the mall, and only refill the mall when you have less than X items currently there? I'm not likely to do that since A) It would be troublesome and B) I cannot see how that would kill your sales.


I have 450 as Minimum Sale Price for Warm Subjects. Neverless it goes for 99...999 to Mall. Is it right? What is purpose of this field then?

I've used that successfully, so I am surprised to hear that it isn't working. It should set a minimum price for selling. So, if current mall price is 99 meat, it will sell for 450 each. However if current mall price is 700 it will sell for 700 meat each. That's what it should do. I don't have time to test this right now.


When I am changing action for item (i.e. Closet to Mall, 100 to keep for 99 to keep) and pressing save, my changes are saved. But item seems remains in the same tab (i.e. I still see it on Closet tab with action "Mall sale" and 99 to keep). But if I am trying to edit it again, and pressing "Save", item disappears from "wrong" tab and all last editions lost (i.e. if I am changing this 99 back to 100 and Mall to Closet, pressing "Save" will result only in item vanish from Closet. It will be on Mall tab with same 99.) So it seems, even if I see item in wrong tab, it's not actually here and cannot be edited.

Known issue, but I'm not sure how to change that behavior. It's a lot trickier than you'd think.
 
Not sure I understand. Are you asking to put X into the mall, and only refill the mall when you have less than X items currently there? I'm not likely to do that since A) It would be troublesome and B) I cannot see how that would kill your sales.

Having a small number stocked can look like a good deal. Having a huge number stocked looks like a price reduction in the mall that needs to be undercut.
 
That sounds like a bug. I'll check it out when I can.
Thank you! :)

Not sure I understand. Are you asking to put X into the mall, and only refill the mall when you have less than X items currently there?
Umm... Well, it would be the best for me. If it is possible.

I'm not likely to do that since A) It would be troublesome
Umm... Well, lesser solution could be "place X items on mall". Without checking. Oh, well, now I see too that it is not very good solution. :( Ok, but keep this in mind, please? I don't think that it worth extensive work, but if, by chance, it could be done quite easy...

and B) I cannot see how that would kill your sales.
Well, my two year practice shows me that if I am placing 10 items for 5k each (given that it's lowest price, of course), I have chance to sell 5-10 of it tomorrow. But if I am placing 100 items for 5k, tomorrow I will sell nothing, and there will be at least five cheaper offers. That's how KoL mall works for me.

I've used that successfully, so I am surprised to hear that it isn't working. It should set a minimum price for selling. So, if current mall price is 99 meat, it will sell for 450 each. However if current mall price is 700 it will sell for 700 meat each. That's what it should do. I don't have time to test this right now.

Thank you. I will wait for results! :)

Known issue, but I'm not sure how to change that behavior. It's a lot trickier than you'd think.

Well, "simple" solution on my side is saving twice. On second save everything fixes itself. Actually, I think, simple refresh of page fixes problem too. Can it be somehow reproduced from inside script?
 
Last edited:
Well, my two year practice shows me that if I am placing 10 items for 5k each (given that it's lowest price, of course), I have chance to sell 5-10 of it tomorrow. But if I am placing 100 items for 5k, tomorrow I will sell nothing, and there will be at least five cheaper offers. That's how KoL mall works for me.

After hearing testimony from both you and lost on the subject I agree this seems to be a lack in my script. I'll think about how this should be resolved.

I probably won't get around to those issues until the weekend is over, but I'll attend them when I can.


Well, "simple" solution on my side is saving twice. On second save everything fixes itself. Actually, I think, simple refresh of page fixes problem too. Can it be somehow reproduced from inside script?

I have no idea how to get the script to do that. As I said, it's a lot trickier than you'd think. Really. Perhaps someone reading this will give a tip though.
 
After hearing testimony from both you and lost on the subject I agree this seems to be a lack in my script. I'll think about how this should be resolved.

I probably won't get around to those issues until the weekend is over, but I'll attend them when I can.
Thank you again! :D
 
Back
Top