Simple script for the Haunted House

ElCarrot

New member
I wanted a simpler way for using up the guide's without having to click through all the time, so I made this quick and dirty script. Feel free to modify / re-use.

Code:
int MapQuantity;
int ChainQuantity;
int MirrorQuantity;
int ShellQuantity;

void UseMap() {
	visit_url("inv_use.php?pwd&which=3&whichitem=5307");
}

void GoToBasement() {
	visit_url("choice.php?pwd&whichchoice=554&option=3&choiceform3=Go+to+the+basement");
}

void GoToAttic() {
	visit_url( "choice.php?pwd&whichchoice=554&option=1&choiceform1=Go+to+the+attic" );
}

void GoToMainFloor() {
	visit_url( "choice.php?pwd&whichchoice=554&option=2&choiceform2=Go+to+the+main+floor");
}

boolean KillWerewolves() {
	if (ShellQuantity>0) {
		UseMap();
		visit_url( "choice.php?pwd&whichchoice=554&option=1&choiceform1=Go+to+the+attic");
		string page = visit_url( "choice.php?pwd&whichchoice=549&option=5&choiceform5=Investigate+the+banging");
		if (page.contains_text("loose shutter")) {
			print( "All Werewolves killed" );
			return false;
		} else {
			print( "Killed some Werewolves" );
		}
		return true;
	} else {
		print( "No Shells Left - can't kill any werewolves" );
		return false;
	}
}

boolean KillZombies() {
	if (ChainQuantity>0) {
		UseMap();
		visit_url( "choice.php?pwd&whichchoice=554&option=2&choiceform2=Go+to+the+main+floor");
		string page = visit_url( "choice.php?pwd&whichchoice=550&option=3&choiceform3=Enter+the+dining+room");
		if (page.contains_text("cold cooked spaghetti")) {
			print( "All Zombies killed" );
			return false;
		} else {
			print( "Killed some Zombies" );
		}
		return true;
	} else {
		print( "No Chains Left - can't kill any Zombies" );
		return false;
	}
}

boolean KillSkeletons() {
	if (MirrorQuantity>0) {
		UseMap();
		visit_url( "choice.php?pwd&whichchoice=554&option=2&choiceform2=Go+to+the+main+floor");
		string page = visit_url( "choice.php?pwd&whichchoice=550&option=4&choiceform4=Look+in+the+closet");
		if (page.contains_text("gasp in shock")) {
			print( "All Skeletons killed" );
			return false;
		} else {
			return true;
			print ("Killed some Skeletons");
		}
	} else {
		print( "No Mirrors Left - can't kill any Skeletons" );
		return false;
	}
}

void getChain() {
	UseMap();
	visit_url("choice.php?pwd&whichchoice=554&option=3&choiceform3=Go+to+the+basement");
	visit_url("choice.php?pwd&whichchoice=551&option=1&choiceform1=Check+out+the+props+room");
	visit_url("choice.php?pwd&whichchoice=552&option=1&choiceform1=Examine+the+chainsaw");
}

void getMirror() {
	UseMap();
	visit_url("choice.php?pwd&whichchoice=554&option=3&choiceform3=Go+to+the+basement");
	visit_url("choice.php?pwd&whichchoice=551&option=1&choiceform1=Check+out+the+props+room");
	visit_url("choice.php?pwd&whichchoice=552&option=3&choiceform3=Examine+the+mirror");
}

void getShell() {
	UseMap();
	visit_url("choice.php?pwd&whichchoice=554&option=3&choiceform3=Go+to+the+basement");
	visit_url("choice.php?pwd&whichchoice=551&option=1&choiceform1=Check+out+the+props+room");
	visit_url("choice.php?pwd&whichchoice=552&option=2&choiceform2=Examine+the+reloading+bench");
	visit_url("choice.php?pwd&whichchoice=553&option=1&choiceform1=Melt+down+your+silver+hammer");
}

