Hobo underling summoning...

ki77bot

Member
I am using this to ask a hobo underling for a drink:

Code:
while (i < 5) {
	if (contains_text(visit_url("adventure.php?snarfblat=82"),"You're fighting")){
		steal();
		use_skill(1, $skill["Summon Hobo underling"]);
		use_skill(1, $skill["ASK THE HOBO FOR A DRINK"]);
		use_skill(1, $skill["ASK THE HOBO TO TELL YOU A JOKE"]);
		i = i + 1;
		run_combat();
	} else {
		set_property("choiceAdventure9","3");
		set_property("choiceAdventure10","3");
		set_property("choiceAdventure11","3");
		set_property("choiceAdventure12","3");
		adventure(1, $location[Giant's Castle]);
	}
}

BUT as I am using SmartStasis und FirstThingsFirst, it can occur that the hobo monkey steals meat in the very first round. In that case SS/FTF attacks and the round is over. As the scriptlet is NOT checking, if the drink was really "mixed", I can not be sure, that the skill has really been used five times successfully.

So, the question is:

Is there a way to check if the "summon hobo underling" really was executed, or even better check for the generated drink itself?

Cheers ki77bot.

edit: hmmm, I didn't check if have_skill($skill["Summon hobo underling"]) works...
 
Last edited:

ki77bot

Member
hmmm,

(sorry for double post)

nobody can help me? My solution for now is to switch to another familiar, but that is not satisfactory...

and have_skill($skill["Summon hobo underling"]) won't work...

Something odd happened, when I used another familiar (leprechaun):

Code:
[95926] Giant's Castle
Encounter: Procrastination Giant
Round 0: ki77bot wins initiative!
Round 1: ki77bot tries to steal an item!
Adjusted combat item count: procrastination potion
You acquire an item: procrastination potion
Round 2: ki77bot casts SUMMON HOBO UNDERLING!
Adjusted combat item count: procrastination potion (-1)
Round 3: ki77bot casts ASK THE HOBO FOR A DRINK!
You acquire an item: bottle of cooking sherry
You acquire an item: bottle of popskull
Round 4: ki77bot casts ASK THE HOBO TO TELL YOU A JOKE!
Round 5: ki77bot attacks!
You gain 998 Meat
You gain 5 Muscleboundness
You gain 13 Enchantedness
You gain 18 Sarcasm

[95927] Giant's Castle
Encounter: What are the Odds?
You acquire an item: plot hole
You acquire an item: chaos butterfly

[95928] Giant's Castle
Encounter: Alphabet Giant
Round 0: ki77bot wins initiative!
Round 1: ki77bot tries to steal an item!
You acquire an item: original G
Round 2: ki77bot attacks!
You gain 832 Meat
You gain 11 Strongness
You gain 5 Magicalness
You gain 25 Sarcasm

[95929] Giant's Castle
Encounter: Furry Giant
Round 0: ki77bot wins initiative!
Round 1: ki77bot tries to steal an item!
You acquire an item: disturbing fanfic
Round 2: ki77bot casts SUMMON HOBO UNDERLING!
You lose 6 hit points
Round 3: ki77bot casts ASK THE HOBO FOR A DRINK!
You acquire an item: white lightning
Round 4: ki77bot casts ASK THE HOBO TO TELL YOU A JOKE!
Round 5: ki77bot attacks!
You gain 874 Meat
You acquire an item: furry fur
You acquire an item: wolf mask
You gain 5 Beefiness
You gain 14 Enchantedness
You gain 18 Smarm

[95930] Giant's Castle
Encounter: Raver Giant
Round 0: ki77bot wins initiative!
Round 1: ki77bot tries to steal an item!
You acquire an item: Angry Farmer candy
Round 2: ki77bot casts SUMMON HOBO UNDERLING!
Round 3: ki77bot casts ASK THE HOBO FOR A DRINK!
You acquire an item: extra-spicy bloody mary
Round 4: ki77bot casts ASK THE HOBO TO TELL YOU A JOKE!
Round 5: ki77bot attacks!
You gain 936 Meat
You acquire an item: giant needle
You gain 13 Beefiness
You gain 8 Wizardliness
You gain 18 Cheek

[95931] Giant's Castle
Encounter: Wheel in the Clouds in the Sky, Keep On Turning

[95931] Giant's Castle
Encounter: Wheel in the Clouds in the Sky, Keep On Turning
choice.php?whichchoice=11&option=3&pwd

[95931] Giant's Castle
Encounter: Alphabet Giant
Round 0: ki77bot wins initiative!
Round 1: ki77bot tries to steal an item!
You acquire an item: original G
Round 2: ki77bot attacks!
You gain 697 Meat
You acquire an item: heavy D
You gain 13 Muscleboundness
You gain 6 Enchantedness
You gain 24 Sarcasm

[95932] Giant's Castle
Encounter: What are the Odds?
You acquire an item: plot hole
You acquire an item: chaos butterfly

[95933] Giant's Castle
Encounter: Goth Giant
Round 0: ki77bot wins initiative!
Round 1: ki77bot tries to steal an item!
You acquire an item: awful poetry journal
Round 2: ki77bot attacks!
You gain 743 Meat
You acquire an item: thin black candle
You acquire an item: Warm Subject gift certificate
You gain 5 Strengthliness
You gain 9 Enchantedness
You gain 22 Cheek

[95934] Giant's Castle
Encounter: What are the Odds?
You acquire an item: plot hole
You acquire an item: chaos butterfly

[95935] Giant's Castle
Encounter: What are the Odds?
You acquire an item: plot hole
You acquire an item: chaos butterfly

[95936] Giant's Castle
Encounter: Possibility Giant
Round 0: ki77bot wins initiative!
Round 1: ki77bot tries to steal an item!
Round 2: ki77bot casts SUMMON HOBO UNDERLING!
Round 3: ki77bot casts ASK THE HOBO FOR A DRINK!
You acquire an item: bottle of cooking sherry
You acquire an item: accidental cider
Round 4: ki77bot casts ASK THE HOBO TO TELL YOU A JOKE!
Round 5: ki77bot attacks!
You gain 998 Meat
You gain 7 Strengthliness
You gain 10 Wizardliness
You gain 20 Cheek

[95937] Giant's Castle
Encounter: Possibility Giant
Round 0: ki77bot wins initiative!
Round 1: ki77bot tries to steal an item!
Round 2: ki77bot casts SUMMON HOBO UNDERLING!
Round 3: ki77bot casts ASK THE HOBO FOR A DRINK!
You acquire an item: bottle of popskull
You acquire an item: bottle of cooking sherry
Round 4: ki77bot casts ASK THE HOBO TO TELL YOU A JOKE!
Round 5: ki77bot attacks!
You gain 1085 Meat
You acquire an item: probability potion
You gain 7 Strongness
You gain 10 Enchantedness
You gain 19 Cheek

I have NO clue why it sometimes does what it is supposed to and sometimes just attacks...

[edit] OK, I found out what happens, but I still got no clue WHY.
It seems as any time a non-combat is encountered, the next fight after that is done "normally", i.e. without summoning. Can somebody see the reason for that behaviour?
 
Last edited:

Spiny

Member
[edit] OK, I found out what happens, but I still got no clue WHY.
It seems as any time a non-combat is encountered, the next fight after that is done "normally", i.e. without summoning. Can somebody see the reason for that behaviour?

I'm afraid I don't have anything helpful to say other than your own attached log disproves the theory you came up with:

[95935] Giant's Castle
Encounter: What are the Odds?
You acquire an item: plot hole
You acquire an item: chaos butterfly

[95936] Giant's Castle
Encounter: Possibility Giant
Round 0: ki77bot wins initiative!
Round 1: ki77bot tries to steal an item!
Round 2: ki77bot casts SUMMON HOBO UNDERLING!
Round 3: ki77bot casts ASK THE HOBO FOR A DRINK!
You acquire an item: bottle of cooking sherry
You acquire an item: accidental cider
Round 4: ki77bot casts ASK THE HOBO TO TELL YOU A JOKE!
Round 5: ki77bot attacks!
You gain 998 Meat
You gain 7 Strengthliness
You gain 10 Wizardliness
You gain 20 Cheek

That's a non-combat followed by a summon hobo underling combat. Not sure what is the cause of your grief atm though, sorry. If I think of anything, I'll update.

-Spiny
 

jasonharper

Developer
You are starting a new encounter via visit_url("adventure.php?snarfblat=82"). There are basically three possible results: a combat, a choice adventure, or a simple noncombat.

If it was a combat, you're still at the first round of combat at this point. You perform a few combat actions, then finish up with run_combat() - no problems here.

If it was a choice adventure, you're still at the choice page. The adventure(1,...) will reload the choice page (rather than starting a new encounter, which is impossible at that point), and apply your preferences to it. This is somewhat of an abuse of adventure(), but it appears that this will work just fine.

But if it was a simple noncombat, the visit_url() completely finished the encounter, since there's only a single page load involved. When you do the adventure() afterwards, you start a brand new encounter, which may very well be a combat (which would be automated using your normal battleAction or CCS).

Basically, you need to distinguish between a choiceadv and other noncombats based on the result of your visit_url().
 

ki77bot

Member
When I thought about it this night I figured out myself that it must be the difference in non-combats (with or without choiceadv), that is causing the behaviour. But your help is very much appreciated... :)

So, is there a simple way to finish off a started non-combat adventure which is "waiting" for a choice to be made?

Right now the scipt is working, but it is spending more adventures than it must to summon five underlings and then the drinks.

Basically, you need to distinguish between a choiceadv and other noncombats based on the result of your visit_url().

Agreed...

Thanks a lot...

[edit] Would it work like this? (I can't test it today as I already did my summons)

Code:
int i=0;

	outfit("$$$ Hobo_Monkey $$$");
	use_familiar($familiar[Leprechaun]);
	equip($item [Meat detector]);
	
while (i < 5) {
	if (contains_text(visit_url("adventure.php?snarfblat=82"),"You're fighting")){
		steal();
		use_skill(1, $skill["Summon Hobo underling"]);
		use_skill(1, $skill["ASK THE HOBO FOR A DRINK"]);
		use_skill(1, $skill["ASK THE HOBO TO TELL YOU A JOKE"]);
		i = i + 1;
		run_combat();
		} else {
		if (contains_text(visit_url("adventure.php?snarfblat=82"),"Wheel in the Clouds in the Sky"))
		set_property("choiceAdventure9","3");
		set_property("choiceAdventure10","3");
		set_property("choiceAdventure11","3");
		set_property("choiceAdventure12","3");
		adventure(1, $location[Giant's Castle]);
		}
}
 
Last edited:

jasonharper

Developer
No, you're trying to start an entirely new encounter with the second visit_url(), which may or may not work. You need to save the returned value from the original visit_url(), so you can make multiple tests against it.

Containing the text "choice.php" indicates a choice adventure in general, although your check for the specific "Wheel" text will work in this instance since that's the only choiceadv.
 

ki77bot

Member
Hi, sorry to necro this thread, but after some whille of trial-and-error (and some helpful and good ideas by Bale) I have no further idea how do get this to work...

Code:
outfit("$$$ Hobo_Monkey $$$");
use_familiar($familiar[Leprechaun]);
equip($item [Meat detector]);

int i=0;

set_property("choiceAdventure9","3");
set_property("choiceAdventure10","3");
set_property("choiceAdventure11","3");
set_property("choiceAdventure12","3");

if(have_outfit("Hodgman's Regal Frippery") && can_equip($item[Hodgman's bow tie]) && can_equip($item[Hodgman's porkpie hat])){
outfit("Hodgman's Regal Frippery");
} else {
abort("You either don't have 'Hodgman's Regal Frippery' or you aren't able to wear it!");
}

string page = visit_url("adventure.php?snarfblat=82");
	
while(contains_text(page, "Summon hobo underling") || !contains_text(page, "You're fighting")) {
	switch {
	case contains_text(page, "You're fighting"):
		steal();
		use_skill(1, $skill["Summon Hobo underling"]);
		page = use_skill($skill["ASK THE HOBO FOR A DRINK"]);
		if(contains_text(page, "reaches into a pocket of one of his filthy garments and produces a beverage for you.")){
			use_skill(1, $skill["ASK THE HOBO TO TELL YOU A JOKE"]);
			run_combat();
			i = i + 1;
			print_html("<B><FONT color=#0000FF, SIZE=5><br />Hobo underling summoning counter: <FONT color=#FF0000>"+i+"</FONT></B></FONT>"); //debugging
			page = visit_url("adventure.php?snarfblat=82");
		}
		break;
	case contains_text(page, "Wheel in the Clouds in the Sky"):
		print("DEBUG: You encountered an Wheel-adventure...", "green");
		adv1($location[Giant's Castle], -1, "");		
		print_html("<B><FONT color=#0000FF, SIZE=5><br />Hobo underling summoning counter: <FONT color=#FF0000>"+i+"</FONT></B></FONT>"); //debugging
		page = visit_url("adventure.php?snarfblat=82");
		break;
	default:
		print_html("<B><FONT color=#0000FF><br />DEBUG: You encountered an Non-combat...!?!</B></FONT>");
		print_html("<B><FONT color=#0000FF, SIZE=5><br />Hobo underling summoning counter: <FONT color=#FF0000>"+i+"</FONT></B></FONT>"); //debugging
		page = visit_url("adventure.php?snarfblat=82");
	}
}

print_html("<br /><B><FONT color=#0000FF>DEBUG: *** END OF LOOP ***<br /></B></FONT>");

if(contains_text(page, "You're fighting"))
	run_combat();

print_html("<B><FONT color=#0000FF><br />Allright, you used up your 5 'Summon Hobo underling' summons for today!<br /></B></FONT>");

It works normally well, if no restoration is required. IF restoration is needed though AND an Wheel adventure is encountered the script will fail...

Bale mentioned combat filters were a good choice to do this, but after a quick glance at this, I have no idea how to do it. Could somebody help me?
 

slyz

Developer
Why not do a CCS? This is what I use to get the +item% one:

Code:
[ default ]
"pickpocket"
skill summon hobo underling
skill ask the hobo to dance for you.
attack with weapon
("pickpocket" is between quotes so it is treated as a KoL macro command, and used even if you aren't in the clear).

If you only want to adventure in the castle until you used you 5 summons, then you need to keep track of the number of summons. Using the 3 parameter version of adventure() is a simpler way to do it:
PHP:
outfit("$$$ Hobo_Monkey $$$");
use_familiar($familiar[Leprechaun]);
equip($item [Meat detector]);

int i=0;
boolean summoned;
boolean stop;

set_property("choiceAdventure9","3");
set_property("choiceAdventure10","3");
set_property("choiceAdventure11","3");
set_property("choiceAdventure12","3");

if(have_outfit("Hodgman's Regal Frippery") && can_equip($item[Hodgman's bow tie]) && can_equip($item[Hodgman's porkpie hat])){
outfit("Hodgman's Regal Frippery");
} else {
abort("You either don't have 'Hodgman's Regal Frippery' or you aren't able to wear it!");
}


string summonHobo( int round, string opp, string page )
{
	// steal
	if ( page.contains_text( "Pickpocket" ) )
		return "pickpocket";
	// check if you are out of summons
	if ( round == 1 && !page.contains_text( "Summon Hobo underling" ) )
		stop = true ;
	// summon the Hobo underling
	if ( page.contains_text( "Summon Hobo underling" ) )
		return "skill Summon Hobo underling";
	if ( page.contains_text( "Ask the hobo for a drink" ) )
		return "skill Ask the hobo for a drink";
	if ( page.contains_text( "reaches into a pocket of one of his filthy garments and produces a beverage for you" ) )
	{
		i += 1 ;
		summoned = true ;
		print_html("<B><FONT color=#0000FF, SIZE=5><br />Hobo underling summoning counter: <FONT color=#FF0000>"+i+"</FONT></B></FONT>"); //debugging
	}
	// use the current CCS to finish the combat
	if( summoned ) return get_ccs_action( round - 2 );
	return get_ccs_action( round );
}

while( !stop )
{
	summoned = false ;
	adventure(1 , $location[giant castle], "summonHobo");
}
print_html("<B><FONT color=#0000FF><br />Allright, you used up your 5 'Summon Hobo underling' summons for today!<br /></B></FONT>");

Disclaimer: this is untested =)
 
Last edited:

ki77bot

Member
Wonderful...

Even if it should not fully work, it's great help, cause I couldn't figure out how the three-parameter-version (or combat filter) works...

Anyway, looks like it should work!

Thanks a lot.
 
Top