Character Info Toolbox

I think the following changes will fit the criteria (changes in bold):

Code:
[B]boolean addRestoreLinks = (get_property("relayAddsRestoreLinks") == "true") ? true:false;[/B]
    void addHP() {
        [B]int hpseverity = severity(my_hp(), my_maxhp(), to_float(get_property("hpAutoRecovery")));[/B]
        result.append('<tr>');
        result.append('<td class="label">HP</td>');
        [B]if (addRestoreLinks && hpseverity > 1) {[/B]
            result.append('<td class="info"><a title="Restore HP" href="/KoLmafia/sideCommand?cmd=restore+hp&pwd=' + my_hash() + '">' + my_hp() + ' / ' + my_maxhp() + '</a></td>');
        } else {
            result.append('<td class="info">' + my_hp() + ' / ' + my_maxhp() + '</td>');
        }
        if(showBars) {
            [B]if (addRestoreLinks && hpseverity > 1) {[/B]
                result.append('<td class="progress"><a href="/KoLmafia/sideCommand?cmd=restore+hp&pwd=' + my_hash() + '">' 
                    + progressCustom(my_hp(), my_maxhp(), "Restore your HP", severity(my_hp(), my_maxhp(), to_float(get_property("hpAutoRecovery"))), false) + '</a></td>');
            } else {
                result.append('<td class="progress">' 
                    + progressCustom(my_hp(), my_maxhp(), "auto", severity(my_hp(), my_maxhp(), to_float(get_property("hpAutoRecovery"))), false) + '</td>');
            }
        }
        result.append('</tr>');
    }
    
    void addMP() {
       [B] int mpseverity = severity(my_mp(), my_maxmp(), to_float(get_property("mpAutoRecovery")));[/B]
        result.append('<tr>');
        if(my_path() == "10" || my_path() == "Zombie Slayer") {
            string HordeLink = get_property("baleUr_ZombieAuto") == ""? '<a href="skills.php" target="mainpane" title="Use Horde Skills">'
                // If using Universal_recoverym, add link to recover Horde
                : '<a href="/KoLmafia/sideCommand?cmd=restore+mp&pwd=' + my_hash() + '" title="Restore Horde">';

            #<img src=http://images.kingdomofloathing.com/otherimages/zombies/horde_15.gif width=167 height=100 alt="Horde (23 zombie(s))" title="Horde (23 zombie(s))"><br>Horde: 23<center>
            if(vars["chit.kol.coolimages"].to_boolean()) {
                matcher horde = create_matcher("(zombies/.*?\\.gif).*?Horde:\\s*(\\d+)", health);
                if(find(horde)) {
                    # image: 167 x 100 pixels
                    result.append('<td colspan="'+ (showBars? 3: 2) +'"><center><img src=images/otherimages/' + horde.group(1) + ' width=167 height=100 border=0></center></td></tr>');
                    result.append('<tr><td class="label" colspan="'+ (showBars? 3: 2) +'"><center>'+HordeLink+'Horde: ' + horde.group(2) + '</a></center></td></tr>');
                    return;
                }
            }
            result.append('<td class="label">'+HordeLink+'Horde</a></td>');
            result.append('<td class="info">'+HordeLink + my_mp() + '</a></td>');
            if(showBars) result.append('<td class="progress"></td>');
            result.append('</tr>');
            return;
        }
        result.append('<td class="label">MP</td>');
        [B]if (addRestoreLinks && mpseverity > 1) {[/B]
            result.append('<td class="info"><a title="Restore MP" href="/KoLmafia/sideCommand?cmd=restore+mp&pwd=' + my_hash() + '">' + my_mp() + ' / ' + my_maxmp() + '</a></td>');
        } else {
            result.append('<td class="info">' + my_mp() + ' / ' + my_maxmp() + '</td>');
        }

        if (showBars) {
            [B]if (addRestoreLinks && mpseverity > 1) {[/B]
                result.append('<td class="progress"><a href="/KoLmafia/sideCommand?cmd=restore+mp&pwd=' + my_hash() + '">'
                    + progressCustom(my_mp(), my_maxmp(), "Restore your MP", severity(my_mp(), my_maxmp(), to_float(get_property("mpAutoRecovery"))), false) + '</a></td>');
            } else {
                result.append('<td class="progress">' 
                    + progressCustom(my_mp(), my_maxmp(), "auto", severity(my_mp(), my_maxmp(), to_float(get_property("mpAutoRecovery"))), false) + '</td>');
            }
        }
        result.append('</tr>');
    }
 
