Rematch 4.0

Discuss your favorite pet addons and macros.
User avatar
Threewolves
Posts: 25
Joined: February 18th, 2018
Pet Score: 5109
Realm: Dentarg-US
Contact:

Re: Rematch 4.0

Post by Threewolves » April 29th, 2019, 11:40 am

Rematch is the primary reason I started getting into pet battling/collecting/etc. So thanks. I came here to see if it would be possible to implement an option that, when ticked, automatically revives pets after a battle? If revive is on CD, it automatically applies a bandage from your inventory to minimize time between leveling at Sir Galveston, Rydyr, Super Squirt, etc. Perhaps it could be a power leveling mode option that also autoloads healthiest same type pets before using said bandages and only applies the bandage if no same required pets are still living and level 25 rare quality. Hope you all are well. Have a great day!
Kindness is contagious.

Gello
Posts: 433
Joined: January 23rd, 2014
Pet Score: 4238
Realm: Hyjal-US
Contact:

Re: Rematch 4.0

Post by Gello » April 29th, 2019, 1:57 pm

This won't be a satisfying answer, I'm afraid, but the revive and bandage buttons have the same restriction as normal casts and item use, in that they require a hardware event to happen. A key binding or mouse button needs to happen the moment a revive or bandage is used. They can't happen in reaction to leaving battle. There's an exception to this with the 'gossip' windows when interacting with a stable master to heal pets; those are frequently navigated by addons/macros and Blizzard has not locked down that, as far as I know. But it's not something Rematch can hook into when you're not at a stable master with their gossip opened.

So in a practical sense, there's no way to make Rematch automatically restore the pet's health after a battle. (There are creative tricks like making the whole screen an invisible button that captures the first click after a battle and such, but I feel those are ultimately disruptive and not practical.)

However, there is an option to load the healthiest pet when a team loads. Under Team Options, 'Load Healthiest Pets' will load the healthiest version of pets that share the same stats (level, rarity, breed). And a sub-option 'Allow Any Version' to disregard stats and load the healthiest version of a pet regardless.

There's been some requests for having the load-healthiest bit happen after a battle ends. That can potentially happen automatically. I honestly can't remember if I've reviewed that again lately, but I'll take another look. I see that I've excluded this behavior from pets in the queue which was a major concern for this (specifically timing issues with the queue and leaving battles).

User avatar
Threewolves
Posts: 25
Joined: February 18th, 2018
Pet Score: 5109
Realm: Dentarg-US
Contact:

Re: Rematch 4.0

Post by Threewolves » April 29th, 2019, 2:53 pm

Thanks for the prompt response. I understand there are limitations add on developers have to work with and I appreciate everything you do for the WoW pet battling community. As for the Load Healthiest Pet option, I'm wondering if that option could be assigned to a specific tab only? For instance, I'd like to set this option for only my power leveling teams tab and not my world quest teams. So, I wouldn't have to try and remember to reset it after leveling pets.
Kindness is contagious.

Gello
Posts: 433
Joined: January 23rd, 2014
Pet Score: 4238
Realm: Hyjal-US
Contact:

Re: Rematch 4.0

Post by Gello » April 30th, 2019, 4:17 am

That's an interesting consideration. With only the first option checked, a substitution only happens for pets who are the same level, rarity and breed. That a swap happened wouldn't be noticable if pets weren't renamed. But I can see value in having the looser restriction being opt-in for some teams.

User avatar
Threewolves
Posts: 25
Joined: February 18th, 2018
Pet Score: 5109
Realm: Dentarg-US
Contact:

Re: Rematch 4.0

Post by Threewolves » May 1st, 2019, 3:28 am

I'm still trying to figure out how to get auto load to repeat at repeatable pet battles when speed leveling. I have multiples of the pets for teams. rematch will load them but only if i open it and click the team or click load. I'm trying to find a way to "force" auto load on mouseover when repeating the same battles.
Kindness is contagious.

Gello
Posts: 433
Joined: January 23rd, 2014
Pet Score: 4238
Realm: Hyjal-US
Contact:

Re: Rematch 4.0

Post by Gello » May 1st, 2019, 6:14 pm

