Character Info Toolbox

Bale

Minion
Was that wrong? You could right-click if you don't want both. If someone would tell me how to get the picker for a right-click and still have the description for a left-click, maybe that would be better?

Feedback is very welcome. Also welcome is help implementing feedback. The two need not be linked.
 

Darzil

Developer
I am getting (on Firefox, Chrome and IE) a blank Elements box. It appears to be displaying "/images/relayimages/chit/elements2.gif" which is a blank 30x30 square though the html says to render it at 190x190.
 

Bale

Minion
Are you saying that /images/relayimages/chit/elements2.gif is a blank 30x30 square or it is being displayed as a 30x30 square? If the former, then it was some sort of download issue. If the later, then I cannot replicate the problem...
 

Darzil

Developer
Thanks. Deleted chit, reinstalled chit, cleared browser cache and then it worked fine, and the image was no longer blank, and was 9k rather than 1k.
 

Lxndr

Member
> svn update mafiachit

Validating repo...
Repo validated.
Updating mafiachit...
svn: E155004: There are unfinished work items in 'C:\Users\MiniPC\Dropbox\Mafia\svn\mafiachit'; run 'svn cleanup' first.
Done.
Requests complete.


When I run 'svn cleanup' NOTHING HAPPENS. No message. I try both 'svn cleanup' and 'svn cleanup mafiachit'. Nothing.
Then I svn update again, and this happens again.

Things otherwise seem to be working perfectly fine.
 

roippi

Developer
that is a message from the svn client, not mafia. Mafia doesn't have a hook to run that command (though it could).

Somehow you got svn into a state where it has some locked files. Either use an external svn client to do the cleanup operation, or delete/re-checkout the project. I'm out of the country until Sunday so I can't expose the "svn cleanup" command to the mafia cli until then.
 

Lxndr

Member
No idea how to find an external svn client.

But deleting and re-checkng out worked! Thanks!

Hope you get the cleanup working in future builds.
 

caelea

New member
Hi Bale, I've been having an annoying problem with CHiT recently (since just after the class skill revamps began). It keeps on displaying a blank space between My Stats and Effects. Resizing the left pane restores it but any data change (switching equipment, stat change, meat +/-) that refreshes the pane ends up with the blank space again.

http://i.imgur.com/TQYerGA.jpg <-- here's a screen shot.

I'm using chrome (ver31 - up to date) and daily mafia builds. I've tried clean installing CHiT again but I end up with the same problem. I have not changed any of the default CHiT preferences except for showing avatar and title. In any case, the problem persisted even with those 2 options set to true.

Any ideas?

So looks like the "problem" is magnifying my browser window - no extra large space when I reset the window to 100%, and blank space starts appearing if I increase the magnification.
 

Bale

Minion
That's certainly interesting. Can anyone here who knows a lot about browsers suggest how to deal with that?
 

hesuchia

Member
Don't know if anybody else mentioned if they've fixed the familiar favorites going off the page problem. I think I might have. I switched

chit.floor.layout update,familiar

so now it's "familiar,update" instead. I haven't tested super extensively but it seems to be acting fine now.

edit: nope nevermind still doesn't work.
 
Last edited:

ereinion

Member
I don't know how hard this would be to implement, but I've been trying to collect some factoids for the various blobs of gray goo lately, and so I was wondering if you could put in some kind of counter for how charged the nanorhino is in the familiar block? Considering that you already get the information at the end of the combat text it is not a huge deal, especially considering that I probably won't bother much with the rhino once I'm done collecting the factoids, but even so I figured it wouldn't hurt to ask.
 

Bale

Minion
You're requesting a mafia feature, not a ChIT feature. Unless mafia recognizes and compiles the information for charging the nanorhino I can't expose it with ChIT. Request new features HERE.

If your feature is implemented by KoLmafia and the information is displayed by KoLmafia in the same manner as other familiar spoilers, like grinder pie generation, then it will immediately be displayed by ChIT without my needing to update ChIT.
 

ereinion

Member
Ah, I figured it was already tracked, guess I should have tried searching for the pref first :p Sorry for cluttering up your thread, and thanks for the reply :)
 

ckb

