What pieces of hobopolis equip are you missing?

icon315

Member
I think this script has the hobo skills mixed up with buffs.....i have the buff diversity, but not the skill

Code:
>> Boss Songs
Benetton's Medley of Diversity - 0
You have the skill Benetton's Medley of Diversity
Chorale of Companionship - 1
Elron's Explosive Etude - 0
You lack the skill Elron's Explosive Etude
Hodgman's journal #1: The Lean Times - 2
You lack the skill Natural Born Scrabbler
Hodgman's journal #2: Entrepreneurythmics - 0
You lack the skill Thrift and Grift
Hodgman's journal #3: Pumping Tin - 0
You lack the skill Abs of Tin
Hodgman's journal #4: View From The Big Top - 0
You lack the skill Marginally Insane
Prelude of Precision - 0
You lack the skill Prelude of Precision
The Ballad of Richie Thingfinder - 0
You lack the skill The Ballad of Richie Thingfinder
 

Bale

Minion
It seems you've found a bug. It will tell you that you've got the skill if you have either the skill OR the effect. Stupid program actually checks visit_url("charsheet.php") and does a contains_text() to see if it has the skill. Unfortunately the effect is there also.

I cannot imagine why it as programmed that way when it would be so much easier to check a numerical range of x.to_skill().have_skill().
 

Mr Purple

Member
***PLEASE NOTE***
I have now moved these scripts, along with another for the sea, into a separate thread. Anyone looking for them should go here:
http://kolmafia.us/showthread.php?3627-Hobopolis-Slime-Tube-and-Sea-collection-checker

I think this script has the hobo skills mixed up with buffs.....i have the buff diversity, but not the skill

Hmm...excellent point.

It seems you've found a bug. It will tell you that you've got the skill if you have either the skill OR the effect. Stupid program actually checks visit_url("charsheet.php") and does a contains_text() to see if it has the skill. Unfortunately the effect is there also.

I cannot imagine why it as programmed that way when it would be so much easier to check a numerical range of x.to_skill().have_skill().

Yup, exceptionally stupid. Not even sure why I wrote it like that. Looking at the script, all I can see is that I might have started with the slime skills, which require a visit_url function to see their level, then just copied and pasted the entire thing. Anyhoo...here's a copy of HoboNeeds and SlimeNeeds which should actually work. I've tinkered a little with the Hobo Binder script and the Tattoo part down at the bottom too, but it shouldn't be doing anything with the output. Unless my maths for the tattoo is wrong. Which it shouldn't be...

I'm starting to think that the lists, particularly HoboNeeds, are not wonderfully useful. Maybe I should seperate what's in the display case from that which is in the inventory, Hagnks, etc. That way it suits collectors and the generally interested.

HoboNeeds 1.4
Updates:
1.0 - now with update checking!
1.1 - changed the format of the information & split DC amount from everything else
1.2 - majorly trimmed the code, and fixed spelling errors
1.3 - added SotDF, added DC functionality, fixed updates for new website
1.4 - improved DC handling, moved script to a better place


SlimeNeeds 1.4
Updates:
1.0 - now with update checking!
1.1 - changed the format of the information & split DC amount from everything else
1.2 - majorly trimmed the code
1.3 - added DC functionality, fixed updates for the new website
1.4 - improved DC handling, added trophy, moved script to a better place
 

Attachments

  • HoboNeeds.ash
    20.9 KB · Views: 39
  • SlimeNeeds.ash
    9.4 KB · Views: 41
Last edited:

Grotfang

Developer
That would require a new thread, however...

EDIT: Yeah... this is nonsense. Please ignore...
 
Last edited:

Bale

Minion
Grotfang is referring to zlib's update check which would be confusing for the end user if it wasn't used that way. There's no reason though that Mr Purple couldn't rewrite his own version of update which works differently.
 

Grotfang

Developer
Grotfang is referring to zlib's update check which would be confusing for the end user if it wasn't used that way. There's no reason though that Mr Purple couldn't rewrite his own version of update which works differently.

Shamelessly adapted from Zarqon...

Code:
int abs( int n )
{
	if( n < 0 )
		return -n;
	return n;
}

string [string] vars;
vars ["verbosity"] = "3";

boolean vprint( string message , string color , int level )
{
	if( level == 0 )
		abort( message );
	if( to_int(vars["verbosity"] ) >= abs( level ) )
		print( message , color );
	return ( level > 0 );
}

boolean vprint( string message , int level )
{
	if( level > 0 )
		return vprint( message , "black" , level );
	return vprint( message , "red" , level );
}

