Minor bug: This line:
$ yui_pet_attempts = []
needs to be *before* the jump label, because right now, it is nuking yui_pet_attempts when it jumps back.
Woops, yeah you're absolutely right. Thanks for pointing that out!