Kaffeetrinken's listHoboLoot

Kaffeetrinken

New member
Hi,
I whipped up a little script to simplify listing all the Hoboboss equipment I own.
It's useful for loot distribution purposes or at least it is for KolA's.
It accounts for items in the closet and the display case as well.
As of now Uncle Hobo stuff is not supported, because I'm lazy and handling arrays in ash is terrible (or I'm missing something).
Let me know what you think of it, I hope it saves some people some time.

View attachment listHoboLoot.ash
 

Mr Purple

Member
This seems effective enough. However, have you had a look at this? It incorporates bosses at the top and miscellaneous stuff underneath if you like lists in the CLI: http://kolmafia.us/showthread.php?3627-Hobopolis-Slime-Tube-and-Sea-collection-checker

Here is the hobopolis version trimmed to what you want to display:

Code:
buffer table;

int sumIt(item it)
{
	return (item_amount(it) + closet_amount(it) + equipped_amount(it) + storage_amount(it));
}

string dispItem(item what)
{
	int iTot = sumIt(what);
	string a;
	if( iTot == 0 )
		a = what + " - <font color='red'>" + iTot + "</font><br>";
	else
		a = what + " - <font color='green'>" + iTot + "</font><br>";
	return a;
}

string dcdispItem(item what)
{
	int idcTot = display_amount( what );
	string b;
	if( idcTot == 0 )
		b = "<font color='red'>" + idcTot + "</font><br>";
	else
		b = "<font color='green'>" + idcTot + "</font><br>";
	return b;
}

string ol_scratch()
{
	buffer a;
	buffer b;
	foreach x in $items[Ol' Scratch's ash can, Ol' Scratch's ol' britches, Ol' Scratch's stovepipe hat, Ol' Scratch's infernal pitchfork,
	Ol' Scratch's manacles, Ol' Scratch's stove door]
	{
		a.append( dispItem( x ) );
		b.append( dcdispItem( x ) );
	}
	string c = to_string( a ) + "</TD><TD>" + to_string( b );
	return c;
}

string frosty()
{
	buffer a;
	buffer b;
	foreach x in $items[Frosty's carrot, Frosty's nailbat, Frosty's old silk hat, Frosty's iceball, Frosty's arm, Frosty's snowball sack]
	{
		a.append( dispItem( x ) );
		b.append( dcdispItem( x ) );
	}
	string c = to_string( a ) + "</TD><TD>" + to_string( b );
	return c;
}

string oscus()
{
	buffer a;
	buffer b;
	foreach x in $items[Oscus's dumpster waders, Oscus's pelt, Wand of Oscus, Oscus's flypaper pants, Oscus's garbage can lid,
	Oscus's neverending soda]
	{
		a.append( dispItem( x ) );
		b.append( dcdispItem( x ) );
	}
	string c = to_string( a ) + "</TD><TD>" + to_string( b );
	return c;
}

string zombo()
{
	buffer a;
	buffer b;
	foreach x in $items[Zombo's grievous greaves, Zombo's shield, Zombo's skullcap, Zombo's empty eye, Zombo's shoulder blade, Zombo's skull ring]
	{
		a.append( dispItem( x ) );
		b.append( dcdispItem( x ) );
	}
	string c = to_string( a ) + "</TD><TD>" + to_string( b );
	return c;
}

string chester()
{
	buffer a;
	buffer b;
	foreach x in $items[Chester's bag of candy, Chester's cutoffs, Chester's moustache, Chester's Aquarius medallion, Chester's muscle shirt,
	Chester's sunglasses]
	{
		a.append( dispItem( x ) );
		b.append( dcdispItem( x ) );
	}
	string c = to_string( a ) + "</TD><TD>" + to_string( b );
	return c;
}

string hodgman()
{
	buffer a;
	buffer b;
	foreach x in $items[Hodgman's bow tie, Hodgman's porkpie hat, Hodgman's lobsterskin pants, Hodgman's almanac, Hodgman's lucky sock,
	Hodgman's metal detector, Hodgman's varcolac paw, Hodgman's harmonica, Hodgman's garbage sticker, Hodgman's cane, Hodgman's whackin' stick,
	Hodgman's disgusting technicolor overcoat, Hodgman's imaginary hamster]
	{
		a.append( dispItem( x ) );
		b.append( dcdispItem( x ) );
	}
	string c = to_string( a ) + "</TD><TD>" + to_string( b );
	return c;
}

void main()
{	
	table.append( "<TABLE BORDER='1' CELLPADDING='1'>" );
	table.append( "<TR><TD><B>Ol' Scratch</B></TD><TD><B>DC</B></TD><TD><B>Frosty</B></TD><TD><B>DC</B></TD></TR>");
	table.append( "<TR><TD>" + ol_scratch() + "</TD><TD>" + frosty() + "</TD></TR>" );
	table.append( "<TR><TD><B>Oscus</B></TD><TD><B>DC</B></TD><TD><B>Zombo</B></TD><TD><B>DC</B></TD></TR>");
	table.append( "<TR><TD>" + oscus() + "</TD><TD>" + zombo() + "</TD></TR>" );
	table.append( "<TR><TD><B>Chester</B></TD><TD><B>DC</B></TD><TD><B>Hodgman</B></TD><TD><B>DC</B></TD></TR>");
	table.append( "<TR><TD>" + chester() + "</TD><TD>" + hodgman() + "</TD></TR>" );
	table.append( "</TABLE>" );
	print_html( table.to_string() );
}

That said, I'm struggling to see why anybody wouldn't use BCC's excellent snapshot script: http://kolmafia.us/showthread.php?3001-bumcheekcity-s-Easy-Snapshot-Maker
 
Last edited:

Veracity

Developer
Staff member
I'm struggling to see why anybody wouldn't use BCC's excellent snapshot script.

1) Not everybody wants to have their "data" directory cluttered up with the data files it generates.
2) Not everybody wants to share their character state with others - even if "others" is exactly one person.
3) Not everybody wants to depend on looking at a remote site to figure out information about their own character which is locally available at any time.

In summary:

4) Not everybody thinks or feels exactly the way you - or any other person - thinks or feels about things.
 
Top