in_multi_fight

Pazleysox

Member
I'm running free turns with Eldritch Attunement active, so I can max out my free fights.

PHP:
	{
		if (have_familiar($familiar[machine elf]))
			{
			cli_execute("familiar machine elf");
			}
		{
		while (to_int(get_property("_machineTunnelsAdv")) < 5 )
		adv1($location[The Deep Machine Tunnels],-1,"");
		}
	}
I'm getting this: You are currently in a multi-stage fight after every single fight today.

I've added this to my script:
PHP:
		if(in_multi_fight())
			{
			run_combat();
			}
Into the script here, so it looks like this now:
PHP:
		while (to_int(get_property("_machineTunnelsAdv")) < 5 )
		adv1($location[The Deep Machine Tunnels],-1,"");
		if(in_multi_fight())
			{
			run_combat();
			}
         }

I have also changed IF to WHILE, and get the same results. I'm getting this error only from this location. I don't have the (in_multi_fight()) anywhere else in my script.

Can anyone help me with this?
 

Pazleysox

Member
PHP:
	{
		if (have_familiar($familiar[machine elf]))
			{
			cli_execute("familiar machine elf");
			}
		{
		while (to_int(get_property("_machineTunnelsAdv")) < 5 )
		adv1($location[The Deep Machine Tunnels],-1,"");
		}
	}

I think my error stems from having this whole thing inside "{}" I removed it from another location on the script, and have no issues, and don't have anything else like that. I'll have to check tomorrow when I have more free fights.

EDIT: That might not be the issue. I think there's a problem with having the machine elf as your familiar. I had the same issue elsewhere when the script (had a bug) used the machine elf as my familiar. When it was fixed, it ran fine. Still... More into tomorrow when I can research it.
 
Last edited:
The problem is actually a lack of curly bracers, to wrap the check into the while loop. If you don't follow a while or if statement with curly bracers it will only cover the first command right after, so right now, it's trying to visit the location repeatedly, and only after that while loop finishes, it will go and check to see if it's still in a multifight.

My free fight script, for some examples/inspiration: https://pastebin.com/kzvL8DT2

The relevant part for you, with comments:
Code:
void MachineElf() {
    if(have_familiar($familiar[Machine Elf]) && $familiar[Machine Elf].fights_today < $familiar[Machine Elf].fights_limit)
    {
        HeavyRains($familiar[Machine Elf].fights_limit-$familiar[Machine Elf].fights_today+1);
        if (have_effect($effect[Inside The Snowglobe])!=0)
            cli_execute("uneffect Inside The Snowglobe"); // My autoattack is setup to automatically run away if I have that effect in the deep machine tunnels, since it happens when I'm in there with my stomping boots
        FreeDrops("item, exp, 0.25 mainstat, 10000 max");
        use_familiar($familiar[Machine Elf]);
        while($familiar[Machine Elf].fights_today < $familiar[Machine Elf].fights_limit) { // <- Note this bracket
            adv1($location[The Deep Machine Tunnels], -1, "");
            while ( in_multi_fight() )
                run_combat();
        } // <- And his brother over here
    }
}
 
Last edited:

Pazleysox

Member
While fighting at the Snojo, I get You are currently in a multi-stage fight. I've run into this for a few days while running Eldritch Attunement. Today it happened after 7 snowmen fights. Once it was after 10 fights. I re-ran the script, and it ran fine after.

Code:
	if(to_boolean(get_property("snojoAvailable")) && get_property("_snojoFreeFights").to_int() < 10) 
	{
	print("Now were off to fight some snowmen.", "green");
		if(get_property("snojoSetting") == "NONE")
		visit_url("place.php?whichplace=snojo&action=snojo_controller");
		while(get_property("_snojoFreeFights").to_int() < 10)
				{
				adv1($location[The X-32-F Combat Training Snowman], -1, "");
				while(in_multi_fight())
				run_combat();
				}
	}
This is Bale's code for fighting at the snojo, with me adding only the in_multi_fight() lines.
 

ckb

Minion
Staff member
While fighting at the Snojo, I get You are currently in a multi-stage fight.

Do you have something in a before- or after- adventure script that is trying to do something when you are in the middle of a fight?
 

Pazleysox

Member
Do you have something in a before- or after- adventure script that is trying to do something when you are in the middle of a fight?

Augh! I didn't even think of that. I do have a script that runs through my familiars that drop items after combat. I will switch it to a before adventure, and see if that fixes it.
 
Top