I'm afraid Rematch makes an extra effort to prevent reloading the same team for auto load. You may know this, but you can also click the title of the team (has the gold/brown background above the three slotted pets) to quickly reload a team.

User avatar
FuxieDK
Posts: 835
Joined: July 27th, 2009
Pet Score: 9968
BattleTag®: FuxieDK#2678
Realm: Draenor-EU
Contact:

Re: Rematch 4.0

Post by FuxieDK » May 7th, 2019, 2:08 pm

Small cosmetic request:

Can we please have nested tabs for teams?
I'm having so many team-tabs now, they cannot all be displayed at the same time, and rather than scrolling, it would be nice for them to nest:

E.g.
World Trainer tab
- EK
- Kalimdor
- Outland
Beast of Fable:
- Whatever 1
- Whatever 2
Dungeon
- Celestial Tournament
- Wailing Cavern
- Deadmines

I'm sure you get the meaning by now. Strictly a cosmetic change, nothing different in regards to loading etc.

PRETTY PLEASE :)

Gello
Posts: 433
Joined: January 23rd, 2014
Pet Score: 4238
Realm: Hyjal-US
Contact:

Re: Rematch 4.0

Post by Gello » May 7th, 2019, 4:44 pm

What I've been meaning to do, and many of the pieces for it to happen are in place (like the recently-added scrollframe easily supports entries of different heights), is to make sub-categories within tabs.

Just as the list in the options tab has categories beneath headers that expand and collapse with the top-most header expanding or collapsing all, I want the team tab (and future target panel) to use that for categories within the panel. So you can put all Draenor pve teams in one tab with one category for menagerie, another for dailies, another for erris/kura, etc.

The challenge isn't displaying or making such a system work (which is relatively trivial), but in the UI/UX to make it happen. I feel there needs to be a good way to move multiple teams to different categories. Ways to declare categories. Lots of details.

But yeah, I'm really not satisfied with the scrolling tabs business. I'll consider nested tabs too. I'm interested in hearing other ideas too if any have some.

User avatar
Threewolves
Posts: 25
Joined: February 18th, 2018
Pet Score: 5109
Realm: Dentarg-US
Contact:

Re: Rematch 4.0

Post by Threewolves » June 9th, 2019, 12:23 pm

Gello wrote:
May 7th, 2019, 4:44 pm
I'm interested in hearing other ideas too if any have some.
1) Make pre-existing default nested tabs similar to xu-fu pet guides menu by having them already there when installing Rematch addon and an option to auto-sort teams of targets by wow zones and/or expansions. In fact, mirror theirs identically and maybe add dungeons, miscellaneous, PVP, and Power leveling pre-existing tabs also. This would virtually eliminate the need for an end user to create tabs at all.

2) Need an option to import a team and bring TD script along with rematch string.

3) Add TD script use and authoring into rematch so rematch is the only addon needed.

4) Add battle pet breed ID.

5) Work with AraneshXuFu@WoW-Petguide.com to have latest Rematch addon version downloadable from wow-petguide.com home page.

6) Add "strongest" vs. family that sorts all users pets based on the highest possible amount of attack damage.

7) Have pet cards for pets not collected default to where to get it display. Alt to view stats card.

8) Partner with Xu-Fu pet guides to enable their strategy creation tool to be embedded into Rematch. When done building a strategy a user could add it to the wow-petguides strategy page for a pet battle target with one click. Or, a cut and paste if wow won't allow outside comms. As it is now, rematch strings don't carry breed/speed ect. restrictions on strategies does it?

Rematch is the best tool for pet battling.
Last edited by Threewolves on June 12th, 2019, 2:59 am, edited 1 time in total.
Kindness is contagious.

Gello
Posts: 433
Joined: January 23rd, 2014
Pet Score: 4238
Realm: Hyjal-US
Contact:

Re: Rematch 4.0

Post by Gello » June 9th, 2019, 7:37 pm

Having pre-made categories to store teams is an interesting idea. I had planned to do that for targets. It may be interesting to combine the concepts.

