Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Can knight fight while the pet fetches (Kithgard brawl)


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?

1 Like

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


Something like this

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

pet.on( "spawn", potFetch );

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