Character Info Toolbox

Hmmm.... The copy of charpane.ash in the ChIT SVN directory and in the /relay directory are identical. Both have a chitVersion string of 0.8.5, are 210 KB in size, and are 5601 lines in length. Nowhere in the file is the source.contains_text check for "Spelunkin".

Any thoughts?
 
Just thought I'd post here about a modification I just added to my copy. I use the right-click favorite familiar menu all the time, and didn't like how it was full of familiars I couldn't use in Standard.

The below function removes currently restricted familiars from the right-click favorite familiiars menu.
Code:
buffer removeRestrictedFamiliars(buffer result) {
	matcher famfavmatch = create_matcher("(var FAMILIARFAVES = .+?\\];)",result);
	if (famfavmatch.find()) {
		string replacefamfavs = "var FAMILIARFAVES = [";
		matcher singlefamfavmatch = create_matcher("(\\[.+?,(\\d+)\\])",famfavmatch.group(1));
		while (singlefamfavmatch.find()) if (is_unrestricted(to_familiar(to_int(singlefamfavmatch.group(2))))) {
			string singlefamfav = singlefamfavmatch.group(1);
			singlefamfav = replace_string(singlefamfav,"[[","[");
			replacefamfavs += singlefamfav + ",";
		}
		replacefamfavs+="];";
		replacefamfavs .replace_string("= [[[","= [[");
		result.replace_string(famfavmatch.group(1),replacefamfavs);
	}
	return result;
}
I call it at the end of bakeHeader()
Code:
	result.removeRestrictedFamiliars();
	chitBricks["header"] = result.to_string();
 
Last edited:
Hmmm.... The copy of charpane.ash in the ChIT SVN directory and in the /relay directory are identical. Both have a chitVersion string of 0.8.5, are 210 KB in size, and are 5601 lines in length. Nowhere in the file is the source.contains_text check for "Spelunkin".

There was an issue with the updating of the fix to handle Spelunkin'. It should now be taken care of if you would update the script again. Sorry for the problem.


Just thought I'd post here about a modification I just added to my copy. I use the right-click favorite familiar menu all the time, and didn't like how it was full of familiars I couldn't use in Standard.

I'm going to look over your code and decide how I should use it. Thank you.

Can you think of any way to modify the familiar menu to use the special ChIT image for the Crimbo Shrub?
 
Can you think of any way to modify the familiar menu to use the special ChIT image for the Crimbo Shrub?
You could replace "/images/scripts/familiarfaves.20120307.js" with a modified js that uses your preferred image when it constructs the pop up window.
You could change the shrub image in mafia's image cache instead of doing the image replacement in ChIT.
Or as a compromise between the two, you could put the modified image in mafia's cache with a modified name, then use the new name when constructing the new FAMILIARFAVS array from my function. It passes familiar name, type, image and id - e.g. ["Cratchit","Crimbo Shrub","crimboshrub",189]
 
Just started using ChIT and let me say I'm loving it, thanks for all the hardwork.

Found something weird that can be seen in this image: http://i.imgur.com/5rCBG34.png for some reason ChIT isn't picking up the florist flowers I have planted in level 1 of gamer dungeon. Could it be because I planted them before installing ChIT? Also, while it does let me plant a new plant in level 1 via ChIT that plant still doesn't show up afterwards.
 
Technically that's a mafia issue. KoL's name for the location is surrounded by [], and I don't want to make mafia match that (which is required for mafia to recognize that a location has flowers planted), so mafia doesn't recognize the flowers there.
 
darkcodelagsniper: I'm sorry to inform you that you'll have version conflicts to iron out because I added your code to my script mostly intact. Thank you very much for that.


You could replace "/images/scripts/familiarfaves.20120307.js" with a modified js that uses your preferred image when it constructs the pop up window.

I already have a variant familiarpicklist in chit.js so could you show me how to remake it with full directory paths in the familiar picker? If there was an overloaded version which accepted a directory parameter then I could change it to ["Cratchit","Crimbo Shrub","/images/relayimages/chit/","crimboshrub_fxx_ckb",189], but unfortunately I have no idea how to make a version that does that or even if it is possible. If you have the java skills could you help me?


Or as a compromise between the two, you could put the modified image in mafia's cache with a modified name, then use the new name when constructing the new FAMILIARFAVS array from my function. It passes familiar name, type, image and id - e.g. ["Cratchit","Crimbo Shrub","crimboshrub",189]

I don't want to try to modify the version in mafia's image cache and I'm pretty sure scripts aren't even allowed to do that.
 
Last edited:
I have basically zero java skills other than what I've picked up via ASH. However it turns out that's actually quite sufficient!

