How do I turn off CLI notifications to speed up script?

Bloody Knuckles

New member
Currently using this script to summon the most expensive Clip Art Item to sell:

Code:
void SummonMostExpensive()
{
    int remaining = 3 - get_property("tomeSummons").to_int();
    if (remaining == 0)
    {
        print("Ran out of tome summons");
        return;
    }
    int index = first;
    
    item best = $item[none];
    int price = 0;
    while (index < last + 1)
    {
        int mall = mall_price(index.to_item());
        if (mall > price)
        {
            price = mall;
            best = index.to_item();
        }
        index = index + 1;
    }


    cli_execute("create " + remaining + " " + best);
    cli_execute("mallsell " + remaining + " " + best);
}

Only problem is that mall_price() prints: "Searching for...." every item. And there are a lot of items. It's slowing down my script by a lot. Is there a way to turn off this option?
 

Darzil

Developer
It's the looking up the price, not the displaying the information, which is slowing it down.

You could (I think) use historical price, which might be less accurate, but would be faster.
 

Darzil

Developer
The following line submits a mall search to KoL and returns the 5th cheapest price (to avoid it being possible to natively create a (good) mallbot in mafia)

int mall = mall_price(index.to_item());

I think the way historical prices work is that when you exit KoLmafia it sends the results of all the mall searches you made to a third party site. When you enter KoLmafia it downloads this list. So if you replaced mall_price with historical_price it'd run much faster, but would not be as accurate, being the 5th cheapest price seen by the last person to search for that price in KoLmafia and then exit KoLmafia, at the time you entered KoLmafia. For prices that don't change much day to day it'd be absolutely fine, and a lot faster.
 

lostcalpolydude

Developer
Staff member
When you enter KoLmafia it downloads this list.

Only if you enable that setting (Preferences -> General -> Share recent Mall price data with other users), since it's disabled by default.

In my version of this script, I call get_price(), which in my version of this script is
Code:
int get_price( item it )
{
	if ( historical_age( it ) < 5 && historical_price( it ) < 2000 ) return historical_price( it );
	return mall_price( it );
}
 

fronobulax

Developer
Staff member
Only problem is that mall_price() prints: "Searching for...." every item. And there are a lot of items. It's slowing down my script by a lot. Is there a way to turn off this option?

I assume lots is about 30. You have not lived until you have done almost anything for few thousand items, such as price the contents of a Display Case :)

My equivalent, stolen from Bale, I believe, uses historical prices. Every few days I go to the Store Manager and reprice things. It doesn't really matter whether things sit in the store for a couple of days or not.

(Actually what I really do is run ManageStore to get rid of things that will probably never sell, manually empty the store into my inventory and then run Bale's OCD to reprice and restock but...)
 
Top