New Content - Implemented Mall Upgrade on September 13, 2013

Bale

Minion
Despite the changes most of KoL's current mall interface still works. It can still buy and reprice items. Thank goodness.

I only found a few issues.

1. Store Log: Store log is not displayed When I click the "refresh" button, nothing happens. We need to switch to using /backoffice.php?which=3

2. When a change is made to a price, or an item is added through the new interface in the relay browser, KoLmafia is unable to detect this.

3. KoL now allows any arbitrary quantity of an item to be removed from a store. This should be supported by ash commands and the GUI.

4. KoL now allows mall purchases and stocking/item removal during ronin/hardcore. These stock changes and purchases are through Hangks.
 
Last edited:

slyz

Developer
1. Store Log: Store log is not displayed When I click the "refresh" button, nothing happens. We need to switch to using /backoffice.php?which=3
r12626

2. When a change is made to a price, or an item is added through the new interface in the relay browser, KoLmafia is unable to detect this.
I'll have a look at this now.

3. KoL now allows any arbitrary quantity of an item to be removed from a store. This should be supported by ash commands and the GUI.
I didn't find how this is done with a cursory inspection of the new interface. I'll have to read the GD thread, probably.

4. KoL now allows mall purchases and stocking/item removal during ronin/hardcore. These stock changes and purchases are through Hangks.
This will probably require a more significant change, I'm leaving this aside for now.
 

Bale

Minion
I didn't find how this is done with a cursory inspection of the new interface. I'll have to read the GD thread, probably.

I didn't notice that in the GD thread. I noticed it while preparing to post this thread. I'll explain. If you right-click on the link it will pop-up a little box where you can enter a number. All you really need to know though is contained in the URL: backoffice.php?qty=1&pwd=140c13a97481280a8a8238ed4fcb5421&action=removeitem&itemid=4508

Note the url for removing items from the mall contains a qty.
 

slyz

Developer
I didn't get the pop-up box in Firefox when I right-clicked (haven't tried Opera), but the URL works. Thanks.
 

Veracity

Developer
Staff member
Revision 12628 begins support for "remove some". It appears that item removal goes through

backoffice.php?action=removeitem&itemid=X&qty=Y

KoL's mall management's "take all" sets qty to the actual number you have in the store.

I added a "take some" button to each row in the store management frame and submit the appropriate request. Unfortunately, I ran out of steam before figuring out how to actually update the model of items in the store to reflect the new number you have in the store, after removing some (or all) of an item.

Perhaps somebody else will enjoy carrying on from here. ;)
 

lostcalpolydude

Developer
Staff member
I wonder if we should only have the Take Some button, and have it open pre-filled with the total quantity available to remove.
 

Bale

Minion
@lost, With r12635 you consolidated the remove item buttons on the "price setup" tab, but you didn't think to do that for the "removals" tab. (There are several tabs in the Store Manager.)

We should have a "remove some" button on the "removals" tab of the Store Manager.
 

lostcalpolydude

Developer
Staff member
I realized there was work to do there, but I didn't want to decide right then what to do with it.

12636 covers what Veracity was talking about, updating mafia's state for your store when you remove items, but so far that only happens when you remove items through mafia. Ultimately, ManageStoreRequest needs to actually use processResults()/parseResponse() probably, but at least the updating function is written for that.

take_shop( item, boolean takeAll ) needs updating or possibly removing. Currently mafia tries using Integer.MAX_VALUE for qty to take all, but KoL ignores the request if you use a quantity greater than what you currently have. That could be fixed, but people almost certainly want take_shop( item, int quantity ) instead now. I suppose take_shop( item ) can still mean take all.
 

Veracity

Developer
Staff member
Ultimately, ManageStoreRequest needs to actually use processResults()/parseResponse() probably, but at least the updating function is written for that.
That is exactly correct: it needs to update correctly, whether via internal request or via the Relay Browser, and that is the mechanism.

