Rematch 5.0

Discuss your favorite pet addons and macros.
Kyroskrane
Posts:8
Joined:December 27th, 2021
Pet Score:13279
Realm:Dalaran-us
Contact:
Re: Rematch 5.0

Post by Kyroskrane » November 11th, 2023, 2:55 pm

I have an old filter that was created in 4.x and worked fine in that version. The code for it is:

Code: Select all

-- Pets you can own max 1 of
-- Written by KyrosKrane Sylvanblade
-- Based on the default Pets Without Rares script

if not uniques then
    uniques = {}
    for speciesID in AllSpeciesIDs() do
        if select(10, C_PetJournal.GetPetInfoBySpeciesID(speciesID)) then
            uniques[speciesID] = true
        end
    end
end

if canBattle and uniques[speciesID] then
    return true
end
When I try the code above in 5.0, I get a lua error:

Code: Select all

Line 8: Usage: GetPetInfoBySpeciesID(speciesID)
This suggests that somehow, speciesID is nil or invalid. I also tested changing line 8 to:

Code: Select all

        if speciesID and select(10, C_PetJournal.GetPetInfoBySpeciesID(speciesID)) then
But that gave the same error message, suggesting that AllSpeciesIDs() is returning some non-nil value that is not a speciesID. Any thoughts on this?

Thanks in advance!

Gello
Posts:579
Joined:January 23rd, 2014
Pet Score:9171
Realm:Hyjal-us
Contact:

Re: Rematch 5.0

Post by Gello » November 11th, 2023, 3:13 pm

But that gave the same error message, suggesting that AllSpeciesIDs() is returning some non-nil value that is not a speciesID. Any thoughts on this?
Thanks for bringing this up. This is a bug. It was actually returning the whole table of all species for each species. It will be fixed in update going up tonight but if you're comfortable editing it, line 109 in roster/roster.lua, change this:

Code: Select all

tinsert(allSpecies,speciesPetIDs)
to this:

Code: Select all

tinsert(allSpecies,speciesID)
Also, if you'd like to filter pets with the unique flag set, you can use petInfo:

Code: Select all

return petInfo.canBattle and petInfo.isUnique
or maxCount

Code: Select all

return petInfo.canBattle and petInfo.maxCount==1
There's a lot of details about pets you can get from petInfo. The list is in info/petInfo.lua:

Code: Select all

    The stat can be any of these:

        petID: this is the pet reference Fetched (string, number, link, etc)
        idType: "pet" "species" "leveling" "ignored" "link" "battle" "random" or "unknown" (string)
        speciesID: numeric speciesID of the pet (integer)
        customName: user-renamed pet name (string)
        speciesName: name of the species (string)
        name: customName if defined, speciesName otherwise (string)
        level: whole level 1-25 (integer)
        xp: amount of xp in current level (integer)
        maxXp: total xp to reach next level (integer)
        fullLevel: level+xp/maxXp (float)
        displayID: id of the pet's skin (integer)
        isFavorite: whether pet is favorited (bool)
        icon: fileID of pet's icon or specific filename (integer or string)
        petType: numeric type of pet 1-10 (integer)
        creatureID: npcID of summoned pet (integer)
        sourceText: formatted text about where pet is from (string)
        loreText: "back of the card" lore (string)
        isWild: whether the pet is found in the wild (bool)
        canBattle: whether pet can battle (bool)
        isTradable: whether pet can be caged (bool)
        isUnique: whether only one of pet can be learned (bool)
        isObtainable: whether this pet is in the journal (bool)
        health: current health of the pet (integer)
        maxHealth: maximum health of the pet (integer)
        power: power stat of the pet (integer)
        speed: speed stat of the pet (integer)
        rarity: rarity 1-4 of pet (integer)
        isDead: whether the pet is dead (bool)
        isInjured: whether the pet has less than max health (bool)
        isSummonable: whether the pet can be summoned (bool)
        summonError: the error ID why a pet can't be summoned
        summonErrorText: the error text why a pet can't be summoned
        summonShortError: shortened text of why a pet can't be summoned (for pet card stat)
        isRevoked: whether the pet is revoked (bool)
        abilityList: table of pet's abilities (table)
        levelList: table of pet's ability levels (table)
        valid: whether the petID is valid and petID is not missing (bool)
        owned: whether the petID is a valid pet owned by the player (bool)
        count: number of pet the player owns (integer)
        maxCount: maximum number of this pet the player can own (integer)
        countColor: hex color code for pet count (white for 0, green for count<max, red for count=max)
        hasBreed: whether pet can battle and there's a breed source (bool)
        breedID: 3-12 for known breeds, 0 for unknown breed, nil for n/a (integer)
        breedName: text version of breed like P/P or S/B (string)
        possibleBreedIDs: list of breedIDs possible for the pet's species (table)
        possibleBreedNames: list of breedNames possible for the pet's species (table)
        numPossibleBreeds: number of known breeds for the pet (integer)
        needsFanfare: whether a pet is wrapped (bool)
        battleOwner: whether ally(1) or enemy(2) pet in battle (integer)
        battleIndex: 1-3 index of pet in battle (integer)
        isSlotted: whether pet is slotted (bool)
        inTeams: whether pet is in any teams (pet and species idTypes only) (bool)
        numTeams: number of teams the pet belongs to (pet and species only) (integer)
        sourceID: the source index (1=Drop, 2=Quest, 3=Vendor, etc) of the pet (integer)
        moveset: the exact moveset of the pet ("123,456,etc") (string)
        speciesAt25: whether the pet has a version at level 25 (bool)
        hasNotes: whether the pet has notes (bool)
        notes: the text of the pet's notes (string)
        isLeveling: whether the pet is in the queue (bool)
        isSummoned: whether the pet is currently summoned (bool)
        expansionID: the numeric index of the expansion the pet is from: 0=classic, 1=BC, 2=WotLK, etc. (integer)
        expansionName: the name of the expansion the pet is from (string)
        isSpecialType: whether the petid is a leveling, random or ignored (bool)
        passive: the "racial" or passive text of the pet type (string)
        shortHealthStatus: the numeric health at max health, or percent if injured, or DEAD if dead
        longHealthStatus: a hp/maxHp (percent%) description of pet health
        npcID: the npcID of the target for an unnotable petID
        tint: either "red" for revoked/wrong-faction pets, "grey" for otherwise unsummonable, nil for no tint
        strongVs: a table of [ability]=petType of attacks that do increased damage (table)
        toughVs: the petType of attack that this pet takes reduced damage from (integer)
        vulnerableVs: the petType of attack that this pet takes increased damage from (integeter)
        formattedName: name of pet with color codes for its rarity
        isStickied: whether the pet is temporarily stickied to top of pet list (wrapped) (bool)

Kyroskrane
Posts:8
Joined:December 27th, 2021
Pet Score:13279
Realm:Dalaran-us
Contact:

Re: Rematch 5.0

Post by Kyroskrane » November 11th, 2023, 4:05 pm

Thanks for the confirmation on the bug!
Gello wrote:
November 11th, 2023, 3:13 pm
Also, if you'd like to filter pets with the unique flag set, you can use petInfo:
or maxCount
I didn't know about petInfo - I'm guessing it's new in 5.0? When I originally wrote my filter, I just looked at what the scripts for the existing (I assume default) filters did, copy/pasted, and tweaked a little. I can update my filter to work with that. Thanks again!

Gello
Posts:579
Joined:January 23rd, 2014
Pet Score:9171
Realm:Hyjal-us
Contact:

Re: Rematch 5.0

Post by Gello » November 11th, 2023, 9:26 pm

Update posted to wowinterface and curse tonight addresses most issues I've gotten here and elsewhere:

