Gain Store Credit @ Ye Wizard's Shack Game Shoppe

That is working perfectly. You are specifying "max price per credit". A Cleric gives you 5 credits, and is therefore worth buying for up to 15,000, if you are willing to pay 3,000 per credit.
 
I have just updated this script to version 1.0

I've looked over the previous complaints to improve it and also added mass buying to make it faster.
It has become 100% more awesome. Much faster and more fun.

I don't think the max_price works correctly. I set it to 3000, yet it still bought cards at 14k:

Using cached search results for Alice's Army Cleric...
Purchasing Alice's Army Cleric (1 @ 13,800)...
You acquire an item: Alice's Army Cleric
Purchases complete.

New version tells you how many credits the card is worth if it is worth more than 1. That should help people understand what is going on.
 
Still seem to be having issues with this. Set meat/credit to 1 or 0 so it won't buy from the Mall, and credits desired at something lowball past my current credits, though I'm still not getting the script to sell the cards in my inventory. In the below examples, I set the credits desired to 470, since I have 8 commons in my inventory.
> call scripts\StoreCredit.ash

Checking for updates (running Store Credit ver. 1.0)...
_version_BalesStoreCredit => 1.0
You have a current version of Store Credit.
You have 463 credits.
Alice's Army Guard is too expensive at 2550 meat.
I tested this out afterwards, and set the meat per credit to 2550, it bought 6 Guards at 2550 each, traded them in, then stopped.
> call scripts\StoreCredit.ash

You have 463 credits.
Searching for "alice's army guard"...
Search complete.
Purchasing Alice's Army Guard (7 @ 2,550)...
You acquire Alice's Army Guard (7)
Purchases complete.
Trading in 6 Alice's Army Guards for credit.
You have 469 credits.
Alice's Army Halberder is too expensive at 2640 meat.
Is the script checking the mall prices, then not trading in any cards I have that are under ther meat per credit limit or something, or was that a feature someone was hoping for in the thread and I'm now confused?
 
The script will trade cards if their mall price is less than your meat per credit price. It just seems silly to trade cards if you could simply sell them for enough meat to purchase cheaper cards that'd give you the same number of credits.

That is the point adeyke made HERE and I agree with him.
 
Well yeah, I'm not trading in Uncommons or rares, those go in my store. But commons I'm happy to part with.

Is there a way to set it to automatically trade in commons, regardless of price? Given my above example, it should've traded in any Guards I had, right? It didn't and I tested it out again, since I thought maybe for some reason, I didn't have a Guard. Ninjas were the cheapest (didn't have any), followed by Wallmen (had 1). Plugged in the cheapest price Wallmen were going for in the Mall, the script bought 7 of em, traded them in, and left the one in my inventory untouched. I did already alter the script so it doesn't try to keep one of each in my inventory, so it's not that.
 
I did already alter the script so it doesn't try to keep one of each in my inventory, so it's not that.

There are several places where you need to make such a change. I suspect you missed one of them. You'd need to make a change on lines 81, 82 & 91
 
The script will trade cards if their mall price is less than your meat per credit price. It just seems silly to trade cards if you could simply sell them for enough meat to purchase cheaper cards that'd give you the same number of credits.

This is exactly the same concept that seems to elude people who insist that items in their inventory be valued at zero meat and don't grasp the idea that there is meat to be made when the value of the ingredients is more than that of the crafted product. Makes me wonder if there needs to be a FAQ explaining the economic principles observed by KoLmafia and many script writers. :-)
 
I'm posting my variation here, because a couple of folks have asked for it. I stole a lot of code from Bale. In fact I included StoreCredit rather than copy the code and thereby have to maintain it myself.

It does the following:
  • Makes a list containing all of the card types.
  • Sorts the list by price per credit (ppc).
  • Prints the card name and other information.
  • Determines the lowest ppc available.
  • Prints the mall and credit value of all cards in the Display Case.
  • Lists cards that are available in the mall for the minimum observed ppc.
  • Lists cards in the DC to sell at greater than the observed ppc.
  • Lists cards that should be turned in for credit.

I had originally written it to use a target credit and it would tell me which cards to buy, which ones to sell and which ones to turn in. With market volatility being what it is I found I was running the script with several values so I converted it to tell me the minimum observed ppc and what actions I should take to get credits at that ppc.

