Mafia Charpane being Weird

bumcheekcity

Active member
I have a little greasemonkey script running to make the text in the charplane smaller. It simply loops through every <td> and changes the font size. It works beautifully.

But for a couple of days, mafia has started loading the charpane, and then it 'pings' into small text (which is normal and correct as greasemonkey loads only after a page has fully loaded), BUT then it pings back into the normal sized text again.

Have I changed an option stupidly that would have caused this? It's really weird?

Greasemonkey script below:

// ==UserScript==
// @name bumcheekcity's KoL Charplane Script
// @namespace /
// @include *kingdomofloathing.com/charpane.php*
// @include *127.0.0.1:*/charpane.php*
// ==/UserScript==

var img = document.getElementsByTagName('img');
var tds = document.getElementsByTagName('td');
var fnt = document.getElementsByTagName('font');
var i;

//Removes your Character's picture.
img[0].height = 50;
img[0].width = 30;

//Removes HP, MP, Meat, Adv pictures.
for (i = 1; i < img.length; i++)
{
img.style.height = 20;
img.style.width = 20;
}

//Make Text Small
for (i = 0; i < tds.length; i++)
{
tds.style.fontSize = 10+"px";
}
for (i = 0; i < fnt.length; i++)
{
fnt.size = 1;
}
 

lostcalpolydude

Developer
Staff member
I'm guessing it's the way some ajax request reloads content without triggering greasemonkey scripts to recheck the page. I had a similar script running before the separate compact settings came along (less effective than yours, it seems, since mine only shrunk a portion of what I was going after), and any time I used a chat command that changed some charpane value I would end up with big text again. It sounds like something different here, but maybe it will be helpful anyway.
 

Bale

Minion
A couple of days ago mafia made a change to allow charpane and top menu to be put into compact mode separately. The time frame is suspicious. Maybe connected? Have you checked to ensure that Kol's code is still the same?
 

bumcheekcity

Active member
Ah, of course, the compact mode changes. I'm still on the fullpane, and yeah, it could be that. It does happen EVERY time, even if I literally just reload the charpane and do nothing.

Weirdly, it does NOT happen (i.e. my text stays small) if i load the charpane in a separate window. A quick firebug test says that no AJAX requests are being made by the pages at all :S

Edit: Aha, I found something. I have my firefox window open, and Mafia open in the foreground. As mafia auto-adventures, the charpane updates automatically, without refreshing the page (i.e. my buffs and adventures decrease, and experience points change as necessary. Is this a mafia or KOL change?
 
Last edited:

Spiny

Member
Edit: Aha, I found something. I have my firefox window open, and Mafia open in the foreground. As mafia auto-adventures, the charpane updates automatically, without refreshing the page (i.e. my buffs and adventures decrease, and experience points change as necessary. Is this a mafia or KOL change?

I think that was what I was trying to find out here, but I haven't seen it happen in a bit. Then again, I haven't been auto-adventuring recently either lol.
 

Veracity

Developer
Staff member
A couple of days ago mafia made a change to allow charpane and top menu to be put into compact mode separately. The time frame is suspicious. Maybe connected? Have you checked to ensure that Kol's code is still the same?
I think you mean that KoL made that change. Have we updated to follow that server-side change, yet?
 
Top