Force Rest at Campground Loop

General_Herpes

New member
I'm trying to figure out a way to use remaining adventures to sleep at my campground. I'm basically farming dream items by doing this.

The main issue I'm having now is that I can't rest at my campground while at full HP. I thought to use an item that inflicted damage to myself prior to each rest attempt but I'm not sure which item to use for that. I did find that if I get poisoned then use a tiny house that I'm no longer at full health. I can rest after doing this combo through the relay browser but not through my script.

Here is the snippet from my ASH script:

Code:
while (my_adventures() > 0)
{
	use ( 1, $item[marzipan skull] );
	use ( 1, $item[tiny house] );
	cli_execute( "rest 1");
}

I've tried using "camp rest" and "restore_hp" without luck. When I run this snippet I get this error:
(usable quantity of tiny house is limited to 0 by needed restoration)

I found a thread stating that this is something kolmafia does to prevent accidently using items inefficiently.

Is there a better approach at this? If there isn't a way to override this behavior does someone have a suggestion of an item to use during the loop to allow me to rest?

Thanks!
 

heeheehee

Developer
Staff member
If you absolutely want to force this behavior, you could probably do it by visiting inv_use.php. A simpler option would be to simply use, say, an awful poetry journal instead of a marzipan skull and a tiny house (as you wouldn't be consuming limited resources that way).
 

Bale

Minion
Here's the script that I used to find the speakeasy password for Hot Socks. It should cover your needs as well. I modified it for you so that it won't stop when you get the password letter.

Code:
string page;
string REST_URL = "campground.php?action=rest";
string ROMANTIC_COUNTER_END_LABEL = "Romantic Monster window end";

void dream(string rest) {
	int a = index_of(rest, '<table  width=95%  cellspacing=0');
	int b = index_of(rest, '<table  width=95%  cellspacing=0 cellpadding=0><tr><td style="color: white;" align=center bgcolor=blue><b>Your Campsite');
	if(a >= 0) {
		if(b < 0) b = length(rest);
		rest = substring(rest, a, b);
		rest = rest.replace_string("<p>You lie back in your gauze hammock and rest.", "");
		rest = rest.replace_string("<p>Your Pagoda sends out groovy vibes, making your rest more restful.", "");
		if(length(rest) > 709) {
			print_html(rest);
			print(" ");
		}
	} else print("Resting failed?", "red");
}

#while ( my_adventures() > 0 && !page.contains_text( "dream of a dog" ) )
# while ( my_adventures() > 0 && !page.contains_text( "a single letter glows" ) )
while ( my_adventures() > 0 )
{
	if ( ROMANTIC_COUNTER_END_LABEL.get_counters( 0, 0 ).length() > 0 )
	{
		adv1( $location[ The Haunted Pantry ], -1, "" );
	}
	cli_execute( "burn *" );
	if(my_mp() >= my_maxmp())
		switch(my_class()) {
		case $class[Seal Clubber]:
			use_skill(1, $skill[Seal Clubbing Frenzy]);
			break;
		case $class[Turtle Tamer]:
			use_skill(1, $skill[Patience of the Tortoise]);
			break;
		case $class[Pastamancer]:
			use_skill(1, $skill[Manicotti Meditation]);
			break;
		case $class[Sauceror]:
			use_skill(1, $skill[Sauce Contemplation]);
			break;
		case $class[Disco Bandit]:
			use_skill(1, $skill[Disco Aerobics]);
			break;
		case $class[Accordion Thief]:
			use_skill(1, $skill[Moxie of the Mariachi]);
			break;
		case $class[Avatar of Boris]:
			use_skill(1, $skill[Laugh it Off]);
			break;
		case $class[Zombie Master]:
		case $class[Avatar of Jarlsberg]:
		default:
			if ( item_amount($item[awful poetry journal]) > 0 )
				use(1, $item[awful poetry journal]);
			else
				abort("Your class lacks a good mana burning skill and an awful poetry journal.");
		}
	try page = REST_URL.visit_url();
	finally dream(page);
}

Edit: I believe that was based on work by others HERE.
 
Last edited:

Cool12309

Member
Wouldn't a much better solution be just equipping an item that boosts max HP and then un-/re-equipping each rest so you're never at full HP?
 

xKiv

Active member
Just cast one of the 1-mp starter buffs (like the code posted by Bale does). The "rest" command doesn't check just HP but also MP, and resting will refill that MP.
 
Top