Character Info Toolbox

Magus_Prime

Well-known member
You may already be aware of this but r11896, and the added support for the Giant's Castle revamp, seems to have broken CHIT. I got this in the gCLI on logging in this morning:

Code:
1251 prices updated from http://kolmafia.us/scripts/updateprices.php?action=getmap
giant's castle (basement)
giant's castle (ground floor)
giant's castle (top floor)
Multiple matches against giant's castle.
Bad location value: "giant's castle" (charpane.ash, line 517)
giant's castle (basement)
giant's castle (ground floor)
giant's castle (top floor)
Multiple matches against giant's castle.
Bad location value: "giant's castle" (charpane.ash, line 517)

Replacing line 517 with the following seems to fix the problem:

Code:
rewards[$location[giant's castle (top floor)]] = "inhaler.gif|Mick's IcyVapoHotness Inhaler|95";
 

Bale

Minion
Mafia already does it if you have "Cache images" set to true and replaces all references of kingdomofloathing.com with 127.0.0.1:60080. CHIT has, on line 1563, a direct reference to images.kingdomofloathing.com while nowhere else seem to use a direct reference to the KoL URLs.

Ah. You're right. The bug is mine. I'll fix it.

You may already be aware of this but r11896, and the added support for the Giant's Castle revamp, seems to have broken CHIT. I got this in the gCLI on logging in this morning:

I wasn't playing KoL for the last four hours so I hadn't even noticed. :) It is pretty darn easy to fix, so I'll do so. Between this and the problem that Winterbay noticed it's time to spin a new release even though it's barely been a day.



Updated to 0.7.6.1
  • Fix image caching problem for Jarlsberg's familiars
  • Use color to make it clear when a companion cannot be summoned
  • Fix for new Giant's Castle (this'll break a lot of scripts!)

Since last version only charpane.ash has been changed
Download to /relay directory: View attachment 7419

If you missed the 0.7.6 update yesterday you'll also need this:
Download to /relay directory: View attachment 7416
 
Last edited:

AlbinoRhino

Active member
Bale,
For many ascensions, I have noticed that the valhalla character pane was reporting my karma as "??". Today I finally took a look at this. Attached is the unmodified charpane html.

It appears that the matcher on line 2888 of v0.7.6.1 ( ie the "regular familiar" matcher in parsePage() ) is actually capturing the karma and familiar information together.

I changed line 2936 (karmaMatcher) to look for karma info in chitSource["familiar"] rather than chitSource["wtfisthis"] and my karma is once more being appropriately reported in the charpane.

I realize this is a minor issue, but thought you might want to know for future versions.

Thanks again for maintaining this great script.
 

Attachments

  • charpane.php.htm.txt
    7.3 KB · Views: 112

Bale

Minion
A solution like that isn't likely to work for everyone since it does properly parse karma for my character. I'll have to find a solution that works for both of our charpanes. Thanks for the html.
 
Last edited:

AlbinoRhino

Active member
Aye. That was mainly why I decided to post about it. I thought you might want to develop a more elegant solution than my quick and dirty fix.
 

Bale

Minion
Updated to 0.7.6.2
  • The Egg Man skill summons an Eggman. Seriously? Bug fix.
  • Improve karma parsing for people who place their familiars first like AlbinoRhino.
    It's kinda kludgy, but it should work and I can make a better fix later.

Since last version only charpane.ash has been changed
Download to /relay directory: View attachment 7450
 

AlbinoRhino

Active member
Huh. I don't ever remember playing with the familiar before effects. CHIT certainly puts it at the bottom. But, looking through my KoL options, I see that "Display Familiar Below Effects" is indeed unchecked. I guess that I could have fixed the Valhalla karma thing by just checking that option ? In any event, thanks again Bale.
 

Bale

Minion
Yep. Checking the KoL option for that would have "fixed" it, but honestly it was a ChIT bug not to be able to handle the issue. Thank you for finding it and helping me get it fixed.
 

lostcalpolydude

Developer
Staff member
I have Display Familiar Below Effects unchecked, and I'm sure my karma wasn't showing up as ?? or anything strange like that. I haven't updated this script yet, so I guess I can check whenever I decide to start a new ascension, but I feel like I would remember something like that.
 

Bale

Minion
If so then it might be interesting to compare your charpane to his to find out what else he did differently from my own charpane. As long as it works though, I'm happy.
 

Bale

Minion
I'm glad to hear that. It was an embarrassingly crude fix, but I was pretty confident it would work by virtue of its crudity.
 
Can someone help me get started with this? I put everything in the right place, but what am I supposed to do to be able to configure it and etc.? The ReadMe talks about defaults and trues but I don't know where these are.
 

Erich

Member
Can someone help me get started with this? I put everything in the right place, but what am I supposed to do to be able to configure it and etc.? The ReadMe talks about defaults and trues but I don't know where these are.

