Character Info Toolbox

Erich

Member
This seems to happen when there are no active effects. Cast scavenge or Ag-grave-ation and all is good again. Troublesome, but I haven't had the time to find the cause yet.

Odd, not this time. It happened when sneakiness and smooth movements expired, however I had on the trail:

CHIT: Error parsing refresh

Code:
<html><head>
<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" /></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 = 50;
	var FAMILIARFAVES = [["Number 92","Obtuse Angel","obtuseangel",146],["Andy \'Lucius\' Bloodbane","Artistic Goth Kid","crayongoth",160],["Number 96","Pair of Stomping Boots","stompboots",150],["Number 8B","Knob Goblin Organ Grinder","organgoblin",139],["Number 98","Fancypants Scarecrow","pantscrow2",152],["Number 88","Mini-Hipster","minihipster",136],["Gon","Happy Medium","medium_0",159],["Number 45","Jumpsuited Hound Dog","hounddog",69],["Number 71","He-Boulder","heboulder",113],["Number 46","Green Pixie","pictsie",70],["Number 4B","Casagnova Gnome","cassagnome",75],["Number 52","Mad Hatrack","hatrack",82],["Number 5A","Llama Lama","llama",90],["Number 6F","Baby Sandworm","babyworm",111],["Number 87","Rogue Program","tronguy",135],["Number 69","Frumious Bandersnatch","bandersnatch",105],["Number 7C","Baby Bugged Bugbear","babybugbug",124],["Number 94","Li\'l Xenomorph","lilxeno",148],["Number 36","Comma Chameleon","commacha",54],["Number 48","Exotic Parrot","parrot",72],["Number 32","Wild Hare","hare",50] ];
</script>
<script type="text/javascript" src="/images/scripts/familiarfaves.20120307.js"></script>
	<script type="text/javascript">
	var turnsplayed = 190872;