Last edited by a moderator:
AlbinoRhino, Thanks for the presentation. I liked the idea, so I just re-factored it a bit using a really interesting ash feature you might never have seen before now.

ereinion, Thanks for finding that bug. I fixed it.

Changes have been pushed out to the SVN.


Updated to 0.8.5 r6
  • Fix title bug for current mood being apathetic
  • Fix link to restore MP as a muscle class.

To update ChIT copy/paste the following line into the CLI
svn update

If you have not previously checked out ChIT from the SVN repository, you need to use a daily build of mafia, r12144 or later and copy/paste the following line into the CLI:
svn checkout https://svn.code.sf.net/p/mafiachit/code/
 
Last edited:
it could just be due to my web proxy since i play from work .. but i'm getting the following from within mafia, I can browse to the url via browser using the same web proxy.
Code:
svn checkout https://svn.code.sf.net/p/mafiachit/code/

Unable to connect with repository at /p/mafiachit/code
 
That's a mafia issue, not a ChIT issue. You could ask for help in Community Support. I suspect though that it is a problem with the proxy considering this post. I'll give it a little time and if Roippi doesn't fix it soon, then make a Bug Report.


I will say I am very disappointed that someone is having trouble with this feature since I am seeing it as a godsend for distribution of ChIT to deal with the problem of 33 files in 3 directories. I truly hope that someone will know how to fix your problem. If you can't get sufficient help within 24 hours I'll go back to posting zip files and charpane updates.
 
Last edited:
It looks like chit.css has a couple of references to "/images/relayimages/chit/ ... " which are located in a different folder now. Although, as long as one had previously installed chit before the folder change and didn't delete the old images folder, I guess they will still work.
 
Last edited:
I'm using Warp Launcher - will I need to put that line in the CLI every time it downloads a new build? Is there a way to add this as a breakfast script so that it gets added on start up everytime Mafia runs breakfast?

This has nothing to do with Warp Launcher. Using Warp Launcher does not make this work different in any way from people who aren't using Warp Launcher.

If you want to have mafia check for updates to ChIT automatically every time you login, then go to Preferences -> General -> Check "Update Installed SVN projects on login"


Also, my stats look like this now - I'm not sure if this is related, however.
http://img402.imageshack.us/img402/7398/chitstats.png

Oh dear. That has nothing to do with the svn update, but it might be related to a problem that Chish was experiencing. What browser are you using? Perhaps AlbinoRhino has an idea?


It looks like chit.css has a couple of references to "/images/relayimages/chit/ ... " which are located in a different folder now. Although, as long as one had previously installed chit before the folder change and didn't delete the old images folder, I guess they will still work.

Dagnabit! I missed that. Fixed it to svn. It is so darn nice to be able to change files other than charpane.ash without worrying that people will fail to update them. :D


Updated to r8
  • Fix CSS for changed image directory
  • Situationally highlight outfits I often switch and need to locate in the list
  • Change check version to inform user about "svn update" instead of forum thread


To update ChIT copy/paste the following line into the CLI
svn update

If you have not previously checked out ChIT from the SVN repository, you need to use a daily build of mafia, r12144 or later and copy/paste the following line into the CLI:
svn checkout https://svn.code.sf.net/p/mafiachit/code/
 