void check_version( string soft , string prop , string thisver , int post , int pcount )
{
	print( "Starting" );
	int w;
	switch( get_property( "_version_" + prop ) )
	{
		case thisver: return;
		case "": vprint( "Checking for updates (running " + soft + " ver. " + thisver + ")..." , 1 );
		matcher find_ver = create_matcher( "<b>" + soft + " (.+?)</b>" , visit_url( "http://kolmafia.us/showpost.php?p=" + post + "&postcount=" + pcount ) );
		w = 19;
		if( !find_ver.find() )
		{
			vprint( "Unable to load current version info." , -1 );
			return;
		}
		set_property("_version_" + prop , find_ver.group( 1 ) );
		if( find_ver.group(1) == thisver )
		{
			vprint( "You have a current version of " + soft + "." , 1 );
			return;
		}
		default:
		print_html( "<big><font color=red><b>New Version of " + soft + " Available: " + get_property( "_version_" + prop ) + "</b></font></big>" );
		vprint( "Upgrade " + soft + " from " + thisver + " to " + get_property( "_version_" + prop ) + " here: http://kolmafia.us/showpost.php?p=" + post + "&postcount=" + pcount , "blue" , 2 );
		wait( 3 + w );
	}
}

Usage:

this allows you to specify specific posts. Format of post URL is:

Code:
http://kolmafia.us/showpost.php?p=[COLOR="Red"]x[/COLOR]&postcount=[COLOR="Red"]y[/COLOR]

I have adapted it so the utility uses:

Code:
check_version( string [script name] , string [daily property] , string [current version] , int [COLOR="Red"]x[/COLOR] , int [COLOR="Red"]y[/COLOR] );

A working example, for a script entitled "Grotfang's Script" (version 1.0) would be:

Code:
check_version( "Grotfang's Script" , "gfscript" , "1.0" , 23989 , 28 );

Simply change the "1.0" bit to another number to see what happens if there is a mismatch (you may need to type "ash set_property( "_version_gfscript" , "" );" into the CLI...)

BELOW IS THE TEXT TO MARK THE SCRIPT VERSION:

Grotfang's Script 1.0
 
Last edited:

Mr Purple

Member
OK. Many thanks to Grotfang for providing the code for this. Post #23 has now been updated to reflect this. Anyone who is using this script, please download the latest version from there.

I feel at this point I ought to ask - is there anything people would like this script to be doing which it isn't currently doing. My thoughts are two-fold: firstly to frame the information a little differently, and secondly to make a distinction between that which is in the display case and that which is anywhere else.

But I honestly don't know what people are using this script for...it seems to have relatively little functionality! I use it because I'm aiming for a complete set of both of the dungeons' items in my DC (complete with the Slime Tube, very little left to go with Hobopolis) but this seems an incredibly niche use. It is, however, the basis upon which I make alterations...
 

bumcheekcity

Active member
If I may just butt into the conversation about version checking, I found this to be helpful for my snapshot script:

if (index_of(visit_url("http://kolmafia.us/showthread.php?t=3001"), "1.3</b>") == -1)
{
print("There is a new version available - go download the next version of snapshot.ash at http://kolmafia.us/showthread.php?t=3001!", "red");
}

This has the advantage of not being a massive hassle for the user - it can be simply ignored with no waiting, and not relying on an external script. And of course, it's simpler :D
 

Grotfang