var turnsthisrun = 3243;
var rollover = 1348889402;
var rightnow = 1348860822;
var playerid = 1770423;
var pwdhash = "e45d862d408a3b472e2260bba233778e";
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>
<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><center><table align=center><tr><td><a class=nounder target=mainpane href="charsheet.php"><img src="http://images.kingdomofloathing.com/otherimages/sealclubber.gif" width=60 height=100 border=0></a></td><td valign=center><center><a class=nounder target=mainpane href="charsheet.php"><b>Erichwanh</b></a><br>Erich w/ an h<br>(Level 18)<table title='1,288 / 21,735' cellpadding=0 cellspacing=0 style='border: 1px solid #5A5A5A'><tr><td height=5 width=5 bgcolor=#5A5A5A></td><td width=95 bgcolor=white></td></tr></table></td></tr></table><table align=center><tr><td align=right>Muscle:</td><td align=left><b><font color=blue>409</font> (295)</b><table title='112 / 591' cellpadding=0 cellspacing=0 style='border: 1px solid #5A5A5A'><tr><td height=3 width=9 bgcolor=#5A5A5A></td><td width=41 bgcolor=white></td></tr></table></td></tr><tr><td align=right>Mysticality:</td><td align=left><b><font color=blue>302</font> (203)</b><table title='282 / 407' cellpadding=0 cellspacing=0 style='border: 1px solid #5A5A5A'><tr><td height=3 width=34 bgcolor=#5A5A5A></td><td width=16 bgcolor=white></td></tr></table></td></tr><tr><td align=right>Moxie:</td><td align=left><b><font color=blue>280</font> (210)</b><table title='303 / 421' cellpadding=0 cellspacing=0 style='border: 1px solid #5A5A5A'><tr><td height=3 width=35 bgcolor=#5A5A5A></td><td width=15 bgcolor=white></td></tr></table></td></tr><Tr><td align=right>Fullness:</td><td><b>15</b></td></tr><tr><td align=right>Tipsiness:</td><td><b>19</b></td></tr></table><center>You'd better keep an eye on your drinking...</center><table cellpadding=3 align=center><tr><td align=center><img src="http://images.kingdomofloathing.com/itemimages/hp.gif" class=hand onclick='doc("hp");' title="Hit Points" alt="Hit Points"><br><span class=black>1183 / 1183</span></td><td align=center><img src="http://images.kingdomofloathing.com/itemimages/mp.gif" class=hand onclick='doc("mp");' title="Muscularity Points" alt="Muscularity Points"><br><span class=black>870 / 870</span></td></tr><tr><td align=center><img src="http://images.kingdomofloathing.com/itemimages/meat.gif" class=hand onclick='doc("meat");' title="Meat" alt="Meat"><br><span class=black>6,917,980</span></td><td align=center><img src="http://images.kingdomofloathing.com/itemimages/hourglass.gif" class=hand onclick='doc("adventures");' title="Adventures Remaining" alt="Adventures Remaining"><br><span class=black>94</span></td></tr></table><br><font size=2><a target=mainpane href="inv_use.php?pwd=e45d862d408a3b472e2260bba233778e&whichitem=2682">Detuned Radio</a>: <b>10</b></font><br><center><font size=2><b><a onclick='if (top.mainpane.focus) top.mainpane.focus();' class=nounder href="cove.php" target=mainpane>Last Adventure:</a></b></font><br><table cellspacing=0 cellpadding=0><tr><td><font size=2><a onclick='if (top.mainpane.focus) top.mainpane.focus();' target=mainpane href="adventure.php?snarfblat=158">The F'c'le</a><br></font></td></tr></table><font size=1><nobr><a onclick='if (top.mainpane.focus) top.mainpane.focus();' target=mainpane href="adventure.php?snarfblat=112">The Sleazy Back Alley</a></nobr><br/><nobr><a onclick='if (top.mainpane.focus) top.mainpane.focus();' target=mainpane href="adventure.php?snarfblat=177">Mt. Molehill</a></nobr><br/><nobr><a onclick='if (top.mainpane.focus) top.mainpane.focus();' target=mainpane href="adventure.php?snarfblat=190">An Octopus's Garden</a></nobr><br/><nobr><a onclick='if (top.mainpane.focus) top.mainpane.focus();' target=mainpane href="adventure.php?snarfblat=187">The Brinier Deepers</a></nobr></font></center><p><table width=90%><tr><td colspan=2 align=center><font size=2><b>Familiar:</b><br>(19 adv<br>5/12 charges)</font></td></tr><tr><td align=center valign=center><a target=mainpane href="familiar.php" class="familiarpick"><img src="http://images.kingdomofloathing.com/itemimages/hare.gif" width=30 height=30 border=0></a></td><td valign=center align=left><a target=mainpane href="familiar.php" class="familiarpick"><b><font size=2>Number 32</a></b>, the  <b>25</b> pound Wild Hare</font></td></tr></table></center><center><p><b><font size=2>Effects:</font></b><br><table><tr><td><img src="http://images.kingdomofloathing.com/itemimages/footprints.gif" width=30 height=30  onClick='eff("91635be2834f8a07c8ff9e3b47d2e43a");'></td><td valign=center><font size=2>On the Trail (clingy pirate, <a href="/KoLmafia/sideCommand?cmd=uneffect+On+the+Trail&pwd=e45d862d408a3b472e2260bba233778e" title="Use a remedy to remove the On the Trail effect">37</a>)</font><br></td></tr><tr><td><img src="http://images.kingdomofloathing.com/itemimages/lparen.gif"></td><td valign=center><font size=2>Semirare window begin (<a href="/KoLmafia/sideCommand?cmd=counters+deletehash+216406687&pwd=e45d862d408a3b472e2260bba233778e">56</a>)</td></tr><tr><td><img src="http://images.kingdomofloathing.com/itemimages/rparen.gif"></td><td valign=center><font size=2>Semirare window end (<a href="/KoLmafia/sideCommand?cmd=counters+deletehash+1457374038&pwd=e45d862d408a3b472e2260bba233778e">96</a>)</td></tr></table><center><p><b><font size=2>Intrinsics:</font></b><br></center><center><table><tr><td><img src="http://images.kingdomofloathing.com/itemimages/palmtree.gif" onClick='eff("1f53c39b96204181351b24031c0c8c62");'></td><td valign=center><font size=2>Iron Palms (∞)</font><br></td></tr></table></center><center><font size=1>[<a href="charpane.php">refresh</a>]</font></center></body></html>
 

Erich

Member
I'm getting a End index 4 out of bounds (fight.ash, line 13) error when I fight Zol's and Handymen (Future zone). Is this CHiT? Or should I look into other things? It just started happening. (it also breaks chit)
 