Minion
Staff member
I would like to add effect modifier details for all the effects and buffs in the Effects brick. This is mostly because I am getting old and this game keeps getting bigger, and I never remember what all this stuff does.

I wrote this as an addition to each buff, with the modifier pulled from string_modifier().
It would be easy to also add this as an option in the chit.vars

updated: record buff and buff parseBuff(string source)

PHP:
record buff {
	string effectName;
	string effectHTML;
	string effectImage;
	string effectType;
	string effectMod;
	int effectTurns;
	boolean isIntrinsic;
};

buff parseBuff(string source) {
	buff myBuff;

	boolean doArrows = get_property("relayAddsUpArrowLinks").to_boolean();
	boolean showIcons = (vars["chit.effects.showicons"]=="false" || isCompact)? false: true;

	string columnIcon, columnTurns, columnArrow;
	string spoiler, style;

	matcher parse = create_matcher('(?:<td[^>]*>(.*?)</td>)?<td[^>]*>(<.*?itemimages/([^"]*).*?)</td><td[^>]*>[^>]*>(.*?) \\((?:(.*?), )?((?:<a[^>]*>)?(\\d+||∞)(?:</a>)?)\\)(?:(?:</font>)? (<a.*?</a>))?.*?</td>', source);
	// The ? stuff at the end is because those arrows are a mafia option that might not be present
	if(parse.find()) {
		columnIcon = parse.group(2);	// This is full html for the icon
		myBuff.effectImage = parse.group(3);
		myBuff.effectName = parse.group(4);
		spoiler = parse.group(5);		// This appears for "Form of...Bird!" and "On the Trail"
		columnTurns = parse.group(6);
		if(parse.group(7) == "∞") {	// Is it intrinsic?
			myBuff.effectTurns = -1;
			myBuff.isIntrinsic = true;
		} else
			myBuff.effectTurns = parse.group(7).to_int();
		// There are various problems with KoL's native uparrows. Only use them if KoL's uparrows are missing
		if(parse.group(8) != "")
			columnArrow = parse.group(8).replace_string("/images/", imagePath).replace_string("up.gif", "up.png");
		else if(parse.group(1) != "" ) {
			doArrows = true;			// In case they were disabled in KoLmafia. Make a column for it.
			columnArrow = parse.group(1);
		}
	}
	string effectAlias = myBuff.effectName;
	
	
	//ckb: Get effect modifier for current buff
	myBuff.effectMod = string_modifier(myBuff.effectName,"modifiers");
	
	
	
	
	//Apply any styling/renaming as specified in effects map
	if(chitEffectsMap contains myBuff.effectName) {
		matcher pattern = create_matcher('(type|alias|style|href|image):"([^"]*)', chitEffectsMap[myBuff.effectName]);
		while(pattern.find()) {
			switch(pattern.group(1)) {
			case "type":
				myBuff.effectType = pattern.group(2);
				break;
			case "alias":
				// "href" might come before alias, so...
				effectAlias = effectAlias.replace_string(myBuff.effectName, pattern.group(2));
				break;
			case "style":
				style = pattern.group(2);
				break;
			case "href":
				effectAlias = '<a href="'+pattern.group(2)+'" target=mainpane>' + effectAlias + "</a>";
				break;
			case "image":
				if(vars["chit.effects.modicons"].to_boolean()) {
					string image = pattern.group(2);
					if(image == "corpsetini" && gameday_to_string() == "Boozember 7")
						image = "turkeyleg";
					columnIcon = columnIcon.replace_string(myBuff.effectImage, image);
					myBuff.effectImage = image;
				}
				break;
			}
		}
	}
	
	// Flavour of Magic picker!
	if($strings[Spirit of Cayenne, Spirit of Peppermint, Spirit of Garlic, Spirit of Wormwood, Spirit of Bacon Grease] contains myBuff.effectName) {
		columnIcon = '<a class="chit_launcher" rel="chit_pickerflavour" href="#">' + columnIcon + '</a>';
		columnTurns = '<a class="chit_launcher" rel="chit_pickerflavour" href="#">∞</a>';
		pickerFlavour();
	}

	//Add spoiler info
	if(length(spoiler) > 0)
		effectAlias += " "+spoiler;
	// Fix for blank "On the Trail" problem.
	if(length(effectAlias) == 0)
		effectAlias = myBuff.effectName;
	
	//Replace effect icons, if enabled
	string [string] classmap;
		classmap["at"] = "accordion.gif";
		classmap["sc"] = "club.gif";
		classmap["tt"] = "turtle.gif";
		classmap["sa"] = "saucepan.gif";
		classmap["pm"] = "pastaspoon.gif";
		classmap["db"] = "discoball.gif";

	if ((index_of(vars["chit.effects.classicons"], myBuff.effectType) > -1) && (classmap contains myBuff.effectType)) {
		columnIcon = columnIcon.replace_string(myBuff.effectImage, classmap[myBuff.effectType]);
		myBuff.effectImage = classmap[myBuff.effectType];
	}

	buffer result;
	result.append('<tr class="effect"');
	if(length(style) > 0)
		result.append(' style="' + style + '"');
	result.append('>');
	if(showIcons) 
		result.append('<td class="icon">' + columnIcon + '</td>');
	result.append('<td class="info"');
	if(doArrows && myBuff.isIntrinsic)
		result.append(' colspan="2"');
	result.append('>');
	result.append(effectAlias);
	
	
	
	//ckb: Add modification details for buffs and effects
	if (length(myBuff.effectMod)>0) {
		result.append('<br><small style="color:gray">');
		result.append(myBuff.effectMod);
		result.append('</small');
	}
	
	
	
	result.append('</td>');
	if(myBuff.isIntrinsic) {
		result.append('<td class="infinity');
		if(!doArrows)
			result.append(' right');
		result.append('">');
	} else {
		if(!doArrows)
			result.append('<td class="right">');
		else if (columnTurns != "")
			result.append('<td class="shrug">');
		else
			result.append('<td class="noshrug">');
	}
	result.append(columnTurns);
	result.append('</td>');
	if(doArrows && !myBuff.isIntrinsic) {
		if(columnArrow == "")
			result.append('<td> </td>');
		else {
			result.append('<td class="powerup">');
			result.append(columnArrow);
			result.append('</td>');
		}
	}
	result.append('</tr>');
	myBuff.effectHTML = result.to_string();
	
	return myBuff;
}

