Bug - Fixed CAB detection just broke! (I wish this had happened yesterday!)

Bale

Minion
I hate to break this to you hours after making a big release, but KoL just broke KoLmafia!

If the user enables the CAB, KoLmafia is now incapable of detecting it due to changes in the "account" menu becoming the "options" menu.

The result of this is that if you use the CAB, KoLmafia will attempt to display BOTH and it won't add a script button to the CAB.

I really wish this had happened just a teeny bit earlier so that 14.4 would work. You may feel free to curse a blue streak.
 

lostcalpolydude

Developer
Staff member
At least Preferences -> Browser -> "Add custom buttons to the top of fight pages" can be unchecked so it's just the CAB there and not unusable buttons in the background. You still lose the script button though.
 

Bale

Minion
Actually, I can live with the custom buttons hanging out in the background, but the script button is important to me. I think I'm going back to CAB-less play until this is fixed, that's my way of living with it.
 

StDoodle

Minion
Ugh, are these only updating with javascript? Will mafia even be able to check for the CAB anymore?
 

Veracity

Developer
Staff member
Well, shit. It will take heavy modification to AccountRequest. It's certainly doable, but I don't have time tonight. If you go to account.php, it shows you the "interface" tab. You can go to each tab directly:

account.php?tab=interface
account.php?tab=inventory
account.php?tab=chat
account.php?tab=combat
account.php?tab=account
account.php?tab=profile
account.php?tab=privacy

On each tab, you can see the values of the settings there. For example, the CAB will be:
Code:
<input type="checkbox" value="1"   name="flag_wowbar"/>
<input type="checkbox" value="1" checked="checked"  name="flag_wowbar"/>
If it is disabled (first case) or enabled (second case)

So, eminently doable, but it will require multiple server hits to read all of the various account menu data that we need to know.

I'll spin 14.4.1 (will that work?) once this is resolved. Maybe hola will have time to look at it before I do. ;)
 

Bale

Minion
I'll spin 14.4.1 (will that work?) once this is resolved.

Please. This is a weird situation having KoL break your work mere hours after a new release. It deserves such an unusual solution.

KoL hadn't broken KoLmafia for so many months and then they do it today. And it would be fine if you hadn't worked yourself so hard to get it the same day as the new IotM. It's like you were being punished for being awesome. Urgh.
 
Last edited:

StDoodle

Minion
It would also be possible to disable the mafia buttons if a fight.php request shows an inclusion of "<div id=topbar>" right? Just in case that would be "quicker."
 
Am I the only person that uses CABs and, even after the change, isn't having this problem?

I upped to 14.4, logged in, played a few turns, then the update hit.


Will it not break until after I restart mafia?
 
Checked post-rollover, everything still looks fine.

So, what's happening is mafia is trying to inject its own buttons because it thinks KoL's aren't present?

Then couldn't one just... disable KoL's let mafia use its own to begin with?

*doesn't understand where things are going wrong*
 

Veracity

Developer
Staff member
Revision 9001 is an emergency bandaid.

- I changed AccountRequest to be able to look at and parse each tab individually.
- I set KoLmafia to get the Interface, Inventory, Combat, and Account tabs at login
- When you visit the options in the Relay Browser, we will reparse each tab you examine.

The Interface tab has top menu style (icons, dropdowns, links) and sidepane style (compact normal)
The Inventory tab has autosell mode (compact, detailed) and "unequip all also strips familiar"
The Combat tab has "use CAB" and autoattack

Problems:

- We do not recognize the new ajax requests to actually change an option. Therefore, if you change something, you have to change to a new tab and back to the one where you changed the options to let us reparse the tab and update.
- I have no data for which tab (Account?) has the Bad Moon, Hardcore, Teet/Boozer/Oxy, Recall Skills options. It would be a Big Help if somebody could save a log of visiting the tab in the following cases:
-- In Hardcore No Path
-- (any) Oxy
-- (any) Boozer
-- (any) Teet
-- In Bad Moon before freeing the king
-- In Bad Moon after freeing the king before recalling skills
-- In Bad Moon after recalling skills.
 

Alexfrog

New member
Please. This is a weird situation having KoL break your work mere hours after a new release. It deserves such an unusual solution.

KoL hadn't broken KoLmafia for so many months and then they do it today. And it would be fine if you hadn't worked yourself so hard to get it the same day as the new IotM. It's like you were being punished for being awesome. Urgh.

They specifically waited for you guys to release a new Mafia version, so that they could screw you with this :p
 

Winterbay

Active member
Attached is the html of the account menu when you are in hardcore, no path. There is a "drop hardcore" button with a confirm tick-box next to it.

This appears to be the code for the box and button:
Code:
<div class="opt"><input type=hidden name="actions[]" value="unhardcore"><input class=button name="action" type=submit value="Drop Hardcore"><input type="checkbox" class="confirm" name="unhardcoreconfirm" value="1"> (confirm)<span class="help" info="If you drop Hardcore you won't be able to take it again until you ascend.">(?)</span></div>

The html is from native KoL without any GM scripts active (I think, the only one I have is affecting the top menu only).
 
Last edited:

StDoodle

Minion
Yes, there is a preference for whether or not KoLmafia adds its own fight buttons that would fix that particular issue. However, there are quite a few other things that KoLmafia also checks the account page to determine, and for now every single one of them is broken, as the old link to the account page doesn't lead to the same information that it used to.
 

StDoodle

Minion
Out of curiosity, I swear I've had times where "View Source" in Firefox gave me "fixed" source, ie double-quotes added to attributes that it turns out KoL didn't actually have. Is there an easy way to view the same source that KoLmafia will be checking against?
 

Winterbay

Active member
Using visit url to capture the page and save that output to a file somehow?

Edit: Nope, that doesn't work. Visit_url doesn't return the unhardcore-button code at all so a check for either "unharcore" or unhardcore returns false.
 
Last edited:

slyz

Developer
It would be a Big Help if somebody could save a log of visiting the tab in the following cases:
Help menu -> Start debug log, then visit the different tabs of account.php.
The resulting debug log will contain the raw HTML.
 
Top