OCD Inventory control

ereinion

Member
I just ran this script and noticed something odd:
Code:
You gain 17,931 Meat
Items sold.
[COLOR=blue]display 1 pig-iron bracers[/COLOR]

Updating display case...
Placing items in display case...

[B]snailmail bits (1): Craft into stuff[/B]
autoSatisfyWithCloset => true

[COLOR=green]Anticipated monetary gain from inventory cleansing: 331 420 meat.[/COLOR]
Requests complete.

[COLOR=olive]> inv pig iron[/COLOR]

[COLOR=olive]> ocdfor pig iron[/COLOR]

[COLOR=red]pig iron is not an item.[/COLOR]

[COLOR=olive]> ocdfor pig iron bra[/COLOR]

OCD action for pig-iron bracers is: Keep 1, Action DISP, To

[COLOR=olive]> refresh inv[/COLOR]

Updating inventory...
Requests complete.

[COLOR=olive]> ocdfor pig iron bra[/COLOR]

OCD action for pig-iron bracers is: Keep 1, Action DISP, To

[COLOR=olive]> inv pig iron bra[/COLOR]

[COLOR=olive]> display take 1 pig iron bra[/COLOR]

Removing items from display case...
You acquire pig-iron bracers

[COLOR=olive]> call scripts\OCD Inventory Control.ash[/COLOR]

autoSatisfyWithCloset => false
[COLOR=blue]use 1 festive warbear bank[/COLOR]

(usable quantity of festive warbear bank is limited to 0 by daily limit)
[COLOR=blue]display 1 pig-iron bracers[/COLOR]

Placing items in display case...

[B]snailmail bits (1): Craft into stuff[/B]
autoSatisfyWithCloset => true

[COLOR=olive]Nothing to do. I foresee no additional meat in your future.[/COLOR]
Requests complete.
As you can see the script puts the pig-iron bracers into my display case even though the data-file says to keep one in my inventory. I checked in the relay-script and in the data file as well, and they both say the same as the alias. Any idea what is going on?
 

ereinion

Member
The line from the datafile is:
Code:
pig-iron bracers    DISP    1

And just in case anyone is curious, the alias is
Code:
[B]ocdfor [/B]=> 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);
 

Bale

Minion
I really love that alias. It has been added to my mafia. I only made a few tweaks. My changes are to suppress the last field if it isn't there and to keep from throwing an unnecessary error state on a bad item. And just because I like to make things more complicated. Here's my version:

Code:
alias ocdfor => ashq item it = to_item("%%"); if (it == $item[none]) print("%%"+" is not an item.", "red"); else {string[string] vars; file_to_map("vars_"+replace_string(my_name()," ","_")+".txt",vars); record {string action; int q; string info; string message; } [item] OCD; file_to_map("OCDdata_"+vars["BaleOCD_DataFile"]+".txt", OCD); print("OCD action for " + it + " is: Keep " + OCD[it].q + ", Action " + OCD[it].action + (length(OCD[it].info) > 0? ", To " + OCD[it].info: ""));}


To get back to the original problem, I'm a little puzzled. Please tell me if you have any pig-iron bracers in your closet. I suppose it is safe to assume you don't have any in your clan stash.
 
Last edited:

ereinion

Member
Wow, it turns out it's just I who has been dumb, turns out that forgetting the hyphen is interpreted differently by mafia's inv-command and the to_item ash-function:

Code:
[COLOR=olive]> ashq print(item_amount(to_item("pig iron bra")))[/COLOR]

2

[COLOR=olive]> inv pig iron bra[/COLOR]

[COLOR=olive]> /count pig-iron bra[/COLOR]

[COLOR=green]You have 2 pairs of pig-iron bracers.[/COLOR]

[COLOR=olive]> inv pig-iron bra[/COLOR]

pig-iron bracers (2)
Sorry for the bother :p
 

Bale

Minion
Oh! I am very glad it is working.

I am not at all sorry you made the erroneous bug report because I did get a very helpful alias out of it. Thank you.
 

Fluxxdog

Active member
Request for crafting:
For potions that can be made that get triples from Saucerors, can we have an option to not make them if not a Sauceror?

Reason: I generally save ingredients for potions, like the gr8ps, that I come across. However, whenever I finish my run and I'm a sauceror, that's when I'd like to make them. Because of the number of ingredients, I'd have to change each item from Keep to Craft in OCD and that is a whole lot of work.

If it helps, I made a list of which potions are tripled:
Code:
boolean[item]triple_sauces=$items[philter of phorce,Frogade,potion of potency,oil of stability,ointment of the occult,
salamander slurry,cordial of concentration,oil of expertise,serum of sarcasm,eyedrops of newt,eyedrops of the ermine,
oil of slipperiness,tomato juice of powerful power,banana smoothie,perfume of prejudice,libation of liveliness,
milk of magnesium,papotion of papower,decaying goldfish liver,oil of oiliness,cranberry cordial,Ferrigno's Elixir of Power,
potent potion of potency,plum lozenge,Hawking's Elixir of Brilliance,concentrated cordial of concentration,pear lozenge,
Connery's Elixir of Audacity,eyedrops of the ocelot,peach lozenge,cologne of contempt,potion of temporary gr8tness,
blackberry polite,lotion of hotness,lotion of coldness,lotion of stench,lotion of spookiness,lotion of sleaziness];
 

Veracity

Developer
Staff member
Since KoLmafia has that information internally via the SX3 flag, it would be better for it to simply expose that info via a proxy field on the item.
 

heeheehee

Developer
Staff member
I'm going to point out that currently mallprices are such that if you were to just sell your reagents and ingredients at mall value and simply buy from the mall, you'd make a net profit. Blame the warbear chemistry lab :p

But yeah, I would find exposing SX3 to be useful, since my two options at the moment are either to maintain manual lists or read in concoctions.txt.
 

heeheehee

Developer
Staff member
Not really, then the price of sauce potions just rises to reflect the price of ingredients, minus ~7% for SX3 with chem lab. That is what my bot does, so you can be sure that you won't ever pay more than that :p
 

popcap280

New member
I get an error When i try to run the script:
Function 'to_bounty( string )' undefined. This script may require a more recent version of KoLmafia and/or its supporting scripts. (zlib.ash, line 79)

Please help
 

Crowther

Active member
I get an error When i try to run the script:
Function 'to_bounty( string )' undefined. This script may require a more recent version of KoLmafia and/or its supporting scripts. (zlib.ash, line 79)

Please help
The error message say you need a more recent version of KoLmafia. Are you asking how to get a more recent version?
 
Top