Last edited:
That whole character pane looks weird. It looks like the character brick at the top extends past the frame edge on the right. And perhaps it is an artifact of the screenshot, but it looks like all the fonts are bigger than they should be. But yes ... tell us your browser and post your chit settings so an attempt can be made to reproduce it. Could be related to Chish's issue, though everything looks fine for me in FF, Opera, Chrome & IE. Looks like it could also be related to something overriding the font sizes.
 
Thanks for the tip on updating SVN projects.

After fiddling around with things - I think AlbinoRhino's right that it's the font settings. My problem in that screenshot seems to be related to the Firefox addon No Squint. I typically run it with text zoom set to 140% thanks to my crap eyesight. (I'm using FF21, on Win8, btw.) When I set the No Squint zoom back down to anything under 125%, the problem goes away. I've been using No Squint for ages, along with Chit and I haven't experienced this problem before so maybe something changed?

Or maybe not. I understand completely if you don't want to worry about a Firefox extension. I just want to mention it.

cheers!
 
Pretty cool update! Now I just have to figure out how to get it to put my other imported scripts (the chit plugins) to the top of charpane.ash for me.
 
I've been using No Squint for ages, along with Chit and I haven't experienced this problem before so maybe something changed?

Yes. The recent change to accommodate the Chrome browser combined with your FF extension is the problem. Chit puts a lot of information into a small amount of space and I'm not sure a lot could be done to work around unknown user changes to the amounts of space needed. You could always change your local copy of chit.css to remove the change described in post 813 of this thread. With the new svn updating, however, the change may well get overwritten any time you updated chit. I'm not sure on that.
 
You could always change your local copy of chit.css to remove the change described in post 813 of this thread. With the new svn updating, however, the change may well get overwritten any time you updated chit. I'm not sure on that.

Update the copy in /svn/mafiachit/relay, and then copy that to /relay (or wait until there's another change for "svn update" to copy the updated version over for you). The great part about using svn is that the changes will actually stick around now without lots of manual merging (which is what I've had to do for every update for the last year or so).
 
It also just occurred to me that when I was attempting to reproduce the problem, that I fiddled with Firefox's zoom settings. (Ctrl + '+' or Ctrl + '-', to enlarge or decrease the font size, Ctrl + '0' to reset to normal). For me, Firefox correctly adjusted the frame size to accommodate the new font sizes. Perhaps that could work for you, rather than using an extension to do the zooming for you.
 
Update the copy in /svn/mafiachit/relay, and then copy that to /relay (or wait until there's another change for "svn update" to copy the updated version over for you). The great part about using svn is that the changes will actually stick around now without lots of manual merging (which is what I've had to do for every update for the last year or so).

Oh cool. So changes to the 'working copy' will be merged with the 'repo copy' before being pushed to the 'local copy' ?
 
Oh cool. So changes to the 'working copy' will be merged with the 'repo copy' before being pushed to the 'local copy' ?

Yup.

Right now it's clunky that you also need to manually copy your changes to the local copy (svn update will just do nothing until there are actual changes to the WC file from the repo) but I'm working on that.
 
Bale - I would like to change the icon for the Tracker brick. Right now, it uses the same icon as the Questlog (because I just copied what was available at the time).

I like these:
book_open.png
award_star_gold_3.png

thoughts?

Made the change to the SVN. They were both nice and I chose the first, but if you decide that you like the second one better, just let me know and I'll switch it. Thanks the the awesomeness of svn it would be no big deal to change the image. :)

To see the new icon: svn update
 
Thanks Bale. I like the book.

One more thing I found while expeimenting with softcore runs (I know, right???)

One strategy is to pull the Book of Pirate Insults, and hunt insults while finding the outfit. The current tracker only displays the insult count if you are wearing the outfit.

Perhaps we can change (line 3122)
PHP:
if(available_amount($item[pirate fledges])==0 && is_wearing_outfit("Swashbuckling Getup")) {

To something like
PHP:
if(available_amount($item[pirate fledges])==0 && item_amount($item[The Big Book of Pirate Insults])>0) {
 
Back
Top