Page 1 of 1
Rematch add-on question
Posted: July 21st, 2017, 2:45 am
by Wootzy
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.
Re: Rematch add-on question
Posted: July 21st, 2017, 5:09 pm
by Gello
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.
Re: Rematch add-on question
Posted: July 21st, 2017, 7:57 pm
by Wootzy
Works like a charm
Gello, you are the best! I really mean that. Thanks a lot!