Developer
Code:
if (index_of(visit_url("http://kolmafia.us/showthread.php?t=3001"), "1.3</b>") == -1)
{
    print("There is a new version available - go download the next version of snapshot.ash 
at http://kolmafia.us/showthread.php?t=3001!", "red");
}

And of course, it's simpler :D

Wow. Yeah... I just edited Zarqon's accordingly. In fact, I could probably tailor make a similar thing for this script - as checking the individual post is (IMO) preferable, making sure no-one can confuzzle things. Will add an edit (with code) in a bit...

EDIT:

Here is a condensed version of the same script. Identical functionality as before, again thanks to Zarqon.

Code:
void check_version( string soft , string prop , string thisver , int post , int pcount )
{
	int w;
	switch( get_property( "_version_" + prop ) )
	{
		case thisver: return;
		case "": print( "Checking for updates (running " + soft + " ver. " + thisver + ")..." );
		matcher find_ver = create_matcher( "<b>" + soft + " (.+?)</b>" , 
		visit_url( "http://kolmafia.us/showpost.php?p=" + post + "&postcount=" + pcount ) );
		w = 19;
		if( !find_ver.find() )
		{
			print( "Unable to load current version info." , "red" );
			return;
		}
		set_property("_version_" + prop , find_ver.group( 1 ) );
		if( find_ver.group(1) == thisver )
		{
			print( "You have a current version of " + soft + "." );
			return;
		}
		default:
		print_html( "<big><font color=red><b>New Version of " + soft + " Available: " + 
		get_property( "_version_" + prop ) + "</b></font></big>" );
		print( "Upgrade " + soft + " from " + thisver + " to " + get_property( "_version_" + prop ) 
		+ " here: http://kolmafia.us/showpost.php?p=" + post + "&postcount=" + pcount , "blue" );
		wait( 3 + w );
	}
}
 
Last edited:

Mr Purple

Member
Right, so quite a lot has changed in version 1.1 of HoboNeeds.

Firstly, the way in which I handle binder glyphs has altered. Pretty sure it works fine.
Secondly, I now give two numbers: the first is the accumulated total of everything you have outside your display case (closet, inventory, equipped and hangks). The second is the number in your display case. This way it helps both collectors and the curious. The only ones penalised are those who can't add the two numbers together, which I figure isn't many.
Thirdly, I display the vast majority of the information now in a table. This makes it easier to read I think, means less scrolling up and down, and makes the distinctions between zones much easier. Three things I have left out: whether you have a hobo monkey in your terrarium, number of glyphs in your binder and the degree of completion of your hobo tattoo, None of these are items, so I figured they belong elsewhere. The item hobo monkey is in the table itself.

EDIT: And exactly the same stuff has been changed in SlimeNeeds.ash. Enjoy :)

If anyone has any improvements they would like to suggest, please do. Otherwise, I think I'm going to consider this project pretty much complete. I'm out of ideas...
 
Last edited:

Mr Purple

Member
Version 1.2 is now up for both slime and hobo. I've removed about half the number of lines since the last version, and fixed my apparent inability to spell "acquire" 20% of the time. I've also included the hobo code binder under "Misc" in HoboNeeds, as I figured some people may want to know if it is in their DC, rather than just how many glyphs are in it.

So yeah, enjoy. Any feedback on stuff people would like to see changed would be welcomed.
 

Mr Purple

Member
Big News! But the small news first...

1) I noticed Staff of the Deepest Freeze was missing from HoboNeeds so I added it to the Misc section (as Frosty's section currently has the same number of items as Scratch and I like that). In order to ensure consistency, I moved the dead guy's memento to Misc as well, meaning that items created from Hobopolis are in Misc, and their original parts are where you find them.

2) I changed the update checker to use the new website. Your scripts should now, once again, tell you when they are out of date. Woo.

3) Realising this script is really only of use to those who seek completion, I figure why not show that OCD to the world? Thus, with both SlimeNeeds.ash and HoboNeeds.ash, there is now the option to add these items to your display case. There are two options: the first is to make sure that your DC has 1 and only 1 of each item in it. If you choose not to use that option, the second is to add ALL of these items to your DC. If you choose not to use either of these, then the script will run for you the same as before. If you dislike having these bits as part of the script, all you need to do is scroll down to the bottom and remove the section in void main() that reads:
Code:
if( user_confirm( "Do you wish to have one of every slime item in your Display Case?" ) )
		one_of_each();
	else if( user_confirm( "Do you wish to put every slime item in your Display Case?" ) )
		dc_all();
On a final note, I realise there are some, nay many, of you who like having an up-to-date collection, but also like to be able to visit the marketplace. I have therefore included two additional choices in the HoboNeeds section: confirm you wish to DC your hobo code binder, and confirm you wish to DC your hobo nickels. If your binder is already in your DC, the script will not ask about the binder.

Enjoy, and again, if you have any suggestions for improvement, please let me know!
 

Bazaaretw

Member
> call scripts\HoboNeeds.ash

Expected ), found put_display (HoboNeeds.ash, line 304)

I get this error when I run hobo needs, but slime needs works fine.
 

heeheehee

Developer
Staff member
Add a parentheses at the end of the line before it. Script writer forgot to close the condition for the if statement.
 

Bazaaretw

Member
Is there an easier way to find it other then counting 304 lines, I ctrl+f 'd "put display" and the lines with that in it looked normal to me.
 

Bale

Minion
Is there an easier way to find it other then counting 304 lines, I ctrl+f 'd "put display" and the lines with that in it looked normal to me.
Some text editors count lines for you.

To replace notepad I like to use editpad lite. It has an option to show line numbers. If you don't write or edit many scripts it is everything you need.

For script writing I love to use Notepad++. It might be a bit much for casual usage though.

Both of them are free.
 

Mr Purple

Member
Really sorry about that. I've updated the thread.

For those who have already downloaded the script, lines 304 and 320 need a ) added to the end of them. I really should have tested that before posting it. Very sorry.
 
Last edited:
Top