My DC is the only source of cards and there will never be a recommendation that uses all of my cards of a type.`It uses mall_price. I tend to use it speculatively - Do I want to sell and trade at this ppc? - but execute the decision manually.

It's attached for the curious.
 

Attachments

There are several places where you need to make such a change. I suspect you missed one of them. You'd need to make a change on lines 81, 82 & 91
Ah. I had been going off of post #9, which just altered line #41. What all would I need to be changing on 81, 82 & 91? I'm not certain what I should be looking for.
 
Change this:

Code:
		if(item_amount(c) > 1 && credits < max_credit && price_per(c) <= max_price)
			trade_card(item_amount(c) - 1, c);
		#else print(c+": "+item_amount(c)+ " @ "+ price_per(c));
	int value;
	while(card < count(list) && price_per(list[card]) <= max_price && credits < max_credit
	  && my_meat() >= mall_price(list[card])) {
		value = rarity(list[card]);
		if(value > 1)
			print("Trying to buy "+list[card].plural+ ". They are worth "+value+ " credits each"+(value > 50? "!": "."), (value > 50? "green": "black"));
		if(buy(max(1, floor((max_credit - credits)/ value)), list[card], min(mall_price(list[card+1]), max_price * value)) > 0) {
			q = max(item_amount(list[card]) - 1, 0);

To this:

Code:
		if(item_amount(c) > 0 && credits < max_credit && price_per(c) <= max_price)
			trade_card(item_amount(c), c);
		#else print(c+": "+item_amount(c)+ " @ "+ price_per(c));
	int value;
	while(card < count(list) && price_per(list[card]) <= max_price && credits < max_credit
	  && my_meat() >= mall_price(list[card])) {
		value = rarity(list[card]);
		if(value > 1)
			print("Trying to buy "+list[card].plural+ ". They are worth "+value+ " credits each"+(value > 50? "!": "."), (value > 50? "green": "black"));
		if(buy(max(1, floor((max_credit - credits)/ value)), list[card], min(mall_price(list[card+1]), max_price * value)) > 0) {
			q = item_amount(list[card]);
 
Updated the script using Veracity's newly added coinmaster commands.

It was fun to rewrite it to include KoLmafia's new functionality, but there is no noticeable difference in the script's functionality other than the reduction of a single server hit.
 
Any thought to including packs of cards? If you're going after more than a few credits, over time the credits from opening (non-foil) packs of cards should even out. And depending on conditions (which is exactly what the script is designed to assess) packs may be the cheapest option.
 
Whoa! I didn't realize anyone still cared about this program!

I'd have to write a function to value packs of cards based on average chance of each possible card. Lets see, 4 random commons Plus 1 uncommon or rare (90% uncommon, 10% rare). Seems quite doable. Maybe I'll revisit this program if people are using it. You actually use it?
 
Whoa! I didn't realize anyone still cared about this program!

I'd have to write a function to value packs of cards based on average chance of each possible card. Lets see, 4 random commons Plus 1 uncommon or rare (90% uncommon, 10% rare). Seems quite doable. Maybe I'll revisit this program if people are using it. You actually use it?

I'm running it daily. Thank you.

I endorse the feature request. I note that I have almost one of every card in my DC, I am always selling the ones the script leaves behind to play with, but making that an option or leaving one behind in either the bag, closet or DC may be more effort than benefit for anyone but me. I have noticed that it sometimes has trouble with cards worth more than one. If, for example I am willing to pay 1299 per credit it sometimes fails to buy several cards priced at or under 6495 (which are real since I can buy them via the Purchases tab). If I had to look for something my hunch is that there is a division occurring somewhere that has the result truncated or rounded to an integer after which it is multiplied by something. Just a hunch, though and I am quite happily using the script as it is.
 
Considering it a little more, things are simpler than I first though: Each pack should produce an average of 13.5 credits so I can rate it as a card which returns that many credits. The tricky part is when I have to open the packs and then sell off whatever is produced.

Please check my evaluation of the credit production of a pack.

I'll add a feature to allow you to keep no cards in inventory since you actually use this. (I don't know how many other people actually care.)
 
Considering it a little more, things are simpler than I first though: Each pack should produce an average of 13.5 credits so I can rate it as a card which returns that many credits.

Wiki says 13.5 and I agree with the analysis presented there ;-)
 
Okay, I've done a bit of work on this to include the values for packs of cards. Also, it asks if you want to keep an extra card in inventory

Please try this out and let me know if it works as you desire. If you're happy then perhaps I'll update the first post to include it. In the meantime version 1.2 can be downloaded from this post.
 
Last edited:
Ran version in #38. Division by zero error at line 54. I threw in a print and the problem is that Pack of Alice's Army Foil Cards has a rarity of zero. To the wiki!!!
 
HuH? I clearly gave it a value of 675. Oh. Fixed silly error.

Download 1.2.1 from this post.
 
Last edited:
Back
Top