void main( int adv_to_use )
{
	if( adv_to_use < 1 ) adv_to_use = my_adventures();
	while( my_adventures() > 0 && adv_to_use > 0 )
	{
		MapQuantity = item_amount($item[Haunted Sorority House staff guide]);
		ChainQuantity = item_amount($item[chainsaw chain]);
		MirrorQuantity = item_amount($item[funhouse mirror]);
		ShellQuantity = item_amount($item[silver shotgun shell]);
		
		print( MapQuantity + " Maps Left" );
		print( ChainQuantity + " Chainsaw chains Left" );
		print( MirrorQuantity + " Funhouse Mirrors Left" );
		print( ShellQuantity + " Silver Shotgun Shells Left" );
		
		if (MapQuantity == 0) {
			print ("No Maps left - aborting");
			adv_to_use = 0;
		} else {
		boolean test = true;
		
		// Uncomment the action you want to do
		//test = KillWerewolves();
		//test = KillZombies();
		test =KillSkeletons();
		//getChain();
		//getMirror();
		
		if (test==false) {
			adv_to_use = 0;
		}
		adv_to_use = adv_to_use -1;
		}
	}
}
 

cyberturtle

New member
Thanks for the code ElCarrot. Here is my code to do a two turn vampire attack then grab the extra guides

Code:
void UseMap() {
    visit_url("inv_use.php?pwd&which=3&whichitem=5307");
}

boolean Killvamp() {
    UseMap();
    visit_url("choice.php?pwd&whichchoice=554&option=3&choiceform3=Go+to+the+basement");
    string page = visit_url("choice.php?pwd&whichchoice=551&option=2&choiceform1=Investigate+the+coffins");
    if (page.contains_text("the coffins are empty")) {
            chat_clan( "the coffins are empty" );
            print( "All Vampires killed" );
            return false;
        } else {
            chat_clan( "Killed some Vampire, Thanks to Cyberturtle" );
            print( "Vampires killed" );
        }
}

void Getguide() {
    Usemap();
    visit_url( "choice.php?pwd&whichchoice=554&option=1&choiceform1=Go+to+the+attic" );
    string page = visit_url( "choice.php?pwd&whichchoice=549&option=1&choiceform1=Take+some+mimeographs");
}


void main()
{
    equip($slot[acc1], $item[plastic vampire fangs]);
    Killvamp();
    Getguide();
}
 
Here's what I turned it into - basically a way of automating my lazyish solo runs, after the initial stuff is done.

The script assumes the following:

  • The user set up a custom combat script / an autoattack combat macro that uses the ghost trap on ghosts if available and else kills the monster
  • The users mass-kills vampires and gets any surplus staff guides manually before running this script
  • The user manages any mayfly bait manually (equipping and using it in combat as long as it has charges)
  • Prior to running the script, the user sets up the choice adv choices so they make sense (i.e. to include killing monsters if they are still available)
  • The user has set up their desired monster level prior to running this script but doesn't mind if the script increases it

Basically the script uses maps as long as they are available to do semi-smart things (getting killing items if there are two or less available; else mass-killing monsters) and else adventures. It tries to set up the choice adventure actions in a not-too-dumb way, tracking which monsters have been made extinct. Note that it currently only finds out that a particular monster is extinct if it has actually used a map and tried to mass-kill that monster, since I didn't find a way to get that information from Mafia when the "monster is extinct" message resulted from normal adventuring reaching a noncombat.

Feel freee to improve the script, I guess there is plenty of room for it :)

View attachment hauntedhouse.ash
 
Last edited:

Zaranthos

Member
I've been using the hauntedhouse.ash and it works reasonably well but it fails to use staff guides for some reason. Mafia will think it used them and decrease the inventory count but they're not actually used so when it thinks you've run out it stops using them.
 

fronobulax

Developer
Staff member
I've been using the hauntedhouse.ash and it works reasonably well but it fails to use staff guides for some reason. Mafia will think it used them and decrease the inventory count but they're not actually used so when it thinks you've run out it stops using them.

The relay browser annotation seems to pretty consistently believe I have one more staff guide than I have. Typically this occurs after the first use but given the limited time content of the Haunted House I have not taken the time and paid enough attention to file a useful Bug Report.
 

Ferdawoon

Member
The relay browser annotation seems to pretty consistently believe I have one more staff guide than I have. Typically this occurs after the first use but given the limited time content of the Haunted House I have not taken the time and paid enough attention to file a useful Bug Report.

I have had this one too. I have seen it happen when I [use] the staff guides after getting them from the non-combat. Just made a bug post about it.
 
Top