Character Info Toolbox

Found a bug; not sure if this is the right place to mention it. If you equip the makeshift SCUBA gear (only that), you'll wind up with a division by zero error, as SCUBA is exactly -100 item drop.

From bakeModifiers():
Code:
result.append('<td class="info">' + ceil(100 * (100.0/(100 + item_drop_modifier()))) + '%</td>');
 
Last edited:
For a freakishly long example...
> ashq int best = 0; string found; string [int] modstring; string [int] modsplit; foreach fam in $familiars[] { found=string_modifier("Throne:"+to_string(fam), "modifiers"); if (found.length() > 3) { modstring = split_string(found, ","); foreach i in modstring { modsplit = split_string(modstring, ":"); if (modsplit[0] == "Item Drop" && modsplit[1].to_int() > best) { best = modsplit[1].to_int(); print_html("New best "+modsplit[0]+" is "+fam+": "+modsplit[1]); } } } }

New best Item Drop is Reassembled Blackbird: +10
New best Item Drop is Li'l Xenomorph: +15
Broken down:
We're saving each modifier string into a string we can muck with named found.
Code:
foreach fam in $familiars[] { found=string_modifier("Throne:"+to_string(fam), "modifiers");
We check to make sure there's actually something there... we might be able to skip this, but I prefer a bit more sanity-checking when possible.
Code:
if (found.length() > 3) {
We split the verified-existing modifier into each unique modifier by using the comma, and then break the modifier name and its effect by using colons.
Code:
modstring = split_string(found, ","); foreach i in modstring { modsplit = split_string(modstring[i], ":");
Test to see if it's the modifier we want (can put whatever we want in there) and if so, if it's better than the best we've found so far. If so, save the new 'best' value and report our findings to the player.
Code:
if (modsplit[0] == "Item Drop" && modsplit[1].to_int() > best) { best = modsplit[1].to_int(); print_html("New best "+modsplit[0]+" is "+fam+": "+modsplit[1]);
 
That is pretty cool, I won't deny. It still doesn't know about the secondary effects though. Even if only for myself, I'll continue to work on this little script of mine. :)
 
First off, this is a really visually appealing mod; hats off to the amount of time it must have taken to get that feel for the UI. Second, I like the nomenclature for bricks, etc. Thanks for creating & maintaining this project!

I'm also pretty impressed with the look that Chez invented.

My question is one about extensibility; ideally to make a new brick, I could have my own script file, and just have a configuration file load it. What would you think of the changes below? Do you want code suggestions such as these?

1. Changes to charpane.ash:
a. Changes to bakeBrick() method to allow brick discovery; I added the default case that dynamically bakes bricks, as well as the helpers/updates cases that are special cases that do not get "baked":

2. Pluggable bricks as a result:
a. Import at the top of the file:
b. Example (work-in-progress) new brick (note that this is in a separate file, "Chit Brick Outfits.ash" that lives in the scripts folder):

3. Simply add your new brick to the list in the config file (note the casing...):

The best thing is that now when ChIT is updated, I don't have to re-add my bricks; they're in separate files. The bad is the casing of the default bricks (character vs. Character .... when the method name is bakeCharacter); if not for the ones that you get out of the box, you'd be able to use the "call buffer bakeXXXX" for all of them, and get rid of that case statement. To do so, the bakeXXXX methods for the default cases (e.g. bakeCharacters would need to return a buffer instead of void). The above code with the switch statement wouldn't require those changes though.

Also bad is that if you put something in the config that doesn't exist, lets say "NonexistantBrick", the script will die as it tries to call a method that doesn't exist - bakeNonexistantBrick(), but you'll get a message that says this in the mafia log.

Any chance of this change making it into the code?

That's pretty darn cool. It will also make it easy for Soluzar to test his sample brick.I'm a little bit concerned that it will cause people with badly configured preferences to have errors. How about we make a small change to limit the possibility of error...

Code:
default:
	if(index_of(brick, "plugin") == 0) {
		brick = brick.replace_string("plugin", "bake");  //e.g. pluginOutfits();
		chitBricks[brick] = call buffer brick();
	}
	break;

Now you say pluginOutfits and it calls bakeOutfits. If it doesn't start with plugin, then nothing will happen.



Found a bug; not sure if this is the right place to mention it. If you equip the makeshift SCUBA gear (only that), you'll wind up with a division by zero error, as SCUBA is exactly -100 item drop.

Thank you. I can't think of a better place to mention it. Made a simple fix to ensure that drop rates of less than 1 produce appropriate output...

Code:
string forcedDrop(float bonus) {
	if(item_drop_modifier() + bonus <= 0)
		return "--";
	return ceil(100 * (100.0/(100 + item_drop_modifier() +bonus))) + '%';
}

...

	result.append('<td class="info">' + forcedDrop(0) + '</td>');

... and a little bit later...

		result.append('<td class="info">' + forcedDrop(numeric_modifier(drop)) + '</td>');
 
That's pretty darn cool. It will also make it easy for Soluzar to test his sample brick.I'm a little bit concerned that it will cause people with badly configured preferences to have errors. How about we make a small change to limit the possibility of error...

I would love this too. I wanted to code in my own brick to add into the toolbar, because I have a few things I want chit to do that I wouldn't want included in the official release. Thanks for the consideration!
 
It will also make it easy for Soluzar to test his sample brick.
My brick is a bit better by now than the last time you saw it. It no longer relies on the effects being coded right into the ash script itself. It loads them from a data file instead. I know I can get the main effect from Mafia's modifiers, but I'd still be loading a certain amount of data from an external source, so why not go the whole hog. I'm not skilled enough to implement a little popup menu such as the one you have for choosing favourite familiars or familiar equipment, but I have set up a relay script to choose familiars for enthronement. It shows their full effect, and can be limited to a range of 'favourite' throne candidates.

I doubt anyone else would care to use these makeshift tools, but I rather like them.
 
Please do it as slyz suggests. It is always better not to need external data files. I know that users appreciate not needing the author to add the data.
 
I'm a little bit concerned that it will cause people with badly configured preferences to have errors. How about we make a small change to limit the possibility of error...

Code:
default:
	if(index_of(brick, "plugin") == 0) {
		brick = brick.replace_string("plugin", "bake");  //e.g. pluginOutfits();
		chitBricks[brick] = call buffer brick();
	}
	break;

Now you say pluginOutfits and it calls bakeOutfits. If it doesn't start with plugin, then nothing will happen.

Glad to hear you like the idea. I think your idea of keeping plugins defined with a named convention like that would definitely help (and remove the need that I had introduced to handle "helpers" and "updates"). As for the string replace, if you're going down that road anyway, why not have the baking method for the plugin just be literally "pluginOutfits()" instead of "bakeOutfits()"? That way there's a little less room for error for a new plugin developer and the names are consistent between the config file and the constructor in the file.

So my working version would then just be:

Code:
default:
	if(index_of(brick, "plugin") == 0) {
		chitBricks[brick] = call buffer brick(); //e.g. pluginOutfits();
	}
	break;

As an aside, I'm just working with this to create an outfit selector brick (although I'm quite eager to see Soluzar's Crown of Thrones brick, too!).
 
Good points! I'm adding it like that. You can change your function to pluginOutfits() and know it will be supported in my next release.

(There's obviously no rush to release that since anyone who would care about it would know how to simply add the code themselves.)
 
Last edited:
Please do it as slyz suggests. It is always better not to need external data files. I know that users appreciate not needing the author to add the data.
Please allow me first to apologize. My original response, before I edited it was not friendly. You see, the way you're encouraging me to write this little add-on for your script is not really the way I want to do it, or planned to do it. I can't honestly say I especially like it the way it would turn out if I followed your advice.

All that said, I understand the reasons behind your views. I can't say I share them, but I do understand.

As such, I'm going to try and do it your way. Here's some code to take a look at:

Code:
void bakeCrown() {
	string famtype = "";
	string famimage = "/images/itemimages/blank.gif";
	string searchtext = "";
	string famfunc = "";

	familiar myfam = my_enthroned_familiar();

	if (myfam != $familiar[none]) {
		famtype = to_string(myfam);
		famimage = '/images/itemimages/'+ myfam.image;
		searchtext = "Throne:"+famtype;
		famfunc = string_modifier( searchtext, "modifiers" );
	}

	string hover = "Visit your terrarium";

	if ( have_equipped($item[crown of thrones]) )
	{
		buffer result;
		result.append('<table id="chit_familiar" class="chit_brick nospace">');
		result.append('<th colspan=2><a target=mainpane href="familiar.php" class="familiarpick" title="' + hover + '">Crown of Thrones</a></th>');
		result.append('<tr><td rowspan=4 class="icon" title="' + hover + '">');
		result.append('<a target=mainpane href="familiar.php" class="familiarpick" title="' + hover + '">');
		result.append('<img src="' + famimage + '"></a></td>');
		result.append('<td><b>'+famtype+'<b></td>');
		result.append('</tr><tr>');
		result.append('<td style="color:blue">'+famfunc+'</td>');
		result.append('</tr><tr>');
		result.append('</tr>');
		result.append('</table>');
		chitBricks["crown"] = result;
	}
}

You can drop that right into CHIT and it will work as is. It has some issues though. If you enthrone the Happy Medium, who gives Meat Drop +15 that looks fine. If on the other hand you enthrone the El Vibrato Megadrone, the full modifier text for that is "Monster Level: +10, MP Regen Min: 10, MP Regen Max: 15" - it looks a bit less tidy. What would be your preferred solution? I suppose it would look OK if I inserted a line break every time there's a comma in that string, but it's still not ideal. Maybe I could replace "MP Regen Min: 10, MP Regen Max: 15" with "MP Regen 10-15" somehow. Right now I can't think exactly how to do it, but it's been a long day for me, which might explain (though not excuse) my earlier grouchiness.
 
Last edited:
I am having trouble with the newest version of ChIT, there is a scrollbar in the "ceiling" section:

Untitled.png

Code:
<html><head>
<meta http-equiv="X-UA-Compatible" content="IE=8" />

<link rel="stylesheet" type="text/css" href="http://images.kingdomofloathing.com/styles.css">
<style type="text/css">
	#nudges div { position: relative; padding: 0px; }
	#nudges div .close { position: absolute; top: -2px; right: -10px; border: 1px solid black; }
</style>
<script language="Javascript" src="/basics.js"></script><link rel="stylesheet" href="/basics.css" />
<link rel="stylesheet" href="chit.css">
</head>
<script src="/images/scripts/window.js"></script>
<script type="text/javascript" src="/images/scripts/jquery-1.3.1.min.js"></script>
<script language=Javascript src="/images/scripts/keybinds.min.2.js"></script>
<script language=Javascript src="/images/scripts/window.20111231.js"></script>
<script language="javascript">function chatFocus(){if(top.chatpane.document.chatform.graf) top.chatpane.document.chatform.graf.focus();}
if (typeof defaultBind != 'undefined') { defaultBind(47, 2, chatFocus); defaultBind(190, 2, chatFocus);defaultBind(191, 2, chatFocus); defaultBind(47, 8, chatFocus);defaultBind(190, 8, chatFocus); defaultBind(191, 8, chatFocus); }</script><script language=Javascript src="/images/scripts/jquery-1.3.1.min.js"></script>
<script type="text/javascript">
var todo = [];
function nextAction() {
	var next_todo = todo.shift();
	if (next_todo) {
		eval(next_todo);
	}
}
function dojax(dourl, afterFunc, hoverCaller, failureFunc) {
	$.ajax({
		type: 'GET', url: dourl, cache: false,
		global: false,
		success: function (out) {
			nextAction();
			if (out.match(/no\|/)) {
				var parts = out.split(/\|/);
				if (failureFunc) failureFunc(parts[1]);
				else $('#ChatWindow').append('<font color="green">Oops!  Sorry, Dave, you appear to be ' + parts[1] + '.</font><br />' + "\n");
				return;
			}

			if (hoverCaller)  {
				float_results(hoverCaller, out);
				if (afterFunc) { afterFunc(); }
				return;
			}			var $eff = $(top.mainpane.document).find('#effdiv');
			if ($eff.length == 0) {
				var d = top.mainpane.document.createElement('DIV');
				d.id = 'effdiv';
				var b = top.mainpane.document.body;
				if ($('#content_').length > 0) {
					b = $('#content_ div:first')[0];
				}
				b.insertBefore(d, b.firstChild);
				$eff = $(d);
			}
			$eff.find('a[name="effdivtop"]').remove().end()
				.prepend('<a name="effdivtop"></a><center>' + out + '</center>').css('display','block');
			if (!window.dontscroll || (window.dontscroll && dontscroll==0)) {
				top.mainpane.document.location = top.mainpane.document.location + "#effdivtop";
			}
			if (afterFunc) { afterFunc(); }
		}
	});
}

	var CURFAM = 18;
	var FAMILIARFAVES = [["Sapphire","Happy Medium","medium_0",159],["Dr. Stompsalot","Pair of Stomping Boots","stompboots",150],["Murray","Hovering Skull","talkskull",163],["Bocoa","Cocoabo","familiar16",16],["Larry","Leprechaun","familiar2",2],["Marco","Animated Macaroni Duck","macaroniduck",85],["Gronald","Hovering Sombrero","hat2",18] ];
</script>

	<script type="text/javascript">
	var turnsplayed = 52859;
var turnsthisrun = 547;
var rollover = 1349407797;
var rightnow = 1349352862;
var playerid = 2118056;
var pwdhash = "ec56db255e385e15397b5114bd1300dc";
var hide_nudges = true;
$(document).ready(function () {
	$('.showall').live('click',function () {
		var hidden = $(this).attr('rel');
		var hd = hidden.split(/,/);
		for (var i=0; i< hd.length; i++) {
			deleteCookie(hd[i], '');
		}
		document.location = 'charpane.php?foo=' + escape(Math.random());
	});
	if (hide_nudges) $('#nudges td div').hover(
		function () {
			if (!hide_nudges) return;
			var ht = '<a href="#" class="close"><img alt="Hide" title="Hide"  src="http://images.kingdomofloathing.com/closebutton.gif" /></a>';
			var c = $(ht);
			$(this).append(c);
			c.click(function () {
				var key = $(this).parents('tr:first').attr('rel');
				$(this).parents('tr:first').remove();
				setCookie(key, 1);
			});
		},
			function () {
				if (!hide_nudges) return;
				$(this).find('.close').remove();
			}
	);
});
</script>
<script language=Javascript src="/images/scripts/charpane.4.js"></script>
<script type="text/javascript" src="/images/scripts/cookie.20100120.js"></script>
<script type="text/javascript">
jQuery(function ($) {
	$(window).resize(function () {
		var winW = 300;
		if (document.body && document.body.offsetWidth) { winW = document.body.offsetWidth; }
		if (document.compatMode=='CSS1Compat' && document.documentElement && document.documentElement.offsetWidth ) { winW = document.documentElement.offsetWidth; }
		if (window.innerWidth && window.innerHeight) { winW = window.innerWidth; }
		setCookie('charpwd', winW, 365, true);
	});
})
</script>

<script type="text/javascript" src="chit.js"></script>
<body onload="updateSafetyText();" bgcolor=white text=black link=black alink=black vlink=black onload='startup();'>
<center id='rollover' class=tiny style='color: red; cursor: pointer;' onClick='doc("maintenance");'></center><div id="chit_house"><div id="chit_roof" class="chit_chamber"><table id="chit_character" class="chit_brick nospace"><tr><th colspan="3"><a target="mainpane" href="charsheet.php">RLBond86</a></th></th></tr><tr><td rowspan="4" class="avatar"><a target="mainpane" href="charsheet.php"><img src="http://images.kingdomofloathing.com/otherimages/zombavatar.gif"></a></td><td class="label"><a target="mainpane" href="campground.php?action=grave" title="Visit your guild">Zombie Master</a></td><td class="level" rowspan="2"><a target="mainpane" href="council.php" title="Visit the Council">11</a></td></tr><tr><td class="info"><a target=mainpane href="storage.php">Ronin</a>: 453</td></tr><tr><td class="info">Zombie Slayer</td></tr><tr><td colspan="2"><div class="chit_resource"><div title="Meat" style="float:left"><span>4,686</span><img src="/images/itemimages/meat.gif"></div><div title="69 Adventures remaining
 Current Run: 3 / 547" style="float:right"><span>69</span><img src="/images/itemimages/hourglass.gif"></div></div><div style="clear:both"></div></td></tr><tr><td class="progress" colspan="3" title="17 muscle until level 12
 (3,776 substats needed)" ><div class="progressbar" style="width:21.48055728841755%"></div></td></tr></table><table id="chit_stats" class="chit_brick nospace"><thead><tr><th colspan="3">My Stats</th></tr></thead><tbody><tr><td class="label">Muscle</td><td class="info"><span style="color:blue">159</span>  (108)</td><td class="progress"><div class="progressbox" title="185 / 217 (32 needed)"><div class="progressbar" style="width:85.25345622119816%"></div></div></td></tr><tr><td class="label">Myst</td><td class="info"><span style="color:blue">92</span>  (70)</td><td class="progress"><div class="progressbox" title="95 / 141 (46 needed)"><div class="progressbar" style="width:67.37588652482269%"></div></div></td></tr><tr><td class="label">Moxie</td><td class="info"><span style="color:blue">95</span>  (73)</td><td class="progress"><div class="progressbox" title="22 / 147 (125 needed)"><div class="progressbar" style="width:14.965986394557824%"></div></div></td></tr></tbody><tbody><tr><td class="label">HP</td><td class="info"><a title="Restore HP" href="/KoLmafia/sideCommand?cmd=restore+hp&pwd=ec56db255e385e15397b5114bd1300dc">198 / 243</a></td><td class="progress"><a href="/KoLmafia/sideCommand?cmd=restore+hp&pwd=ec56db255e385e15397b5114bd1300dc"><div class="progressbox" title="Restore your HP""><div class="progressbar" style="width:81.48148148148148%;background-color:green"></div></div></a></td></tr><tr><td class="label"><a href="/KoLmafia/sideCommand?cmd=restore+mp&pwd=ec56db255e385e15397b5114bd1300dc" title="Restore Horde">Horde</a></td><td class="info"><a href="/KoLmafia/sideCommand?cmd=restore+mp&pwd=ec56db255e385e15397b5114bd1300dc" title="Restore Horde">24</a></td><td class="progress"></td></tr></tbody><tbody><tr><td class="label">Liver</td><td class="info">0 / 4</td><td class="progress"><div class="progressbox" title="You are stone-cold sober""><div class="progressbar" style="width:0.0%;background-color:blue"></div></div></td></tr><tr><td class="label">Stomach</td><td class="info">0 / 30</td><td class="progress"><div class="progressbox" title="Hmmm... pies""><div class="progressbar" style="width:0.0%;background-color:green"></div></div></td></tr><tr><td class="label">Spleen</td><td class="info">0 / 15</td><td class="progress"><div class="progressbox" title="Your spleen is in perfect shape!""><div class="progressbar" style="width:0.0%;background-color:blue"></div></div></td></tr></tbody><tbody><tr><td class="label"><a href="inv_use.php?pwd=ec56db255e385e15397b5114bd1300dc&which=3&whichitem=2682" target="mainpane" title="Detuned Radio">Radio</a></td><td class="info"><span style="color:blue" title="Total ML">+65</span>  (<a href="#" class="chit_launcher" rel="chit_pickermcd" title="Turn it up or down, man">10</a>)</td><td class="progress"><a href="#" id="chit_mcdlauncher" class="chit_launcher" rel="chit_pickermcd"><div class="progressbox" title="Turn it up or down, man""><div class="progressbar" style="width:100.0%;background-color:black"></div></div></a></td></tr></tbody><tbody><tr><td class="label"><a class="visit" target="mainpane" href="hiddencity.php">Last</a></td><td class="info" style="display:block;" colspan="2"><a class="visit" target="mainpane" href="adventure.php?snarfblat=118">The Hidden City</a></td></tr></tbody></table><table id="chit_familiar" class="chit_brick nospace"><tr><th width="40" title="Buffed Weight" style="color:blue">30</th><th><a target=mainpane href="familiar.php" class="familiarpick" title="Visit your terrarium">Gronald</a></th><th width="30"> </th></tr><tr><td class="icon" title="Visit your terrarium"><a target=mainpane href="familiar.php" class="familiarpick"><img src="/images/itemimages/hat2.gif"></a></td><td class="info" style=""><a title="Familiar Haiku" class="hand" onclick="fam(18)" origin-level="third-party"/>Hovering Sombrero</a></td><td class="icon"><div id="fam_equip"><a class="chit_launcher" rel="chit_pickerfam" href="#"><img title="ittah bittah hookah" src="/images/itemimages/hookah.gif"><a href="/KoLmafia/sideCommand?cmd=ashq+lock_familiar_equipment(true)&pwd=ec56db255e385e15397b5114bd1300dc"><img title="Equipment Unlocked" id="fam_lock" src="/images/itemimages/openpadlock.gif"></a></a></div></td></tr></table></div><div id="chit_walls" class="chit_chamber"><table id="chit_effects" class="chit_brick nospace"><thead><tr><th colspan="4">Effects</th></tr></thead><tbody class="buffs"><tr class="effect" style=""><td class="icon"><img src="http://images.kingdomofloathing.com/itemimages/louder.gif" class=hand alt="Disquiet Riot" title="Disquiet Riot" onClick='eff("e1807c9d2a15d4dc5a08a46f0dcd59cf");'></td><td class="info">Disquiet Riot</td><td class="shrug"><a href="/KoLmafia/sideCommand?cmd=cast+1+Disquiet+Riot&pwd=ec56db255e385e15397b5114bd1300dc" title="Increase rounds of Disquiet Riot"><img src="/images/redup.gif" border=0></a></td><td class="powerup"><a href="/KoLmafia/sideCommand?cmd=cast+1+Disquiet+Riot&pwd=ec56db255e385e15397b5114bd1300dc" title="Increase rounds of Disquiet Riot"><img src="/images/relayimages/chit/upred.png" border=0></a></td></tr><tr class="effect" style=""><td class="icon"><img src="http://images.kingdomofloathing.com/itemimages/waxbottle.gif" width=30 height=30  onClick='eff("788941793e466a01a391e386a63fcbf3");'></td><td class="info">Over the Ocean</td><td class="shrug"><a href="/KoLmafia/sideCommand?cmd=uneffect+Over+the+Ocean&pwd=ec56db255e385e15397b5114bd1300dc" title="Use a remedy to remove the Over the Ocean effect">3</a></td><td class="powerup"><a href="/KoLmafia/sideCommand?cmd=use+1+Wax+Flask&pwd=ec56db255e385e15397b5114bd1300dc" title="Increase rounds of Over the Ocean"><img src="/images/relayimages/chit/upred.png" border=0></a></td></tr><tr class="effect" style=""><td class="icon"><img src="http://images.kingdomofloathing.com/itemimages/zombhead.gif" width=30 height=30  onClick='eff("13e5a6105695d7d0e0577665f58d7dc0");'></td><td class="info">Zomg WTF</td><td class="shrug"><a href="/KoLmafia/sideCommand?cmd=uneffect+Zomg+WTF&pwd=ec56db255e385e15397b5114bd1300dc" title="Use a remedy to remove the Zomg WTF effect">10</a></td><td class="powerup"><a href="/KoLmafia/sideCommand?cmd=cast+1+Ag-grave-ation&pwd=ec56db255e385e15397b5114bd1300dc" title="Increase rounds of Zomg WTF"><img src="/images/relayimages/chit/up.png" border=0></a></td></tr></tbody></table><table id="chit_modifiers" class="chit_brick nospace"><thead><tr><th colspan="2">Modifiers</th></tr></thead><tbody><tr><td class="label">Meat Drop</td><td class="info">+25.0%</td></tr><tr><td class="label">Item Drop</td><td class="info">+15.0%</td></tr><tr><td class="label">  Forced Drop @</td><td class="info">87%</td></tr></tbody><tbody><tr><td class="label">Monster Level</td><td class="info">+65</td></tr><tr><td class="label">Initiative</td><td class="info">+100%</td></tr><tr><td class="label">Modified Init</td><td class="info">+50%</tr><tr><td class="label">Combat Rate</td><td class="info">+0%</td></tr></tbody><tbody><tr><td class="label">Damage Absorp</td><td class="info">37% (230)</td></tr><tr><td class="label">Damage Red</td><td class="info">0</td></tr></tbody><tbody><tr><td class="label">Spell Damage</td><td class="info">+0</td></tr><tr><td class="label">Weapon Damage</td><td class="info">+40 / +20%</td></tr><tr><td class="label">Ranged Damage</td><td class="info">+0</td></tr></tbody></table></div><div id="chit_floor" class="chit_chamber"><table id="chit_toolbar"><tr><th><ul style="float:left"><li><a href="charpane.php" title="Reload"><img src="/images/relayimages/chit/refresh.png"></a></li></ul><ul style="float:right"><li><a title="Execute Mood: zombie" href="/KoLmafia/sideCommand?cmd=mood+execute&pwd=ec56db255e385e15397b5114bd1300dc"><img src="/images/relayimages/chit/moodplay.png"></a></li></ul><ul><li><a class="tool_launcher" title="Recent Adventures" href="#" rel="trail"><img src="/images/relayimages/chit/trail.png"></a></li><li><a class="tool_launcher" title="Current Quests" href="#" rel="quests"><img src="/images/relayimages/chit/quests.png"></a></li><li><a class="tool_launcher" title="Elements" href="#" rel="elements"><img src="/images/relayimages/chit/elements.png"></a></li></ul></th></tr></table></div><div id="chit_closet"><div id="chit_pickerfam" class="chit_skeleton" style="display:none"><table class="chit_picker"><tr><th colspan="2">Equip Thine Familiar Well</th></tr><tr class="pickitem"><td class="remove"><a class="change" href="/KoLmafia/sideCommand?cmd=remove+familiar&pwd=ec56db255e385e15397b5114bd1300dc" title="Unequip ittah bittah hookah">Remove equipment</a></td><td class="icon"><a class="change" href="/KoLmafia/sideCommand?cmd=remove+familiar&pwd=ec56db255e385e15397b5114bd1300dc" title="Unequip ittah bittah hookah"><img src="/images/itemimages/hookah.gif"></a></td></tr><tr class="pickloader" style="display:none"><td class="info">Changing Equipment...</td><td class="icon"><img src="/images/itemimages/karma.gif"></td></tr></table></div><div id="chit_pickermcd" class="chit_skeleton" style="display:none"><table class="chit_picker"><tr><th colspan="2">Turn it up or down, man</th></tr><tr class="pickloader" style="display:none"><td class="info">Tuning Radio...</td><td class="icon"><img src="/images/itemimages/karma.gif"></td></tr><tr class="pickitem "><td class="info"><a class="change"  href="/KoLmafia/sideCommand?cmd=mcd+0&pwd=ec56db255e385e15397b5114bd1300dc">Turn it off</a></td><td class="level">0</td></tr><tr class="pickitem "><td class="info"><a class="change"  href="/KoLmafia/sideCommand?cmd=mcd+1&pwd=ec56db255e385e15397b5114bd1300dc">Turn it mostly off</a></td><td class="level">1</td></tr><tr class="pickitem "><td class="info"><a class="change"  href="/KoLmafia/sideCommand?cmd=mcd+2&pwd=ec56db255e385e15397b5114bd1300dc">Ratsworth's money clip</a></td><td class="level">2</td></tr><tr class="pickitem "><td class="info"><a class="change"  href="/KoLmafia/sideCommand?cmd=mcd+3&pwd=ec56db255e385e15397b5114bd1300dc">Glass Balls of the King</a></td><td class="level">3</td></tr><tr class="pickitem "><td class="info"><a class="change"  href="/KoLmafia/sideCommand?cmd=mcd+4&pwd=ec56db255e385e15397b5114bd1300dc">Boss Bat britches</a></td><td class="level">4</td></tr><tr class="pickitem "><td class="info"><a class="change"  href="/KoLmafia/sideCommand?cmd=mcd+5&pwd=ec56db255e385e15397b5114bd1300dc">Rib of the Bonerdagon</a></td><td class="level">5</td></tr><tr class="pickitem "><td class="info"><a class="change"  href="/KoLmafia/sideCommand?cmd=mcd+6&pwd=ec56db255e385e15397b5114bd1300dc">Horoscope of the Hermit</a></td><td class="level">6</td></tr><tr class="pickitem "><td class="info"><a class="change"  href="/KoLmafia/sideCommand?cmd=mcd+7&pwd=ec56db255e385e15397b5114bd1300dc">Codpiece of the Goblin King</a></td><td class="level">7</td></tr><tr class="pickitem "><td class="info"><a class="change"  href="/KoLmafia/sideCommand?cmd=mcd+8&pwd=ec56db255e385e15397b5114bd1300dc">Boss Bat bling</a></td><td class="level">8</td></tr><tr class="pickitem "><td class="info"><a class="change"  href="/KoLmafia/sideCommand?cmd=mcd+9&pwd=ec56db255e385e15397b5114bd1300dc">Ratsworth's tophat</a></td><td class="level">9</td></tr><tr class="pickitem current"><td class="info">Vertebra of the Bonerdagon</td><td class="level">10</td></tr></table></div><div id="chit_tooltrail" class="chit_skeleton" style="display:none"><table id="chit_trail" class="chit_brick nospace"><tr><th><a class="visit" target="mainpane" href="hiddencity.php">Last Adventure</a></th></tr><tr><td class="last"><a class="visit" target="mainpane" href="adventure.php?snarfblat=118">The Hidden City</a></td></tr></table></div><div id="chit_toolquests" class="chit_skeleton" style="display:none"><table id="nudges" class="chit_brick nospace"><tr><th><a target="mainpane" href="questlog.php">Current Quests</a></th></tr><tr rel="qn_80c8b5d9110a27d2182799b40a8efb5c"><td class="small" colspan="2"><div>Find some way to infiltrate the Throne Room of <b><a class=nounder target=mainpane href="cobbsknob.php">Cobb's Knob</a></b> and defeat the Goblin King.</div></td></tr></table><script type="text/javascript">hide_nudges = false;</script></div><div id="chit_toolelements" class="chit_skeleton" style="display:none"><table id="chit_elements" class="chit_brick nospace"><tr><th>Elements</th></tr><tr><td><img src="/images/relayimages/chit/Elements2.gif"></tr></table></div></div></div></body></html>
 
I am having trouble with the newest version of ChIT, there is a scrollbar in the "ceiling" section:
Could it be because your 'wall' section is taking too much space? I know that's not the intended behaviour anyway, 'wall' should have a scrollbar. Just wondered if the problem goes away when you remove modifiers from the wall. I personally custom-made a "mini-modifiers" brick with just the modifiers I care the most about to be on my 'wall' - it's no bigger than the familiar brick, so it doesn't fill the available space. It was just a matter of copying, editing and renaming the existing modifiers brick.
 
I didn't really think that would be the answer - and as I said, I believe it would still be out-of-spec behaviour.

I notice you have your familiar brick in the 'ceiling' - was that working without a scrollbar until the latest version?
 
http://snipt.org/vVfj0#expand

Here's my first attempt at a brick. It's an outfit selector for the left pane. I'm actually not sure how I feel about it. On one hand, easy outfit changes. On the other hand, I can't see the impact, and the current selection doesn't always stay up (because things can wipe away the querystring I'm relying on to keep that outfit ID around). At any rate, I'm not quite done with it, but it's usable in it's current state.

It's got a bit of raw javascript, and it's only been tested in Firefox. If you try it and do get script errors, let me know. I'm tempted to introduce jquery, but I'm hesitant to bring that into my mafia scripting. And yes, writing that javascript from code did make me cringe.

What it looks like:
brick.JPG
 
Issues with visit_url and character pane

So this is bizarre. Apparently if I use visit_url to any of the games *.php pages (inventory.php is what I need), certain skills cause a known KOL bug to appear (for skills like Summon Horde and Lure Minions that require a second post, they don't work). Below is code that causes the failure to occur, and I don't know a way around it, except by doing all of the inventory.php scraping via javascript, and only when the main window isn't on the skills page.

Here's code that shows the issue; if anyone would like to point out something obvious I'm missing, I'm all ears!

Code:
//this displays issue with visit_url that breaks
//certain skills, like lure minions, and summon horde
buffer pluginBreakSkills() {
	buffer result;
	//if the next line is commented, skills work; if not, they don't.
	//Tested under KoLmafia v15.6 r11531
	//Tested under JRE 1.6.0_35
	//Tested under Firefox 16.0, with firebug
        //Tested with the latest version of ChIT, 0.7.3.4, with the dynamic loading changes, and this brick is "pluginBreakSkills"
	string visitResult = visit_url("inventory.php?which=2", true, true);	
	
	//after the line above, casting a skill like lure minions, and then
	//clicking a button on that page, just dumps to the main map.
	//there are no errors logged in mafia. Nothing suggests a problem.
	//go back to the skill, and you can see it didn't cost the brain.
	//you don't get the effects of the skill.
		
	//visit_url(""); //try re-running/clearing? didn't work.
	//visitResult = ""; //try clearing the variable?	didn't work.
	
	//see if going to google has the same effect.
	//string visitResult2 = visit_url("http://www.google.com"); //does NOT cause the problem.
	//print(visitResult2);	
	
	//if you go to inventory, then to google, it won't work.
	
	//string visitResult3 = visit_url("inventory.php"); //still causes problem.
	//string visitResult4 = visit_url("messages.php");  //still causes problem.
			
	result.append("load test");
	return result;
}

Another way to get the outfit lists without scraping inventory.php by using visit_url may be needed. Any suggestions?
 
Last edited:
Back
Top