On the TD script addon, I'm willing to work with the TD script author to get something working. I'm afraid I don't use it and would be reeeeeally reluctant to need to incoporate code that has to be tested against it. (My experience with Rematch ElvUI Skin is...unpleasant. I don't use ElvUI either unfortunately.) That said, all export and imports go through a handful of functions that could be hooked to attach and strip off scripts. If there's something preventing this from happening I'm certainly open to working with the TD script author to make it happen. (As long as I'm not the one maintaining the code to handle the scripts!)

A built-in breed module will realistically require an in-game breed API from Blizzard. It's a ton of maintenance otherwise.

Rematch strings do carry pet breeds now, but they don't have restrictions (aside from leveling preferences). There is also no outside communication allowed.

I really like the idea of having where a pet is from immediately visible if the pet is not collected.

Thanks for the suggestions!

Sservis
Posts: 5
Joined: October 12th, 2011
Pet Score: 8625
Realm: Mal'Ganis-US
Contact:

Re: Rematch 4.0

Post by Sservis » June 11th, 2019, 11:24 am

Gello wrote:
May 1st, 2019, 6:14 pm
I'm afraid Rematch makes an extra effort to prevent reloading the same team for auto load. You may know this, but you can also click the title of the team (has the gold/brown background above the three slotted pets) to quickly reload a team.
I can come up with a number of good reasons why auto loads shouldn't happen too much (ie once per target, user tweaks being most notable). Thinking this through, I do have a desire for a hands off reload to allow quick rematches while leveling.

Could the following logic be implemented (convoluted to reduce false positives that affect users who don't want teams changed)

- Only applies for teams that have dynamic pet loading of some sort (healthiest version, etc). Other teams are considered defined as static (could also add a flag for auto reloading if simpler to identify which teams).

- Only applies if the current team pet and ability wise matches the team that would be loaded. This detects user tweaks after initial team loads, so don't overwrite. They might be doing a risky Family achievement and need to retry or testing a stat tweak, etc. Reloading in those cases would annoy them.

- Only applies after a pet battle, and only once. No reason to reload the team without a pet battle happening to "use" and potentially damage the team. If they really want a reload, they can manually specify it.


To summarize, basically if a team has a dynamic option when it loads, and the current team matches the team that would be loaded (when ignoring randomization as part of the dynamic option), then redo the dynamic selection after a pet battle. This could potentially be done in the same step as when leveling pets are adjusted (if the event trigger is general enough).

Gello
Posts: 433
Joined: January 23rd, 2014
Pet Score: 4238
Realm: Hyjal-US
Contact:

Re: Rematch 4.0

Post by Gello » June 11th, 2019, 9:17 pm

Thanks for the suggestion. It's an interesting idea. However, since that post was made, there's a new sub-option to 'Load Healthiest Pets' called 'After Pet Battles Too'. This will effectively reload a team after a battle ends. Specifically it looks for healthier version of injured pets and swaps them out, without doing a full reload.

Are there other use cases where reloading a team automatically may be useful? I think identifying those cases may make it easier to identify specific logic.

The queue handles leveling slots relatively independent of the loaded team. The queue behavior won't change by forced reloads.

For random slots, this may be applying my own usage here, but I tend to manually reload a team until I get an interesting random pet and then go with that pet. I would not want a random pet I've settled on to swap out. But is a more chaotic random slot something you guys want as an option?

Sservis
Posts: 5
Joined: October 12th, 2011
Pet Score: 8625
Realm: Mal'Ganis-US
Contact:

Re: Rematch 4.0

Post by Sservis » June 17th, 2019, 10:17 am

Gello wrote:
June 11th, 2019, 9:17 pm
Thanks for the suggestion. It's an interesting idea. However, since that post was made, there's a new sub-option to 'Load Healthiest Pets' called 'After Pet Battles Too'. This will effectively reload a team after a battle ends. Specifically it looks for healthier version of injured pets and swaps them out, without doing a full reload.

Are there other use cases where reloading a team automatically may be useful? I think identifying those cases may make it easier to identify specific logic.
It will generally handle my use cases, namely leveling pets quickly without resorting to bandages or chasing down a stable master. It also mostly handles when I run around and engage a new battle without checking the health status of the team. In nearly no cases does loading the healthiest version of the same specific pet seem likely it could do the wrong thing. However, it is not as general as might be useful sometimes in two different ways. I currently have no specific/known need for these.

It could be more useful is due to the actual pet not being important at all. What matters is family/moveset/stats. So the P/B Squirrel could be replaced with a S/B Alpine Chipmunk/Grizzly Squirrel/Red-Tailed Chipmunk, etc. They have identical family/moveset/stats. Maybe it already does that and I didn't understand what you meant implicitly by "same" pet.

Similar, and somewhat more general, sometimes stats are not that important or even the full moveset doesn't matter, maybe only having one or two of the abilities is enough if the team is defined as 1 1 *, for instance. This is definitely harder to put in place as it involves the user defining per team rules for what substitutions are acceptable.

As an example of different stats that might be acceptable without special rules, consider a HB Squirrel (H1546/P257/S289) If it's health was damaged to at or below 1465, then versions of the various squirrels with base H1465/P273/S289 should be considered. At or below 1400, the base H1400/P289/S289 versions also are potentially usable, etc. This could be automated without having to add the complexity of a custom UI to configure acceptable power/speed ranges (use most health pet within ranges),

The implementation would use the highest current health version of the same family/moveset with identical speed and at as much power as the best specifically defined pet Specific speed is important, so without additional options, safest to preserve exact speed. However, more power is never bad right? For the same reasons as more health, so if it's ok to sub more health (live longer), it's also ok to sub more power (kill faster) as they're opposite sides of the same coin.

User avatar
Vongalin
MVP
Posts: 17
Joined: September 28th, 2012
Pet Score: 8078
Realm: Kilrogg-US
Contact:

Re: Rematch 4.0

Post by Vongalin » February 3rd, 2020, 9:58 am

Good morning,
Is it possible to add tooltips to the icons under Type/Strong vs./Tough vs. that show the type name, e.g. Critter, etc. ? I have a hard time remembering them using just the icon.

Thank you !

Gello
Posts: 433
Joined: January 23rd, 2014
Pet Score: 4238
Realm: Hyjal-US
Contact:

Re: Rematch 4.0

Post by Gello » February 4th, 2020, 6:41 pm

I can consider it as an option, but I'd be very hesitant to do that default behavior. We'll see.

User avatar
Vongalin
MVP
Posts: 17
Joined: September 28th, 2012
Pet Score: 8078
Realm: Kilrogg-US
Contact:

Re: Rematch 4.0

Post by Vongalin » February 6th, 2020, 11:01 am

Good morning !
A few years ago you helped me with this script below. If you have time, is it possible to look at this and update it for the current release ? The Export List menu gets added, but doesn't populate any data. This was the best way I found to get formatted data out of the game and into Excel, etc.
Gello wrote:
July 18th, 2016, 11:07 am

Code: Select all

-- adds "Export List" to Rematch's pet list Filter menu, to copy a csv-formatted list of owned pets and their stats to an editbox.
local f = CreateFrame("Frame")
f:RegisterEvent("PLAYER_LOGIN")
f:SetScript("OnEvent",function()
  if Rematch then -- if rematch exists
    C_Timer.After(1,function() -- wait a second to let rematch create its menus
      local abList,lvList = {},{}
      local info,line = {},{}
      -- adds one line from info to the dialog's editbox every frame
      local function addInfo()
        if #info>0 and Rematch:IsDialogOpen("ExportPetList") then
          Rematch.Dialog.MultiLine.EditBox:Insert(info[1].."\n")
          tremove(info,1)
          C_Timer.After(0,addInfo)
        end
      end
      -- adds the given stats to the line table
      local function addStats(...)
        for i=1,select("#",...) do
          local stat = tostring(select(i,...) or "none"):gsub(",","") -- remove any commas
          tinsert(line,stat)
        end
      end
      -- add a menu item Export List to the PetFilter menu
      local menu = Rematch:GetMenu("PetFilter")
      tinsert(menu,#menu-2,{
        text="Export List",
        tooltipBody="Copies the stats of the listed owned pets into an editbox in a csv format.",
        func=function()
          -- create a dialog
          local dialog = Rematch:ShowDialog("ExportPetList",500,500,"Filtered Pets",nil,nil,nil,OKAY)
          dialog:ShowText("Format:\nname,species,type,level,health,power,speed,rarity,breed,abilities",460,32,"TOP",0,-32)
          -- create multiline editbox
          dialog.MultiLine:SetSize(460,380)
          dialog.MultiLine:SetPoint("BOTTOM",-1,40)
          dialog.MultiLine:Show()
          -- gather info into table 'info'
          wipe(info)
          for _,petID in ipairs(Rematch.Roster.petList) do
            wipe(line)
            if type(petID)=="string" then
              local speciesID,customName,level,_,_,_,_,name,_,petType = C_PetJournal.GetPetInfoByPetID(petID)
              addStats(customName and format("%s (%s)",name,customName) or name)
              addStats(speciesID,PET_TYPE_SUFFIX[petType],level)
              local _,maxHealth,power,speed,rarity = C_PetJournal.GetPetStats(petID)
              addStats(maxHealth,power,speed,_G["BATTLE_PET_BREED_QUALITY"..rarity])
              addStats(Rematch:GetBreedByPetID(petID))
              C_PetJournal.GetPetAbilityList(speciesID,abList,lvList)
              for i=1,6 do
                addStats(abList[i] and select(2,C_PetBattles.GetAbilityInfoByID(abList[i])) or "none")
              end
              tinsert(info,table.concat(line,","))
            end
          end
          -- begin adding the gathered info to the editbox
          addInfo()
        end
      })
    end)
  end
end)

Gello
Posts: 433
Joined: January 23rd, 2014
Pet Score: 4238
Realm: Hyjal-US
Contact:

Re: Rematch 4.0

Post by Gello » March 11th, 2020, 8:22 pm

Oops sorry to miss this. This may be what you're after:

Code: Select all

-- adds "Export List" to Rematch's pet list Filter menu, to copy a csv-formatted list of owned pets and their stats to an editbox.
local f = CreateFrame("Frame")
f:RegisterEvent("PLAYER_LOGIN")
f:SetScript("OnEvent",function()
  if Rematch then -- if rematch exists
    C_Timer.After(1,function() -- wait a second to let rematch create its menus
      local abList,lvList = {},{}
      local info,line = {},{}
      -- adds one line from info to the dialog's editbox every frame
      local function addInfo()
        if #info>0 and Rematch:IsDialogOpen("ExportPetList") then
          Rematch.Dialog.MultiLine.EditBox:Insert(info[1].."\n")
          tremove(info,1)
          C_Timer.After(0,addInfo)
        end
      end
      -- adds the given stats to the line table
      local function addStats(...)
        for i=1,select("#",...) do
          local stat = tostring(select(i,...) or "none"):gsub(",","") -- remove any commas
          tinsert(line,stat)
        end
      end
      -- add a menu item Export List to the PetFilter menu
      local menu = Rematch:GetMenu("PetFilter")
      tinsert(menu,#menu-2,{
        text="Export List",
        tooltipBody="Copies the stats of the listed owned pets into an editbox in a csv format.",
        func=function()
          -- create a dialog
          local dialog = Rematch:ShowDialog("ExportPetList",500,500,"Filtered Pets",nil,nil,nil,OKAY)
          dialog:ShowText("Format:\nname,species,type,level,health,power,speed,rarity,breed,abilities",460,32,"TOP",0,-32)
          -- create multiline editbox
          dialog.MultiLine:SetSize(460,380)
          dialog.MultiLine:SetPoint("BOTTOM",-1,40)
          dialog.MultiLine:Show()
          -- gather info into table 'info'
          wipe(info)
          for _,petID in ipairs(Rematch.Roster.petList) do
            wipe(line)
            if type(petID)=="string" then
              local petInfo = Rematch.petInfo:Fetch(petID)
              addStats(petInfo.customName and format("%s (%s)",petInfo.name,petInfo.customName) or petInfo.speciesName)
              addStats(petInfo.speciesID,PET_TYPE_SUFFIX[petInfo.petType],petInfo.level)
              addStats(petInfo.maxHealth,petInfo.power,petInfo.speed,_G["BATTLE_PET_BREED_QUALITY"..petInfo.rarity])
              addStats(petInfo.breedName)
              C_PetJournal.GetPetAbilityList(petInfo.speciesID,abList,lvList)
              for i=1,6 do
                addStats(abList[i] and select(2,C_PetBattles.GetAbilityInfoByID(abList[i])) or "none")
              end
              tinsert(info,table.concat(line,","))
            end
          end
          -- begin adding the gathered info to the editbox
          addInfo()
        end
      })
    end)
  end
end)

