ManageStore and CFStat - Weed out your store

I have been using this to manage my store when i run it says it is autoselling the following but it does not autosell them:

bubblin crude
bugbear purification pill
candy cane
gingerbear bugbear
loadstone
pixel power cell
Wint-O Fresh Mint
 

fronobulax

Developer
I have been using this to manage my store when i run it says it is autoselling the following but it does not autosell them:

bubblin crude
bugbear purification pill
candy cane
gingerbear bugbear
loadstone
pixel power cell
Wint-O Fresh Mint

Hmmm. Let me check and either fix or explain. Thank you.
 

ereinion

Member
For bubblin' crude at least, I believe it has an autosell price, but can't be autosold. Could the same be the case for some of the other items too?
 

fronobulax

Developer
For bubblin' crude at least, I believe it has an autosell price, but can't be autosold. Could the same be the case for some of the other items too?

My initial assessment agrees. The script claims to be autoselling something that it cannot. I don't have time to fix and test now but if it cannot be autosold but is otherwise languishing in the store I am inclined to log it but otherwise leave it there. Stay tuned.
 

LordAo

New member
Anyone else experiencing this script analyzing the store, saying it's going to sell things, but then selling nothing at all? Am I missing some setting?
 

fronobulax

Developer
Anyone else experiencing this script analyzing the store, saying it's going to sell things, but then selling nothing at all? Am I missing some setting?

No.

Is SIM true, by any chance?

Do you actually have any items that meet the sell criteria? To be autosold an item has to be priced at the mall minimum and have a low sales volume.

The script claims to autosell things that can't actually be autosold. There is a list of them a few posts back, but that might also be a factor.

If you want, report the parameters you are using, the price and quantity of an item in your store that is not being autosold and I'll try and figure out in more detail why.
 

fronobulax

Developer
Could I request that the script still output a line even if it finds nothing to do?

Could you elaborate please? It always prints "ManageStore completed." from which you can infer that it did or did not do anything. It supposedly respects the zLib verbosity flag, so if you set that to 5 or 6, you might get the kind of feedback you are looking for.
 

Laserrobotics

New member
I guess I'd forgotten that it did output something, though what I should really have asked was if it could note that nothing was found if such is the case. I know the absence of items implies it found nothing, but it just feels incomplete if all it says is it's done? Maybe that's just me.
 

fronobulax

Developer
I guess I'd forgotten that it did output something, though what I should really have asked was if it could note that nothing was found if such is the case. I know the absence of items implies it found nothing, but it just feels incomplete if all it says is it's done? Maybe that's just me.

OK. I imagine changing the unconditional ending message to include a count (acted on x of the y item types in store) would be reasonable. On my list although that list has not gotten a lot of attention lately :)
 

Pazleysox

Member
I ran this today for the first time.

I have a few items in my store listed for min price (Spider web, Disco Ball, etc), I was hoping the script would take them all out, and autosell them. Here's my results

> call scripts\ManageStore.ash

Simulate: true
ColdFront volume factor: 2
Act on items that can't compete with NPC: true
Autosell identified items: true

spider web will be pulled and autosold.

ManageStore completed.
Requesting store inventory...
Store inventory request complete.

> call scripts\ManageStore.ash

Simulate: false
ColdFront volume factor: 1
Act on items that can't compete with NPC: true
Autosell identified items: true

Removing spider web from store...
681 spider web removed from your store.
Autoselling items to NPCs...
You gain 2,043 Meat
Items sold.

ManageStore completed.

I would love it if the script took everything and autosold it.
 

fronobulax

Developer
Thanks for running this.

If an item is at mall minimum but actually seems to be selling at that price the script will not sell it because you could be advertising or get lucky and might actually be the store that sells it.

The way that is calculated is it takes the quantity you have on hand, multiplies it by the Coldfront Volume factor and compares that to the sales volume reported by Coldfront. If the calculated value is more than the sales volume then it will pull and sell, provided that the Coldfront average price is the mall minimum.

So my first suggestion would be to try raising the volume factor. I usually use 5 arbitrarily, but if you want to empty your store of stuff at mall min 100 would probably do the trick.

The script uses zlib's verbosity so setting it to 6 might provide insight in case my memory is shot or there is an undiscovered bug.

You could also check the Coldfront data. The CFData.txt file has item number, date checked, average sale price and sales volume.
 

fronobulax

Developer
I updated CFStat. There is now a zlib variable to specific the timespan for Coldfront data.

CFStat_Coldfront_Timespan

//5 - last 12 hours
//1 - last 24 hours
//6 - last 48 hours
//2 - last 7 days
//7 - last 14 days
//3 - last 30 days
//4 - all history

Darzil expressed concerns about the average as displayed by Coldfront and graciously wrote and shared code to compute the average directly from the transaction data. Quick testing indicated that when the computed and extracted average were different the computed version was more interesting and potentially more useful.

Reading from the cache was disabled because the average price could potentially change every 30 minutes and changing the timespan can change the average.
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
I made a quick code change to do this

Code:
int pulverizePrice(item it) {
    int [item] remnants = get_related(it, "pulverize");
    int total = 0;
    foreach remnant, chance in remnants {
        int rprice = autosell_price(remnant);
        total += rprice * (chance/1000000);
    }

    return total;
}

void doAction(boolean sim, item it, int q, boolean autosell) {
   String out;

   int pulv = pulverizePrice(it);

   if (sim) {
      out = to_string(it) + " will be pulled and ";
      if (!autosell) {
         out = out + "NOT ";
      }
      if (pulv > autosell_price(it)) out = out + "pulverized.";
      else out = out + "autosold.";
   } else {
      boolean ok = take_shop(it);
      if (autosell) {
        if (pulv > autosell_price(it)) cli_execute("pulverize " + q + " " + it.name);
        else ok = autosell(q, it);
      }
   }
   if (sim) print(out);
}

So basically, if the sum of the autosell value of the expected remnants after smashing is greater than the autosell price itself, it pulverizes instead.

A better version of this would a) actually do the autoselling and b) determine if its worth putting the remnants back in the mall or autoselling them. But this is still (strictly?) better than the current version.
 

fronobulax

Developer
Thanks. I'll look at this.

Now you have me thinking - if I am going to autosell something, what are my more profitable options? Pulverize is one. Zap might be another.
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Yes, it would also be interesting to find something to do with items that don't sell but also can't be autosold or smashed (Senior Mints, for example)
 

fronobulax

Developer
Added pulverize. If the expected autosell value of the pulverization results is greater than the autosell value of the item to be autosold, the item will be pulverized. If character does not have the ability to pulverize, the item will be autosold. Note that pulverization results will be left in inventory. Detecting the results and autoselling them is more work than I want to do here and does not allow for the possibility that the player has some other purpose in mind. Running OCD Inventory Control is a much better way to deal with wads etc. :)
 
Top