take_shop( item, boolean takeAll ) needs updating or possibly removing. Currently mafia tries using Integer.MAX_VALUE for qty to take all, but KoL ignores the request if you use a quantity greater than what you currently have. That could be fixed, but people almost certainly want take_shop( item, int quantity ) instead now. I suppose take_shop( item ) can still mean take all.
The thing which got me was that the whole "what's in your store" is stored in vectors complete with limits, prices, etc., that you need to display in the GUI store management interface - but what take_shop and shop_amount and what have you care about is simply "<item> (quantity)". I.e, a list of AdventureResults, just as we have for inventory, closet, storage, ...

It seemed a bigger job to refactor things so that you can add or subtract from your store inventory (as last seen) without, necessarily, reading the store inventory page and updating everything.

You seem to be on track to figuring this out, and I am happy to see it, since I don't want to do it. :)
 

lostcalpolydude

Developer
Staff member
It turns out that creating a new SoldItem() with an itemId that matches an existing one just gives you the existing one instead, I guess due to its equals() method only checking itemId. I had to look up the ASH shop_amount() function to figure that out.

Refactoring the responseText checks in ManageStoreFrame looks like a separate project, one that I should be able to handle but I haven't looked at it yet really. I don't really know how relay browser activity updated things before though...
 

Razorsoup

Member
I think this is related to the mall upgrade. If not, I can open a new thread.

The ASH function take_shop( item it ) doesn't seem to be working.

> ash shop_amount($item[lychee chuhai])

Returned: 137

> ash take_shop($item[lychee chuhai])

Removing lychee chuhai from store...
Returned: true

> ash shop_amount($item[lychee chuhai])

Returned: 137

Opening the mall interface confirms that the item was not removed.
 

Theraze

Active member
Lost and Veracity noted this in posts 9 and 10.

The solution for now is to use take_shop($item, shop_amount($item)).
 

lostcalpolydude

Developer
Staff member
That function doesn't exist yet, the only thing you can currently do is take_shop( item, false ) to remove 1 of the item.
 

Ensiferum

Member
Bringing this thread up instead of making a new one, since I am not entirely sure if this is a bug or something I misremember.

KoLmafia (last experienced in 12756) no longer refreshes the character status when a store purchase log is retrieved.

I am 99.99% sure that the status pane was auto-refreshed after a store log check until recently. This is no longer happening and to get an updated amount of meat on hand I have to use the 'Refresh Status' button.

This unexpected behaviour made me think that I've mispriced something and go through logs a few times in the past 2 days, only to discover that there was no mistake on the pricing. Is it possible to get this automatical status pane refresh back?
 

Veracity

Developer
Staff member
We now update the status if and only if KoL itself tells us to do so. That happens only when the request you submitted has a chance of changing your status. The mere retrieval of the purchase log does not change your status. If you think it does, tell me what happens when you do it in the Relay Browser. When you go to look at your purchase log, does KoL refresh your charpane? If not, we don't either. If it does, but only "some of the time", KoLmafia will refresh it "some of the time" as well - exactly those times when KoL says to refresh it.

I am not willing to put in a special case check to say "oh, for this particular request, refresh status, even though KoL did not say to do so".

I am very confused about why you would think you mispriced something because your Meat did not update when you looked at the purchase log. I honestly don't understand your thinking. If you don't see your Meat update after you use a skill (something which updates the charpane), do you immediately conclude that you mispriced something in your store?
 

lostcalpolydude

Developer
Staff member
I am very confused about why you would think you mispriced something because your Meat did not update when you looked at the purchase log. I honestly don't understand your thinking. If you don't see your Meat update after you use a skill (something which updates the charpane), do you immediately conclude that you mispriced something in your store?

I can understand why KoL's change would lead to confusion. If you see an expensive item listed in the mall, and you expect to have lots more meat displayed but the display doesn't update, that can result in a bit of panic.

I know one person has already filed a bug report about that KoL change. Maybe you (Ensiferum) can add your voice to that discussion.
 
Top