Last edited:

slyz

Developer
Try changing that line to
PHP:
if (qname.length() > 4 && substring(qname,0,4) == "the ") { qname = substring(qname,4) ; }
 
This seems to happen when there are no active effects. Cast scavenge or Ag-grave-ation and all is good again. Troublesome, but I haven't had the time to find the cause yet.

The good news is that I've dealt with the extreme meter problem.



I'll attach it to this post.

Ah crap, skyelf got impatient and freed the king. Next go around we'll give it a shot.
 
This seems to happen when there are no active effects. Cast scavenge or Ag-grave-ation and all is good again. Troublesome, but I haven't had the time to find the cause yet.

The good news is that I've dealt with the extreme meter problem.



I'll attach it to this post.

Strangely enough the problem happened to me. I put this copy of charpane.ash into place, and my extreme meter re-appeared. So it looks good so far.
 

Bale

Minion
I believe I've fixed every bug reported as well as a few I tracked down myself. And there were a LOT of them. If I'm mistaken and I missed one, I'm replaying on you to find it and post your charpane's html. I'm sorry that it took so long.

Erich, you've got some messed up stuff going on with the moods there which I cannot replicate, so thanks for posting all that html. I believe it has been fixed.

Captain Kirk, I'm not surprised since I actually broke it worse before I fixed it. I'm confident that it will work for skyelf now, no worries.




Updated to 0.7.3.4
  • KoL's September 26, 2012 Update: Fixed many more bugs

Since version 0.7 only charpane.ash has been changed.
Download it here: View attachment 6927
 
Last edited:

Erich

Member
Try changing that line to
PHP:
if (qname.length() > 4 && substring(qname,0,4) == "the ") { qname = substring(qname,4) ; }

that causes this:

End index 5 out of bounds (fight.ash, line 14)

What is fight.ash? I'm going to see if this happens without chit, and if it doesn't, I'll post the html.

edit: It happens with chit disabled. I don't get it. I'll update mafia, see if that works, before going the way of a bug report.

