Summon a random starred battle pet while ignoring opposite faction

As the title says, I’m trying to make a macro that will summon a random favorited pet that will ignore pets of the opposite faction. I’m murloc aficionado and play both factions. There are a few murlocs that are faction specific, and the summon random button or /rfp will brick itself if it tries to summon a murloc of the faction I’m not currently playing. Any help would be appreciated!

I don’t know if a macro can determine what faction alignment your character is, so that part may be impossible.

The rest is just an explicit list of pets you want summoned under whatever circumstances. There’s no magic that allows a macro to dynamically pick some pets out of your collection and ignore others.

You may be better off with an actual addon, and I’m not completely certain an addon could do all of that.