Character Info Toolbox

AlbinoRhino

Active member
That a good start. To solve the problem of editing images/scripts/familiarfaves.20120307.js, it might be better to rename the function and add the modified version to chit.js.

Now, what extra modification is needed to avoid loading the ajax result into the mainpane and where is the script called in the charpane html? How do I do that? We're close!

The script is loaded externally from the familiarfaves.20120307.js file when the page loads by the line which Winterbay refers to above. If you look at the anchor tag which wraps the familiar icon (and the name) you will see they have a class of "familiarpick". It is right-clicking an element of this class which activates the javascript in the external file. The external JS then creates the familiar picker and handles the changing of familiars. I guess to do what you want, you would have to:
1) remove the line which calls the external script i.e. <script type="text/javascript" src="/images/scripts/familiarfaves.20120307.js"></script>
2) reproduce everything in that file by inserting into a <script> tag within the charpane header .. and then ...
3) make the alterations needed to the familiar switching function

I'm still not certain how to handle the ajax. I haven't had a chance to look at that very carefully yet.
 

AlbinoRhino

Active member
Whoa! Can't it be added to chit.js instead?

Probably. As I've mentioned before I've not really studied how chit works, but I see it's included in the charpane html, so that should work too. I'm also not very familiar with the KoL scripts, as this is the only time I've looked at them for anything. As you can see in the html, there are quite a few, both external and internal, included in the charpane.
 

AlbinoRhino

Active member
I'd like this since mafia knows how to equip the best familiar item, or leave it alone if there is already something equipped. KoL cannot do that.

Under what conditions does mafia actually do that ? I wrote some code which replaces the dojax changing of the familiar, and I have a pet sweater in inventory (the only familiar equip I have at the moment), but when I change familiars, the sweater doesn't get equipped. In fact, even when I use the "familiar" command directly in the cli, the familiar does not get equipped. Are there some conditions that need to be met before mafia starts auto-equipping familiars ?
 

lostcalpolydude

Developer
Staff member
Astral pet sweater
plastic pumpkin bucket
little box of fireworks
mayflower bouquet
moveable feast
familiar-specific equipment
ittah bittah hookah
lead necklace

That's the list of stuff that mafia will auto-equip on a familiar, in that order, if you have it. Sugar shields are intentionally not on that list since they get used up. This is done when using the "familiar" command or when using the Gear Changer.
 

AlbinoRhino

Active member
Huh. The behavior I am seeing is that mafia will steal the pet sweater if it is equipped on another familiar, but if the pet sweater is just sitting in inventory, then nothing gets equipped.
 
Last edited:

lostcalpolydude

Developer
Staff member
// If the old familiar wasn't wearing equipment, nothing to
// steal.
There's probably a reason for that block. It seems like you would equip your familiar on turn 0 and never think about it again, making it a non-issue by day 2.
 

Winterbay

Active member
It appears so... It only seems to work on my multi which is in a non-ascended state and not on my ascending main.
 

lostcalpolydude

Developer
Staff member
I just tested this on a character in Bad Moon. Switching from a familiar not wearing equipment to a familiar not wearing equipment does nothing with equipment. Switching from a familiar with equipment to a familiar without equipment will equip anything available.

Which is what the quoted comment above says, and being in aftercore is completely irrelevant.
 

Winterbay

Active member
I just tested this on a character in Bad Moon. Switching from a familiar not wearing equipment to a familiar not wearing equipment does nothing with equipment. Switching from a familiar with equipment to a familiar without equipment will equip anything available.

Which is what the quoted comment above says, and being in aftercore is completely irrelevant.

Ahh right. Couldn't test that variant since I only had one familiar equipment in my current hardcore run :)
 

AlbinoRhino

Active member
I just tested this on a character in Bad Moon. Switching from a familiar not wearing equipment to a familiar not wearing equipment does nothing with equipment. Switching from a familiar with equipment to a familiar without equipment will equip anything available.

Which is what the quoted comment above says, and being in aftercore is completely irrelevant.

This was the behavior I saw, as well. So ... the condition is that at least one of those items from the list must already be equipped on the original familiar ?
 

AlbinoRhino

Active member
Bale, I am attaching a copy of the altered familiarfaves.20120307.js which I made this morning (and forgot to post ... sorry, I'm old). It was working fine for me in FF 13.0.1. All of the code in the file would need to be added to chit.js, and the charpane override would need to remove the inclusion of the familiarfaves.20120307.js file from charpane.php.
 

Attachments

  • familiarfaves.20120307.js
    4 KB · Views: 21

Bale

Minion
Thanks! That script ALMOST works. Unfortunatley it will not reload the charpane after execution. :( How do we fix that?

(I merely replaced the script in my mafia image cache. I'll worry about adding it to chit.js later.)
 

AlbinoRhino

Active member
Huh. Reloads for me. I set it to reload after a 2 second delay. Guess I will have to mess with that bit some more. Probably some browser difference. Which do you use ?
 

AlbinoRhino

Active member
Huh. Reloads for me. I set it to reload after a 2 second delay. Guess I will have to mess with that bit some more. Probably some browser difference. Which do you use ?

Here's a slightly different version you can try. Does mafia take longer than 2 seconds to change your familiar & equipment ? Maybe the delay timing needs tweaked.
 

Attachments

  • familiarfaves.20120307.js
    4.1 KB · Views: 21

Bale

Minion
My browser is Opera. And it is definitely not reloading. I've waited much longer than 2 seconds without result. Can you figure out why? Please consider this a wonderful opportunity to try the Opera browser so you can test the script.

Tried it in IE and it reloaded perfectly.
 

AlbinoRhino

Active member
The 2 seconds may be too quick. I just saw an instance on mine where it reloaded in between mafia changing the familiar and the equipment. So my charpane refreshed and displayed the new familiar but not the equipment. That was the only time I saw that happen though. Did you also try the second version I posted ?
 
Top