edit: r11519, same thing. Dammit :(
 
Last edited:

Winterbay

Active member
It has nothing to do with chit. fight.ash is an override for the fight-page while chit is an override for the character pane. fight.ash is probably from Zarqon's fight-consult script and the error is with that script and not with chit.
 

Erich

Member
Totally forgot that's what it was called, cause he has another one that's not for relay. thanks!! I'll go to that page.
 

Erich

Member
Can I make a feature request? Tell me what you think... a (right?) click menu on the stomach/liver/spleen bars, ala the familiar gear changer, that allows for usage of distention/dog hair pills, melange, and mojo filters?
 
Last edited:

Bale

Minion
Can I make a feature request? Tell me what you think... a (right?) click menu on the stomach/liver/spleen bars, ala the familiar gear changer, that allows for usage of distention/dog hair pills, melange, and mojo filters?

I'm not into that idea. That really doesn't seem like it would be helpful separated from the rest of the consumption helper in the mafia pane.


Any chance of a CoT brick, to help pick familiars for enthronement?

Considering that mafia does not already have an interface for this, it seems helpful... Though I'm not sure what it should look like and it sounds troublesome to code. If anyone would like to submit something to help with this, please.
 

Soluzar

Member
Considering that mafia does not already have an interface for this, it seems helpful... Though I'm not sure what it should look like and it sounds troublesome to code. If anyone would like to submit something to help with this, please.
I put this together, but I'm not a good programmer so it is pretty crappy.

http://pastebin.com/3sdnpZt2

As you can see, it relies on the effects being hardcoded for every single familiar which can be enthroned. As of this time, only some of them are there. I started at the top of the list on the Crown of Thrones wiki page, and just entered a few to test and see if it would work. It seems to.

What it needs adding to it is a selector, like the one you have for familiar equipment... maybe the user could supply a comma-separated list of familiars to include in this selector. There are probably only a few that people use in the CoT...

Sorry for the nasty code. It's roughly what I pictured when making the request though.
 

slyz

Developer
You can gather the value of a specific modifier for an enthroned familiar like this:
PHP:
> ash numeric_modifier( "Throne:Angry Goat", "Muscle Percent" );

Returned: 15.0
If you want to build a string containing all the modifiers, some sort of feature would have to be added to Mafia. Or you can look at rlbond86's excellent Enhanced Inventory Spoilers for a way to make this happen without slowing down the execution of the script too much.
 

InfiniusDev

New member
Possible external file (plugin) brick extensibility?

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!

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":
Code:
void bakeBricks() {

	bakeHeader();
	bakeFooter();

	if (inValhalla) {
		bakeValhalla();
	} else {
		foreach layout in $strings[roof, walls, floor, toolbar] {

			string prefname = "chit." + layout + ".layout";
			layout = vars[prefname].to_lower_case().replace_string(" ", "");
			string [int] bricks = split_string(layout,",");
			string brick;
			for i from 0 to (bricks.count()-1) {
				brick = bricks[i];
				if (!(chitBricks contains brick)) {
					switch (brick) {
					
						//if they were cased the same as the method, we could just rely on 
						//purely dynamic calls.
						case "character":	bakeCharacter();	break;
						case "stats":		bakeStats();		break;
						case "familiar":	bakeFamiliar();		break;
						case "trail":		bakeTrail();		break;
						case "quests":		bakeQuests();		break;
						case "effects":		bakeEffects();		break;
						case "mcd":			bakeMCD();			break;
						case "substats":	bakeSubstats();		break;
						case "organs":		bakeOrgans();		break;
						case "modifiers":	bakeModifiers();	break;
						case "elements":	bakeElements();		break;
						
						//unknown 'bricks'; shouldn't these special predefined types
						//  be stored in their own array? (this list taken from buildCloset, removing the ones already handled)						
						case "helpers":		break;						
						case "update":		break;
						
						//we really don't know about the brick; try to dynamically load it.
						//note: casing MUST match between brickname and bakebrickname function.
						default:
							string bakingFunctionName = "bake"+brick; //e.g. bakeCharacter();
							chitBricks[brick] = call buffer bakingFunctionName();
							break;
					}
				}
			}
		}
	}

	bakeToolBar();
	
}

2. Pluggable bricks as a result:

a. Import at the top of the file:
Code:
import <Chit Brick Outfits.ash>	//needs change to bakeBrick() method to work.

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):
Code:
///Brick for ChIT to display outfit selection screen.
//requires changes to bakeBricks()
//Constructor Method:
buffer bakeOutfits() {
	buffer result;
	
	result.append('<table id="chit_outfits" class="chit_brick nospace">');
	result.append('<tr><th>Outfits</th></tr>');
	result.append("<tr><td>");	
	result.append('STD:');
	result.append("<select><option value='a'>Some Outfit 1</option></select>");
	result.append("</td></tr>");
	result.append("<tr><td>");	
	result.append('CST:');
	result.append("<select><option value='a'>Some Outfit 1</option></select>");
	result.append("</td></tr>");
	result.append("</table>");
	
	//chitBricks["outfits"] = result;
	return result;
}

3. Simply add your new brick to the list in the config file (note the casing...):
Code:
chit.walls.layout	helpers,effects,Outfits

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?
 

Theraze

Active member
You can gather the value of a specific modifier for an enthroned familiar like this:
PHP:
> ash numeric_modifier( "Throne:Angry Goat", "Muscle Percent" );

Returned: 15.0
If you want to build a string containing all the modifiers, some sort of feature would have to be added to Mafia. Or you can look at rlbond86's excellent Enhanced Inventory Spoilers for a way to make this happen without slowing down the execution of the script too much.

Couldn't you just use the "modifiers" bit?
> ash string_modifier( "Throne:Angry Goat", "modifiers" );

Returned: Muscle Percent: +15
As an full familiar check-bit:
Code:
ashq string found; foreach fam in $familiars[] { found=string_modifier("Throne:"+to_string(fam), "modifiers"); if (found.length() > 3) print_html(fam+": "+found); }
 
Last edited:

Soluzar

Member
Couldn't you just use the "modifiers" bit?As an full familiar check-bit:
Code:
ashq string found; foreach fam in $familiars[] { found=string_modifier("Throne:"+to_string(fam), "modifiers"); if (found.length() > 3) print_html(fam+": "+found); }
Is there a similar way to check the secondary effect of an enthroned familiar? For example, the goat also gives you pizzas. It would be rather nice to be able to display that too.

Thanks for pointing out a better way to go about this through - I pretty much knew my own code was stupid.
 
Top