For me, this is the easiest way to run chit. first, download this script (and it's prereq script)

http://kolmafia.us/showthread.php?4081-ZLib-variable-editor-(relay_zlib-ash)

Then you can do the zlib modifications via the relay browser, which is easier than the alternatives. If at that point you're still confused, feel free to post :)
 

m00g

New member
Hi everyone.

I'm really glad that this is such a friendly forum.
Thank you Bale for all the hard work that you've put into this script.

I have one issue at the moment with running CHiT.
Even after updating to the latest charpane.ash, checking that I've got the latest KolMafia build, I still get this error.

Bad location value: "giant's castle (top floor)" (charpane.ash, line 517)

I"ve tried reloading the scripts and tried Magus_Prime's fix from the previous page.

Any help would be most appreciated.

Thanks,
m00g.
 

AlbinoRhino

Active member
There is a specific problem I would like to ask you about. When KoL is close to rollover there is a 30 minute timer that counts down at the top of the screen. Unfortunately since the css position is absolute none of the elements are pushed lower when that timer appears, so the are positioned right on top of it. I tried changing the position to relative (except for the floor which needed to stay absolute to anchor to the bottom), but doing that screwed up the scroll bar that appears when there are a lot of effects in the walls. How can I fix that?

Bale,

Last night I was finally playing at rollover and noticed this issue myself. I tinkered with it and believe I have it resolved.

It did not require any CSS changes. I am attaching my copy of charpane.ash for your perusal. If you search for "ARedit" you should find the changes I made. I tried it in Firefox & Opera and the rollover timer was added at the top just fine for me. I am constantly tinkering with the scripts I use, so there are possibly other changes to this copy which you may or may not want to use.

One issue that I recall, was that the ASH highlighter for Notepad++ (which I think I originally downloaded from a post on this board by you (?) ... and to which I have added new functions etc. as they've been added to mafia) was going crazy in spots with all of the double quotes and apostrophes. I ironed those out so that the highlighting was no longer broken for me. (Basically, in spots, instead of using apostrophes as delimiters so that you can include double quotes as parts of strings, you can just use double quotes as delimiters and escape any double quote that is part of a string. e.g. "<a href=\"blah\">". Those escaped quotes will still be written to the html correctly & N++ has an easier time of highlighting things.) But, perhaps you weren't having my highlighting problems with this script ?
 

Attachments

  • charpane.ash
    114.7 KB · Views: 25

Bale

Minion
I can't wait 'till rollover so I can try that out! It looks like such a simple change that I can hardly believe it. All I had to do was put it into buildRoof()? Thank you!

PS. I noticed your little problem with huge names losing their important ending. However I decided on a different fix for it. What do you think of the following change to parsePage()

PHP:
	// Recent Adventures: May or may not be present
	parse = create_matcher("(<center><font size=2>.+?Last Adventure:.+?</center>)", source);
	if(find(parse)) {
		chitSource["trail"] = parse.group(1);
		source = parse.replace_first("");
		// Shorten some unreasonable locations
		chitSource["trail"] = chitSource["trail"].replace_string("The Castle in the Clouds in the Sky", "Giant's Castle");
		chitSource["trail"] = chitSource["trail"].replace_string(" Floor)", ")");  // End of Castle
		chitSource["trail"] = chitSource["trail"].replace_string("The Battlefield", "Battle");
	}


One issue that I recall, was that the ASH highlighter for Notepad++ (which I think I originally downloaded from a post on this board by you (?) ... and to which I have added new functions etc. as they've been added to mafia) was going crazy in spots with all of the double quotes and apostrophes. I ironed those out so that the highlighting was no longer broken for me. (Basically, in spots, instead of using apostrophes as delimiters so that you can include double quotes as parts of strings, you can just use double quotes as delimiters and escape any double quote that is part of a string. e.g. "<a href=\"blah\">". Those escaped quotes will still be written to the html correctly & N++ has an easier time of highlighting things.) But, perhaps you weren't having my highlighting problems with this script ?

I recommend downgrading Notepad++ to version 6.1.8 to fix the highlighting problem. Very annoyingly they "improved" their context highlighting so that I can't make it work with ash. I have had to turn off automatic updating.
 

lostcalpolydude

Developer
Staff member
I apparently have Notepad++ 5.9.6.2 and noticed the same highlighting issues from double quotes. Perhaps it was improved and then worsened. I "fix" it in my copy of the script by adding #" to the end of the line to contain the improper highlighting at least.
 

AlbinoRhino

Active member
I can't wait 'till rollover so I can try that out! It looks like such a simple change that I can hardly believe it. All I had to do was put it into buildRoof()? Thank you!

PS. I noticed your little problem with huge names losing their important ending. However I decided on a different fix for it. What do you think of the following change to parsePage()

PHP:
    // Recent Adventures: May or may not be present
    parse = create_matcher("(<center><font size=2>.+?Last Adventure:.+?</center>)", source);
    if(find(parse)) {
        chitSource["trail"] = parse.group(1);
        source = parse.replace_first("");
        // Shorten some unreasonable locations
        chitSource["trail"] = chitSource["trail"].replace_string("The Castle in the Clouds in the Sky", "Giant's Castle");
        chitSource["trail"] = chitSource["trail"].replace_string(" Floor)", ")");  // End of Castle
        chitSource["trail"] = chitSource["trail"].replace_string("The Battlefield", "Battle");
    }




I recommend downgrading Notepad++ to version 6.1.8 to fix the highlighting problem. Very annoyingly they "improved" their context highlighting so that I can't make it work with ash. I have had to turn off automatic updating.

That looks like a much more elegant solution to the long names than what I cobbled together.

Apparently, I have Notepad 6.3, but I seem to remember running into this problem with earlier versions as well. However, my highlighting works fine as far as I can tell. But I have a habit of escaping double-quotes when they aren't a delimiter, which also seems to prevent Notepad from getting confused. And I see that, Lostcal has a much more simple and elegant solution to that as well ! Oh well, I will learn to code one of these days ....

Also, you can use the debugging line I added to force the rollover box to appear, if you don't want to wait until rollover to see how it looks.
 
Top