Here's a replacement for the fampicker function now in chit.js
It accepts an optional fifth variable from the FAMILIARFAV entry, for an imgpath other than the default:
Code:
	get_pick: function (choices, caller) {
		self.kill();
		var ht = '<ul style="padding: 0; margin: 0; font-size: 8pt">';
		var fam, name, imgpath;
		var style = self.style();
		for (var i=0; i<choices.length; i++) {
			fam = choices[i];
			if (fam[3] == CURFAM) continue;
			name = fam[0];
			if (fam[4]) 
				imgpath = fam[4];
			else
				imgpath = "http://images.kingdomofloathing.com/itemimages/";
			if (style == 2)
				ht +='<li>·<a href="#" class="picker" rel="'+fam[3]+'" title="'+name+'">'+fam[1]+'</a></li>';
			else if (style == 3)
				ht +='<a href="#" class="picker" rel="'+fam[3]+'" title="'+name+' (the '+fam[1]+')" style="padding-left: 4px;"><img src="'+imgpath+fam[2]+'.gif" border="1" /></a></li>';
			else
				ht +='<li>·<a href="#" class="picker" rel="'+fam[3]+'" title="(the '+fam[1]+')">'+name+'</a></li>';
		}
		ht +='</ul>';
		ht += '<div class="settype" style="padding-top: 3px; font-size:7pt">show: <a href="#" rel="1">name</a> <a href="#" rel="2">type</a> <a href="#" rel="3">image</a></div>';
		var $div = $('<div><div style="color:white;background-color:blue;padding:2px 15px 2px 15px;white-space: nowrap;text-align:center" class="title">Favorites</div><img class="close" style="cursor: pointer; position: absolute;right:1px;top:1px;" alt="Cancel" title="Cancel" src="/images/closebutton.gif"/><div style="padding:4px; text-align: left" class="guts">'+ht+'</div><div style="clear:both"></div></div>');
		var pos = caller.offset();
		$div.css({
			'position': 'absolute',
			'text-align': 'right',
			'background-color': 'white',
			'border': '1px solid black',
			'margin-left': '2px',
			'width': '97%',
			'top': pos.top - 24,
			'left': 0
		});
		$('body').append($div);
		if ((pos.top + $div.height() + 30) > $(document).height()) {
			$div.css('top', (pos.top - $div.height() + 20));
		}
		$div.find('.close').click(self.kill);
		$div.find('.settype a').click(function () {
			self.set_style($(this).attr('rel'));
			self.get_pick(choices, caller);
			return false;
		}).each(function () {
			var st = style == 0 ? 1 : style;
			if ($(this).attr('rel') == st) $(this).css('text-decoration','none');
		});
		$div.find('.picker').click(function () {
			self.pick($(this).attr('rel'));
			$(this).parents('div.guts').html('Inviting <b>'+$(this).text()+' '+$(this).attr('title')+'</b> to join you.');
			return false;
		});
		self.pickdiv = $div;
	},

I tested it out by inserting an additional line in bakeHeader()
Code:
			string singlefamfav = singlefamfavmatch.group(1);
			singlefamfav = replace_string(singlefamfav,'"crimboshrub",189','"crimboshrub_fxx_ckb",189,"http://images.kingdomofloathing.com/relayimages/chit/"');
Seems to do the trick nicely :)
 
That was surprisingly simple!

I'll roll out that change once I break the prism and test it with my Happy Medium. I've been wanting to do that for my Happy Medium virtually forever and while that familiar isn't important anymore I still intend to give it the full treatment.
 
I've been wanting to do that for my Happy Medium virtually forever and while that familiar isn't important anymore...
I will always have a fond spot in my heart for my Happy Medium, even though I can no longer use her in Restricted runs.
 
It is nice to know that I am not the only one with such feelings for her. She's an amazing familiar who has served me well for many years now. She will be missed on my restricted runs.
 
I have started a very basic override for the Spelunkin charpane. Right now all it does is show # of combats and NC phase #. I find it really helpful... and will there is a start of adding spoiler info for your buddy.
Is this interesting to add to Chit? Or better server by a separate script like this: http://kolmafia.us/showthread.php?17575-Spelunkin-Information

There is no reason we could not make this into a Chit-like look and feel for the Spelunkin charpane, and add helper info when a NC is available.
 
I don't want to make the Spelunkin' charpane look like ChIT. I like it having its own feel there isn't any reason for it to be cluttered enough to actually need the ChIT treatment, unlike KoL's regular charpane.

Adding number of combats and phase number is a good idea. I've done that now. I've also added a tooltip with Buddy information. It's a tooltip because I don't want to clutter the wonderful austere feel of Spelunkin'.

Updated ChIT with the previously discussed changes to familiar picker (I ended up implementing it differently for synergistic effects), so that it now shows my Happy Medium in color! Thanks for your help, darkcodelagsniper, I couldn't have done this without you pointing out exactly how this should work.

I also added darkcodelagsniper's wonderful animation for the Golden Monkey because it just blows away KoL's version.
 
Cool stuff :)

One minor issue - there seems to be a problem with recognising the L'il Xenomorph.
Everything works fine except the image in the picker which goes to "itemimages\debug.gif".
I'm a little mystified by it, since to_familiar("L\'il Xenomorph") works fine. Maybe it's getting munged to "L\\'il Xenomorph"?

This change in the relevant line in bakeHeader() resolves it:
Code:
familiar fam = to_familiar(replace_string(singlefamfavmatch.group(1),"\\",""));
 
I'm in a standard run right now so I cannot test that, but I trust you so I'll just push out that update now and check it later.
 
I decided to uninstall this, as cool as it is, until it supports the Ed path better. Most notably, it should show the servant instead of the familiar.
 
I decided to uninstall this, as cool as it is, until it supports the Ed path better. Most notably, it should show the servant instead of the familiar.

I thought I was supporting that. Did you not upgrade the script before deleting it or am I still missing something important? This is what I am looking at right now:

FBYaJhD.png
 
Last edited:
It showed the servant for me. Also, apparently wrldwzrd89 doesn't know that he could just use zlib chit.disabled = true to turn the script off (mostly) temporarily, and that he can even add a button to the bottom to quickly turn it off.

The only thing I found missing for Ed (that doesn't rely on more KoLmafia support) is displaying your current Ka.
 
Back
Top