11/11/2023 version 5.0.1
  • Added right-click menu to abilities to 'Find Pets With This Ability' to search for all pets that share the ability
  • Added Toolbar Option 'Always Use Pet Satchel' to always use the pet satchel button to cycle through less-frequently used toolbar buttons rather than always showing all toolbar buttons
  • Level bubbles in all except compact lists are now separated into textures and fontstrings to use actual font rendering
  • Added pet menu option "Start Leveling" to add a pet to the top of the leveling queue rather than the end
  • When clicking the alert toast or link for pet, it will now search for the pet again
  • Added Breed Options 'Hide Breed In Lists' and 'Hide Breed In Pet Slots' to hide breeds displayed in lists and pet slots
  • Increased the speed of exporting many teams and pet lists
  • Fixed an issue where Interact Options 'On Mouseover' and 'On Soft Interact' can fail to interact with a second target after targeting one target with a saved team while you mouseover or soft interacted with the second
  • The team group 'Ungrouped Teams' can now be renamed (but it can't be deleted--this is a "system" group that needs to exist)
  • Fix for AllSpeciesIDs iterator in script filters
  • If you used Rematch 4 and 'Keep Notes On Screen' was checked, a one-time fix on next login will enable both 'Keep Notes On Screen' and 'Even When Escape Pressed'
  • Fix for Miscellaneous Option 'Keep Companion' potentially re-enabling on next login/reload
  • Added tooltips to Source and Type icons at the bottom of the collection summary dialog's bar charts
  • Clicking an active script filter in the script filter menu will now clear the script filter
  • When a single team is imported, pets and abilities for the team are displayed in the import dialog
  • Localization template updated
It does not include a fix for pets falling in/out of an active filter criteria. (it's been mentioned specifically for script filters but this applies to all filters.) This one will take time to solve properly since Rematch 5 is optimized to not run filters (a computationally expensive task) unless needed and just slapping this into a PET_JOURNAL_LIST_UPDATE will make filters run much more often than needed.

User avatar
Mot
Posts:31
Joined:February 19th, 2018
Pet Score:14236
Realm:Azjol-Nerub-eu
Contact:

Re: Rematch 5.0

Post by Mot » November 12th, 2023, 7:54 am

Did you remove the jump-to-top/jump-to-bottom buttons, or is that a bug? (The ones that were below/above the scroll arrow buttons.)

User avatar
Mot
Posts:31
Joined:February 19th, 2018
Pet Score:14236
Realm:Azjol-Nerub-eu
Contact:

Re: Rematch 5.0

Post by Mot » November 12th, 2023, 8:12 am

Just noticed this while catching wild pets in Emerald Dream:

After a battle, when a hurted team pet gets replaced by a fresh one, the fresh one does not have the correct abilities set. Only when I click on the team (in the list) again, the abilities are adjusted to what is saved in the team.

Gello
Posts:579
Joined:January 23rd, 2014
Pet Score:9171
Realm:Hyjal-us
Contact:

Re: Rematch 5.0

Post by Gello » November 12th, 2023, 3:45 pm

The little buttons to go to top/bottom of lists is removedto use the new scrollbars with variable-height thumb. It may return later.

On the abilities, I assume you have Load Healthiest Pets checked in Team Options. I'll take a look.

Kyroskrane
Posts:8
Joined:December 27th, 2021
Pet Score:13279
Realm:Dalaran-us
Contact:

Re: Rematch 5.0

Post by Kyroskrane » November 13th, 2023, 1:24 am

I encountered an odd situation with Rematch 5.0.1. I have the option enabled to show the Rematch window when I target an NPC that has a saved team with a leveling pet, but only if the team is injured. Here are the options for interacting. (On a related note, didn't there used to be an option in this section to also show the window if you have a leveling team loaded, and the Safari Hat was not equipped? Did it get moved to the Toolbar section and integrated into the Safari Hat setting there? That location feels unintuitive.)

ImageImage

I targeted Erris in my garrison. The team loaded correctly, but the window popped up and the Safari Hat icon was flashing (you can see a bit of the glow around the icon in the screenshot below). You can see in the screenshot, the safari hat buff was already active. I verified that none of the loaded pets are injured.

Image

When I expanded to the full window to get screenshots of the options, the Safari Hat icon stopped flashing and correctly gained the red "down" arrow.

Gello
Posts:579
Joined:January 23rd, 2014
Pet Score:9171
Realm:Hyjal-us
Contact:

Re: Rematch 5.0

Post by Gello » November 13th, 2023, 5:04 am

Thanks for the screenshot of options. Sometimes combinations of options have different effects. I'll look into it.

The Safari Hat Reminder option has existed in Toolbar Options since 2016 when it was added. It works independently of any interact/targeting options (or should, anyway)

Mutanis
Posts:3
Joined:December 2nd, 2016
Pet Score:10293
Realm:Mannoroth-eu
Contact:

Re: Rematch 5.0

Post by Mutanis » November 13th, 2023, 5:07 pm

I got an lua error.

Code: Select all

Message: Usage: PickupPet(petGUID)
Time: Mon Nov 13 23:00:06 2023
Count: 1
Stack: Usage: PickupPet(petGUID)
[string "=[C]"]: ?
[string "=[C]"]: in function `PickupPet'
[string "@Interface/AddOns/Rematch/templates/petListButton.lua"]:272: in function <Interface/AddOns/Rematch/templates/petListButton.lua:265>

Locals: (*temporary) = nil
To reproduce --> activate "Compact Pet List" in Appearance Options. Then try to drag a pet from the pet list into a team slot. The error happens only when you select the icon of the pet.

Gello
Posts:579
Joined:January 23rd, 2014
Pet Score:9171
Realm:Hyjal-us
Contact:

Re: Rematch 5.0

Post by Gello » November 14th, 2023, 5:12 am

To reproduce --> activate "Compact Pet List" in Appearance Options. Then try to drag a pet from the pet list into a team slot. The error happens only when you select the icon of the pet.
Thanks for steps to reproduce. This will be fixed next update.

Gello
Posts:579
Joined:January 23rd, 2014
Pet Score:9171
Realm:Hyjal-us
Contact:

Re: Rematch 5.0

Post by Gello » November 16th, 2023, 8:28 pm

Kyroskrane wrote:
November 13th, 2023, 1:24 am
I targeted Erris in my garrison. The team loaded correctly, but the window popped up and the Safari Hat icon was flashing (you can see a bit of the glow around the icon in the screenshot below). You can see in the screenshot, the safari hat buff was already active. I verified that none of the loaded pets are injured.
Does this always happen? I can't reproduce this.

Kyroskrane
Posts:8
Joined:December 27th, 2021
Pet Score:13279
Realm:Dalaran-us
Contact:

Re: Rematch 5.0

Post by Kyroskrane » November 17th, 2023, 2:37 am

Gello wrote:
November 16th, 2023, 8:28 pm
Kyroskrane wrote:
November 13th, 2023, 1:24 am
I targeted Erris in my garrison. The team loaded correctly, but the window popped up and the Safari Hat icon was flashing (you can see a bit of the glow around the icon in the screenshot below). You can see in the screenshot, the safari hat buff was already active. I verified that none of the loaded pets are injured.
Does this always happen? I can't reproduce this.
I've only seen this happen with that specific Erris. I don't have that Erris up again, so I can't retest it now. Is there some way for me to export my team or settings, so you can check the data at least? Or I could just zip up my entire lua file if you like.

Gello
Posts:579
Joined:January 23rd, 2014
Pet Score:9171
Realm:Hyjal-us
Contact:

Re: Rematch 5.0

Post by Gello » November 17th, 2023, 3:35 am

Kyroskrane wrote:
November 17th, 2023, 2:37 am
I've only seen this happen with that specific Erris. I don't have that Erris up again, so I can't retest it now. Is there some way for me to export my team or settings, so you can check the data at least? Or I could just zip up my entire lua file if you like.
Interesting. For testing purposes I've had a different Erris up for years (if you get the quest but never complete/abandon it, she never goes away). I think if it only happens for this one target, which is not up all the time, I'm going to review this one later since there's other issues to fix still and I can't realistically do anything until I can reproduce it. But let me know if it happens on a different target.

In the meantime I'll see about adding a way to export settings (importing settings may be nice too).

Kyroskrane
Posts:8
Joined:December 27th, 2021
Pet Score:13279
Realm:Dalaran-us
Contact:

Re: Rematch 5.0

Post by Kyroskrane » November 17th, 2023, 3:41 pm

Gello wrote:
November 17th, 2023, 3:35 am
I think if it only happens for this one target, which is not up all the time, I'm going to review this one later since there's other issues to fix still and I can't realistically do anything until I can reproduce it.
By sheer luck, the correct Erris is up in my garrison today. I played around a bit but wasn't able to reproduce the bug. Given that it happened last week now and isn't reproducible, I'm willing to write it off as post-patch weirdness that may have been silently fixed by Blizz, or triggered by some misbehaving addon or something.

User avatar
Paladance
Posts:1010
Joined:July 18th, 2015
Pet Score:12412
Realm:Burning Legion-eu
Contact:

Re: Rematch 5.0

Post by Paladance » November 18th, 2023, 3:49 am

A few days ago someone on Discord said that some team strings from Xu-fu's can't be read (not a valid import) and identified the issue as colon in the name (Fight Night: X encounters from Legion).

The problem seems obvious because colon serves as a separator and thus requires an escape character, but this made me wonder how did it work before 5 in the first place.

Said user also noticed:
wobblit wrote:rematch.teamStrings:ImportGroup in the Rematch 5 code seems to take a semi-colon from the imported name and replace them to a colon in the saved name, unless I read it wrong. So seems like a colon in the name should go as a semicolon in the import string?
This comment seems to be about the same issue.

Now, of course, it would make more sense for us to return to lead NPC names as this is the preferred way of storing teams, would have to ask around if the NPC name can be extracted from links cuz there's no obvious entry for the end user :D
This, however, wouldn't help with the strings people have been storing for years.
Image

I have compiled community knowledge & data about pet battle abilities!
https://www.warcraftpets.com/community/forum/viewtopic.php?f=3&t=19507

Gello
Posts:579
Joined:January 23rd, 2014
Pet Score:9171
Realm:Hyjal-us
Contact:

Re: Rematch 5.0

Post by Gello » November 18th, 2023, 12:58 pm

this made me wonder how did it work before 5 in the first place.
In Rematch 4: [^\n]- gets the minimum number of characters that aren't a newline
In Rematch 5: [^:]+ gets the maximum number of characters that aren't a colon

It's going back to [^\n]- in next update.

The semicolon business is being dropped. It was added for new group exports (which exports properties now and didn't in Rematch 4 for tabs) and the convention was kept for teams without realizing it wouldn't work.

User avatar
Mot
Posts:31
Joined:February 19th, 2018
Pet Score:14236
Realm:Azjol-Nerub-eu
Contact:

Re: Rematch 5.0

Post by Mot » November 19th, 2023, 12:55 pm

Last week I posted this:
After a battle, when a hurted team pet gets replaced by a fresh one, the fresh one does not have the correct abilities set. Only when I click on the team (in the list) again, the abilities are adjusted to what is saved in the team.
This is still true, but yesterday I found another bug which is probably the trigger for the messed up abilities:

To reproduce:

1. Have a team with one leveler slot, and have at least 2 sets of healthy carry (non-leveling) pets for that team.
2. Enable "Load Healthiest Pet" and "After Battles Or Heals Too".
3. In the leveler slot, put a species where you have already two lv25.
4. Do the battle.

After the battle, Rematch swaps in an uninjured set of carry pets. This is fine and is what "After Battles Or Heals Too" is supposed to do. But: It also replaces the injured leveler with one of your lv25 of the species.

Now, the presence of a lv25 at the position of the leveler slot seems to "invalidate" the team (since the team has a leveler slot, and a lv25 cannot go into a leveler slot). Thus, the now "teamless" pets regain the abilities they had before (off-team). Well, that's my theory ;)

The problem with the swapped lv25 in the leveler slot seems to be in the `AssertHealthiestPet` function in loadTeam.lua, line 80:

For the second for loop in the function, I traced the variable values and got this:

Code: Select all

loadedPetID: BattlePet-0-0000074559C5
petInfo.idType: pet
loadedPetID: BattlePet-0-000009534611
petInfo.idType: pet
loadedPetID: BattlePet-0-00000B52AAED
petInfo.idType: pet
The third pair is slot 3, which was my leveler slot. The idType is "pet", since `loadedPetID` is derived from `GetLoadoutInfo` which always returns the pet GUID. With that, the `if petInfo.idType=="pet"` conditional (line 96) will always evaluate to true, even for the leveler in slot 3.

Now, when I change line 94 loadTeam.lua to…

Code: Select all

-- local loadedPetID = rematch.loadouts:GetLoadoutInfo(i)
local loadedPetID = team.pets[i]
…in order to get the "petId" from the team function (instead of `GetLoadoutInfo`), then I get the seemingly more useful values:

Code: Select all

loadedPetID: BattlePet-0-000007474549
petInfo.idType: pet
loadedPetID: BattlePet-0-00000B3F6EDE
petInfo.idType: pet
loadedPetID: 0
petInfo.idType: leveling
The leveler (slot 3) is now idType "leveling" (instead of "pet") and therefore is excluded from getting replaced by a "healthy" lv25.

Since I don't have a picture of the whole addon, this is certainly not the cleanest solution. But you get the idea.

Gello
Posts:579
Joined:January 23rd, 2014
Pet Score:9171
Realm:Hyjal-us
Contact:

Re: Rematch 5.0

Post by Gello » November 19th, 2023, 2:14 pm

Update just posted addresses more issues, including the one to fix colons in imports:

11/19/2023 version 5.0.2
  • Added Release Pet and Cage Pet to right-click menu of pets in the queue if the pet can be released or caged
  • Leveling Queue Option 'Automatically Level New Pets' -> 'Only Pets Without One at 25' will no longer add new pets to the queue if you have none at 25 but one already exists in the queue
  • Saving a script filter will apply the filter
  • While pet filters are active and the window is on screen, any change to pets will re-run filters to potentially add/drop pets that meet the filter criteria
  • Leveling pets should no longer be replaced by their healthier level 25 versions when Load Healthiest Pets enabled
  • Replacement pets swapped in from Load Healthiest Pets option should load the same abilities as the pet it's replacing
  • Healthiest pets should no longer be swapped out for a less-healthy version when Load Healthiest Pets enabled
  • Imported teams now support colons (:) in their name again. Note: Teams and groups exported since 5.0 may have a semicolon in place of a colon. This replacement will not happen anymore. Imports will work fine with the semicolon
  • Fix for error when picking up a pet from the icon in the compact pet list
  • In About Rematch section of options, all options can now be exported for troubleshooting purposes, or reset to their default values
  • Localization template updated
This is still true, but yesterday I found another bug which is probably the trigger for the messed up abilities:
Yeah there were at least 3 separate issues with Load Healthiest Pets addressed in this update:
  • It was replacing pets in the leveling queue with level 25 versions. This was fixed by checking if they're a leveling pet before finding a healther one.
  • When bringing in healthier pets it was slotting the pet but not the abilities. This was fixed by also slotting the abilities.
  • When a team with an injured pet (and a healthier alternative) was loaded multiple times in a row, the injured pet could swap back in because the healthier pet was in an exclusion list. This was fixed by adding an "allowPetID" to allow the healthier pet to stay. (It needs to stay in the exclusion list for other find functions--such as for a speciesID or another same-species injured pet)
Your solution is a good one and less heavy-handed than mine. (My solution means a pet in the queue will never be replaced by a healthier version even if they're saved directly without being loaded from the queue.)

There may be more problems with Load Healthiest Pets the way this option interacts with others. I never use this option or any auto load etc. options so they get minimal testing from me.

There's a button to export/reset options in the About Rematch section of options now. I was working on an import button too until it dawned on me it'd be super inviting to tinker with values (I would!) which could potentially break the addon so I dropped it. The alternative would be to use base64 or something to obfuscate values which I'm not a fan of. It will be back later when the addon is more stable.

User avatar
Mot
Posts:31
Joined:February 19th, 2018
Pet Score:14236
Realm:Azjol-Nerub-eu
Contact:

Re: Rematch 5.0

Post by Mot » November 21st, 2023, 7:31 am

Related to an old post of mine here, I made a little WeakAura that attaches to Rematch and shows the current state of the "Allow Any Version" setting (from Options > Team Options > Load Healthiest Pets):

Allow Any Version disabled:
allowany_disabled.png
allowany_disabled.png (111.85KiB)Viewed 104965 times

Allow Any Version enabled:
allowany_enabled.png
allowany_enabled.png (110.52KiB)Viewed 104965 times

Clicking the Aura frame toggles the setting.

The Aura should be especially useful for people who do a lot of leveling battles with different teams and scripts, some of which require a specific breed and some of which do not. (The indicator should prevent you from wasting a fight because the wrong breeds are loaded, and the button makes it easier to switch the setting.)

Download and more info on Wago: https://wago.io/JwW5-HtP3

Post Reply