User avatar
Mot
Posts: 8
Joined: February 19th, 2018
Pet Score: 9294
Realm: Azjol-Nerub-EU
Contact:

Re: Rematch 4.0

Post by Mot » June 6th, 2020, 6:58 am

Thanks for your continued work on this indispensable add-on!

A minor issue/question:

The Script help (Pet Variables) says:
name (string)
True name of the pet species.
However, when using `name` I find that that it returns the custom name (given by me), not the “true” name.

So, in other words:
  • `customName` matches only against the custom name (fails when there is no custom name)
  • `name` matches against the custom name, or the true name — but the latter only if the pet doesn’t have a custom name, or if the custom name is the same as the true name.
Shouldn’t `name` always return the true name, independently of the presence of any custom name?

Gello
Posts: 433
Joined: January 23rd, 2014
Pet Score: 4238
Realm: Hyjal-US
Contact:

Re: Rematch 4.0

Post by Gello » June 6th, 2020, 8:34 am

Yep you're right. The pet variables help says name is the true name (species name), but the script filter is actually using the custom name if one is defined. My first instinct is to fix this, but since it's been this way for years and some scripts perhaps depend on this behavior, and more importantly the more robust and more recent petInfo variable can get the species name, I'll probably fix the help text rather than change the behavior for "name".

