Rematch add-on question

Discuss your favorite pet addons and macros.
Post Reply
User avatar
Wootzy
Top Rater
Posts:141
Joined:May 18th, 2016
Pet Score:5165
Realm:Silvermoon-eu
Contact:
Rematch add-on question

Post by Wootzy » July 21st, 2017, 2:45 am

We got this tournament coming with wild pets from E.Kingdoms and Kalimdor. Would be nice to show all of them at once. Now I have to go through them manualy, and that is such a PITA. How do you all do this in-game? In Rematch you can set a custom made filter; anyone knows how to write a script for a filter like this? Gello? Thanks.

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

Re: Rematch add-on question

Post by Gello » July 21st, 2017, 5:09 pm

A custom script filter can do it. There are a couple approaches.

One way of doing it is to make a table of all zones you're interested in like this:

Code: Select all

if not TournamentZones then
  TournamentZones = {
    "Elwynn Forest", "Westfall", "Stranglethorn", "Dun Morogh",
    "Loch Modan", "Alterac Valley", "Arathi Highlights",
    "etc",
  }
end

if isWild then
  for _,zone in ipairs(TournamentZones) do
    if sourceText:match(zone) then
      return true
    end
  end
end
That filter will find all pets in those zones that are wild.

It's not totally optimized but should work for what you're after. If you find it taking a long time to filter the list (the game will seem to freeze for a second while the script runs), a more optimum solution is something like this:

Code: Select all

if not EKPets then
  -- add the speciesID of all pets you want to display
  local t={374,459,646,447,378,419,412,379,675}
  EKPets = {}
  for _,speciesID in ipairs(t) do
    EKPets[speciesID] = true
  end
end
return EKPets[speciesID] and isWild
But imho to save your sanity the first one is probably adequate.

User avatar
Wootzy
Top Rater
Posts:141
Joined:May 18th, 2016
Pet Score:5165
Realm:Silvermoon-eu
Contact:

Re: Rematch add-on question

Post by Wootzy » July 21st, 2017, 7:57 pm

Works like a charm :)

Gello, you are the best! I really mean that. Thanks a lot!

Post Reply