Auto PvP Mystery Mini Mall Stocker

alexbishops

New member
At the risk of causing severe lag here is a script to purchase every item in the mall below 1000 meat and put it in your mall for 999 meat.

View attachment Auto PvP Mystery Mini Mall Stocker.ash v1.0
View attachment Auto PvP Mystery Mini Mall Stocker v1.1.ash v1.1
View attachment Auto PvP Mystery Mini Mall Stocker v1.1a.ash v1.1a

You will need about 500K meat and a lot of time to run it all the way through.

I've not actually tested these completed scripts 100% of the way through as I've been using test scripts and already have more than enough junk in my mall already. Let me know if you have any problems.

v1.0 - Initial release.
v1.1 - Will now check if item is already in mall before purchasing another.
v1.1a - Will also put all but one item from inventory into mall (not fully tested).

Please note: Do not run this script if you have a sellable item that is not in the mall, e.g. Hand turkey outline, as it will be put up for sale for 999 meat!
 
Last edited:

alexbishops

New member
Shouldn't you check if you already have the item in your shop?

As we're only dealing with items below 1000 meat I didn't think it was overly important to check. However if you want to constantly run this script it would make a lot of sense. If you ask me nicely I'll be happy to include it.
 

lostcalpolydude

Developer
Staff member
Every shop_amount() call is a server hit currently. I suppose that's not any worse than the server hit to buy the item and some server hits to put the items in your store, and it does save some meat.
 

Aramada

Member
As we're only dealing with items below 1000 meat I didn't think it was overly important to check. However if you want to constantly run this script it would make a lot of sense. If you ask me nicely I'll be happy to include it.

Would you please be so kind to add the functionality of the script checking to see if an item is already in your shop before it purchases it from the Mall, if it wouldn't be too much trouble? I think it would be a lovely addition.

Also, thank you for providing the change language in the KOL Forum thread that allows the script to check your Inventory first, before buying. I think one of the main reasons to tweak it slightly further to have it check the Inventory, and, if you have an item, grab all but one of it and put it in your store is to protect against PvPers who are stealing loot. Lots of random items in your Inventory is a handy defense mechanism. If that is a possible option, I would greatly appreciate it if it could be added.

Thank you!!!

~Aramada
 

slyz

Developer
He might include it if you ask him nicely :)

I'll see if I have some time later today to add a get_shop() function. That would make things easier.
 

alexbishops

New member
Would you please be so kind to add the functionality of the script checking to see if an item is already in your shop before it purchases it from the Mall, if it wouldn't be too much trouble? I think it would be a lovely addition.

Also, thank you for providing the change language in the KOL Forum thread that allows the script to check your Inventory first, before buying. I think one of the main reasons to tweak it slightly further to have it check the Inventory, and, if you have an item, grab all but one of it and put it in your store is to protect against PvPers who are stealing loot. Lots of random items in your Inventory is a handy defense mechanism. If that is a possible option, I would greatly appreciate it if it could be added.

Thank you!!!

~Aramada

Try out version 1.1a and let me know how it goes. Close KoLmafia and open it again before you run it as this will help make sure it runs correctly. Thank you also for the politeness of your request; it greatly increases my enjoyment of doing this.

On a technical note I feel I'm relying on rather a lot of nested if statements. Has any one got any pointers?
 

lostcalpolydude

Developer
Staff member
Rather than doing
Code:
if( condition1 )
{
	if( condition2 )
	{
		//stuff
	}
}
you can do
Code:
if( condition1 && condition2 )
{
	//stuff
}

If you want to avoid confusion about order of operations, you can put parentheses around each condition.
 

Winterbay

Active member
ANd if you have
Code:
if(a) {  
   if(b) {
      stuff
   }
   if(c) {
      stuff2
   }
... and so on ...
}

I guess a switch statement may be something to look at as well.
 

slyz

Developer
Every shop_amount() call is a server hit currently.
It wasn't the case when I tried it out. StoreManager will return soldItemList until StoreManager.clearCache() is called.

Now I'll go back to figuring out how to turn a LockableListModel into a MapValue.

EDIT: r11483
 
Last edited:

lostcalpolydude

Developer
Staff member
It wasn't the case when I tried it out. StoreManager will return soldItemList until StoreManager.clearCache() is called.

Now I'll go back to figuring out how to turn a LockableListModel into a MapValue.

Now that I've tested it, I see the same thing. Looking at the relevant code in RuntimeLibrary and StoreManager, it doesn't look like anything has changed since zarqon's feature request.
 

pcolley

New member
Would it be possible to have the script skip items that are not available in the Mall. That way Hand Turkey Outlines (and my Right Bear Arm) won't get put in the mall because supply is low or manipulated. Perhaps adding a greater than zero to the less than 1000 line.

Thanks,
Pal
 
Last edited:
Top