To get a species name, use petInfo.speciesName like:

Code: Select all

return petInfo.speciesName:match("Tabby")
There's a lot more you can get from petInfo too. Each of the following (with a petInfo. before it) can grab this info about a pet:

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)
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)
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
notes: the text of the pet's notes
isLeveling: whether the pet is in the queue
isSummoned: whether the pet is currently summoned (companion pet)

As new information is exposed about pets they get added to petInfo and the comments at the top of PetInfo.lua. Rematch uses this sytem extensively to efficiently gather information about pets through the disparate API so some stuff may not really apply to filters, like battleOwner, battleIndex, etc.

For instance if you want to make a filter for tier pets, you can add a note #tier1, #tier2, #tier3, to those pets and then

Code: Select all

return petInfo.hasNotes and petInfo.notes:match("#tier")
edit: If you'd like to experiment with petInfo outside of the scripting environment, there's a general purpose one globally defined called Rematch.petInfo, use Rematch.petInfo:Fetch(speciesID or petID) to start getting information about the pet:

Code: Select all

/run Rematch.petInfo:Fetch(42) -- fetched information about speciesID 42 (Black Tabby Cat)
/dump Rematch.petInfo.moveset
/dump Rematch.petInfo.numPossibleBreeds
Some information only applies to a specific pet (level, rarity, inTeams, etc), like:

Code: Select all

/run Rematch.petInfo:Fetch("BattlePet-0-0000029FB3C2") -- use a petID to fetch a specific pet
/dump Rematch.petInfo.level
/dump Rematch.petInfo.numTeams
And if curious, information is only pulled from the game API when requested, and results are cached when the API is eventually hit for that pet; and information that depends on querying all pets/teams (like numTeams) use temporary tables so a few hundred queries against the same data should be fast.

User avatar
Mot
Posts: 8
Joined: February 19th, 2018
Pet Score: 9294
Realm: Azjol-Nerub-EU
Contact:

Re: Rematch 4.0

Post by Mot » June 6th, 2020, 7:40 pm

Ah, OK. Was just wondering if I’m maybe misunderstanding `name` and `customName`.

`petInfo.speciesName` seems to work fine (as does `speciesID`).

Many thanks for the comprehensive arguments/properties list and the additional infos. Also thanks for the tip to use the notes for a tagging system. Currently I’m abusing the pet names for sort of tagging (which was also the reason that I stumbled upon the name vs customName thingy).

– Tom

Post Reply