buttonFrenzy - Betterized stores

guyy

Member
buttonFrenzy 1.01: A buttontastic improvement to the interface of mall-stores and (most) NPC stores.

What it do (to stores):

  • No more lame radio-selecting or unnecessary scrolling. Every item has its own amount-box and purchase button.
  • Purchase button tells you the total price of the pile of items you'll buy if you click it.
  • If you already have some of an item, it'll list how many you have next to the purchase button.
  • Items you cannot afford are grayed out.
  • Auto-equips necessary gear to visit Sea Monkees, the Bugbear Bakery, or the Hippy Store.

Sneaky Javascript ninjas prevent you from making invalid purchases:

  • If you try to buy more of a thing than you can afford, it adjusts the number accordingly and displays a warning $.
  • If the store doesn't have enough in stock, you'll get a #.
  • If you see an L, it doesn't mean you're a loser, it means you tried to go over a mallstore's purchase limit.

(Note: Only applies to stores that don't have one-click-purchase buttons, but do allow buying multiple copies of an item. Which is most of them, except weird ones like the fat loot token machine and astral gear shops. It does fix up Grandma Sea Monkee, though, because her default interface is, like, the worst.)

Here's (part of) a sample mall-store. If the store was reached through an item search, the relevant item will be highlighted red, as below. Blue items are priced below historical_price.
Don't bother clicking those buttons, it's just an image!

mBb8s5K.png



Installation: Paste the following into the CLI (update Mafia if it doesn't do anything):

Code:
svn checkout https://svn.code.sf.net/p/guyymafia/code/buttonfrenzy

To uninstall it, use "svn delete guyymafia-buttonfrenzy".

To disable it without deleting it, use "set buttonFrenzy = false"; turn it back on with "set buttonFrenzy = true".

If you want to cram it into bUMRATS, follow the instructions at the bottom of relay/buttonFrenzy.ash after running the checkout command above.

Page-override files used: mallstore.ash, shop.ash, store.ash, spaaace.ash, monkeycastle.ash, hermit.ash, town_giftshop.ash, arcade.ash, gamestore.ash, galaktik.ash, cafe.ash, bigisland.ash, bhh.ash.
 
Last edited:

fewyn

Administrator
Staff member
Whoa, this is pretty cool. I've always hated having to scroll to the bottom when manually buying stuff in the relay browser.
 

Winterbay

Active member
Nice. Any reason why you are using cli_execute("outfit outfit name") instead of outfit("outfit name")? Also, I added changing into the filthy hippy disguise in my copy. Any reason why you didn't add that (well aprat from needing to track where in the war we are in order to get that part to work)?
 

guyy

Member
Nice. Any reason why you are using cli_execute("outfit outfit name") instead of outfit("outfit name")? Also, I added changing into the filthy hippy disguise in my copy. Any reason why you didn't add that (well aprat from needing to track where in the war we are in order to get that part to work)?

The answers, respectively, are "nope" and "because I forgot about the hippy outfit thing." :p

There's not any real difference between a CLI outfit command and the outfit function, as far as I know(?), but I'll see if I can stick something in for the hippy store outfit(s) later.
 

Winterbay

Active member
Well, there is the benefit of getting a reliable boolean return value that you can use to check if the equipping was successful, but that's about it I think.
 

Gawea

New member
Thanks for this script! It's exactly what I've been looking for.
One suggestion: Could you add Travoltan Trousers as an autoequip for NPC stores?
 

Uli

Member
Thanks for the script, but I do have an error to report. The script works for the Island War if you are a frat boy, but not as a hippy warrior. You just get a list of all the items you can trade for, but the boxes to enter how many you'd like to trade/buy don't show up.
 

guyy

Member
Thanks for the script, but I do have an error to report. The script works for the Island War if you are a frat boy, but not as a hippy warrior. You just get a list of all the items you can trade for, but the boxes to enter how many you'd like to trade/buy don't show up.

Figures...I never actually tested the war-hippy shop. I think it was failing to count your dimes because it was looking for "Dimesmaster" instead of "Dimemaster" (with one "s"). If you're still in the war, could you do an "svn update" and see if it works now?
 

Uli

Member
Unfortunately, I am not in the war anymore, but I will let you know in a week or so when I'm there again if you haven't found out by then. Thanks for the quick fix!
 

Lxndr

Member
"Script execution aborted (java.lang.NoClassDefFoundError: net/sourceforge/kolmafia/request/MallPurchaseRequest): (buttonFrenzy.ash, line 45)"

I suspect this is related to the mall updates?
 

guyy

Member
Still works for me; the mall update shouldn't affect this, since that only changed the "manage store" page.
 

matt.chugg

Moderator
Love this idea, A little while ago I had the idea of building a global relay override, to adjust all stores in the kingdom to include a note by each item to tell me how many I already owned, especially useful for collectionists, with limited time stores from world events, etc

The code I used in the end wasn't massively complicated, and may not be all that useful here, (edit and actually now I think about it, broken with mall changes, thats how out of touch I am) but is a feature I think a few people might appreciate!

Code:
	if((pagename=="store.php" || pagename=="shop.php" || pagename=="galaktik.php" || pagename=="mrstore.php" || pagename=="town_giftshop.php" || pagename=="hermit.php")) {
		matcher buyable_item = create_matcher("<(?:a|img|td).*?onClick.*?><b>(.*?)</b>" , page);
		while (find(buyable_item)){
			item it = to_item(buyable_item.group(1));
			if(it != $item[none]) {
				string item_string = "<b>" + to_string(it) + "</b><br /> <span style=\"font-size:10px;\">(INV:<span style=\"color:green; font-weight:bold;\">" + item_amount(it) + "</span>    DIS:<span style=\"color:magenta; font-weight:bold;\">" + display_amount(it) + "</span>    STO:<span style=\"color:blue; font-weight:bold; \">" + storage_amount(it) + "</span>) </span>";
				page.replace_string("<b>" + it.to_string() + "</b>",item_string);
			}
	   }
	}
 

Hidden Knife

New member
Love the script so far, but it seems to omit "(1/day)" limitations in the mall.
It's a shame that this script was never improved to show the limitations. I also find it odd that I can't seem to find anyone that ever did a similar script that showed the limits as well.
 
Top