Can knight fight while the pet fetches (Kithgard brawl)


#1

In the Kithgard Brawl healing potins spawn sometimes. I tried to send a pet (cougar) to fetch the potion - it listens, however the knight stops fighting while the pet fetches.

Is it somehow possible to command the pet to fetch while the fighter contiues to battle? Something similar to the swap of moveXY to move?


#2

I think since you commanded the pet do do something, the knight stops all action till the pets completes the command.


#3

Something like this

var potFetch = function()
{
	while ( true )
	{
		var pot = hero.findByType( "potion" )[ 0 ];
		if ( pot )
		{
			pet.fetch( pot );
		}
	}
}

pet.on( "spawn", potFetch );

#4

Of course! Thank you. After having written thousands of on(‘submit’ , click, change, load, resize… I have forgotten that codecombat has also events.