buffs.JPG
 

Bale

Minion
That's interesting. Although you probably wanted to use string_modifier(myBuff.effectName,"Evaluated Modifiers") so that instead of
Smithsness: +25, Muscle Percent: [K], Mysticality Percent: [K], Moxie Percent: [K]

you'd see
Smithsness: +25, Muscle Percent: +30, Mysticality Percent: +30, Moxie Percent: +30
Much better, eh?

I'll add it for you. I simplified the code a lot which is going to leave some of your changes unconflicted, but useless -- be careful when you resolve the differences. Also, you will need to zlib chit.effects.describe = true, because a lot of people will be troubled by all the clutter.

It would be a lot more effective if you wrote an interpreter for effectMod which would combine effects into "all res," "prismatic dmg" and "all stats" since there are a lot of modifiers that effect all 5 elements or all 3 stats. That way instead of "Cold Resistance: +2, Hot Resistance: +2, Sleaze Resistance: +2, Spooky Resistance: +2, Stench Resistance: +2" we'd see "All Resistance: +2" which is so much more readable. I'll leave that to you if you want it.
 
Last edited:

ckb

Minion
Staff member
Thanks bale. I put this together somewhat quickly as a proof-of-concept. Your implementation looks slick.
We can probably steal a lot of this modifier code interpretation from Enhanced Inventory Spoilers... we may even be able to re-use the exact code with some dependency (if it helps). I will look into it.
 

Bale

Minion
I don't use Enhanced Inventory Spoilers, so I did not know that it would do that. The screenshots certainly suggest that it doesn't do that. I guess the feature was added after the screenshots were posted?

See if you can make a version that does not add dependencies to this script. I really don't want to have Enhanced Inventory Spoilers added to everyone's relay browser because they want to use ChIT.
 

Bale

Minion
Even if you don't use a defective gg token there are some pretty big blocks. Testing it out revealed large complicated blocks. That's why I'm not enabling it by default. This script already has enough options though that I can't see denying it another, especially since ckb has contributed some nice stuff in the past.
 
Top