Rematch 4.0

Discuss your favorite pet addons and macros.
Gello
Posts:576
Joined:January 23rd, 2014
Pet Score:9171
Realm:Hyjal-us
Contact:
Re: Rematch 4.0

Post by Gello » July 18th, 2016, 11:07 am

It's a good idea. Unfortunately WoW's editboxes are not designed for massive amounts of text. Adding several tens of thousands of characters or more will lock up the client for a time depending on the PC. The "backup all teams" bit gets around this by adding a little bit of text at a time. But even then if you backup all teams and then go to share a team the client will lockup for a time while it cleans up the mess created in the backup. I worry about this for people with lots of notes and lots of teams. Importing all backed up teams can cause a lockup too. But so far no reports about lockups so maybe my WoW computer is just showing its age.

When I say "lockup" the game does return control to the client eventually. It can be as little as a couple skipped frames or as long as 15 minutes. But to the end user it will appear that something very very bad happened. It's something I want to try to avoid doing at all costs.

That said, with the understanding that you're okay with these lockups, or that you don't intend to export 700 pets at a time, paste the following code into http://addon.bool.no/ to make an addon to do this.

Once installed, the next time you start WoW, if Rematch is enabled it will add "Export List" to the pet Filter menu. When you choose this menu item it will summon a dialog with a big text box and fill in csv-formatted (comma-separated) stats about the pets you own from the filtered list.

As it says at the top of the dialog the format is name,species,type,level,health,power,speed,rarity,breed,abilities. The abilities are listed in the order that GetPetAbilityList returns them (in ascending ability level requirement: 1 2 4 10 15 20), which is not quite the order you wanted, but it should be easy enough to move columns. If it's a big hassle let me know I can tweak the code to do them in a different order.

I chose commas because it's a very common format just about any spreadsheet can import, and the pipeline character (|) can do some crazy things when adjacent to characters in WoW's text/editboxes (the | character is used in wow to color text and make hyperlinks). Names and abilities with commas in the name have the commas stripped out.

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)

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

Re: Rematch 4.0

Post by Vongalin » July 18th, 2016, 12:36 pm

Gello, you are truly Mr. Robot :D Beep boop beep.

This...worked...PERFECTLY. My filtered list exported in about 6-8 seconds. Seriously, this is INVALUABLE. I also love your coding. It is very easy to understand. I am trying to learn more about WoW coding and your examples really help out alot.

Thank you once again for making ALL of your addons and taking time to help us all out.

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

Re: Rematch 4.0

Post by Paladance » July 20th, 2016, 1:58 am

I'm a complete noob to this addon that feels overwhelmed by it.

Are its components dealt separately or do I need to keep them all everywhere?
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:576
Joined:January 23rd, 2014
Pet Score:9171
Realm:Hyjal-us
Contact:

Re: Rematch 4.0

Post by Gello » July 20th, 2016, 3:07 am

Paladance wrote:I'm a complete noob to this addon that feels overwhelmed by it.

Are its components dealt separately or do I need to keep them all everywhere?
I'm not sure I understand the question. Is it whether parts of the addon can be disabled? If so the answer is not really. It's all self contained in one addon. A lot of the things it can do are "opt in" meaning they should be out of the way unless you choose to start using them. Like leveling preferences, win records, auto loading, etc. In its "out of the box" state it can function as simply a pet journal replacement to save and load teams and nothing more. As you get using it you can poke around and experiment to check out the other things it can do.

I've considered breaking out parts of the addon to separate modules that can be selectively disabled. Like someone who has all their pets leveled may not need the queue anymore. But it's still not certain that this would have a great benefit, given how little it would save considering the additional overhead required. But it's an interesting technical problem and I like interesting technical problems.

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

Re: Rematch 4.0

Post by Vongalin » July 25th, 2016, 9:06 am

Good morning Gello,
I ran into a problem with 4.4.10 that I was able to solve by rolling back to 4.4.9. Here is what is/was happening to me w/the latest build.

I have a team for Ashlei that has 2 leveling spots saved to the team (2nd and 3rd position). Before heading out, I cleared my leveling queue and added 2 fresh level 1's. When I clicked on Ashlei, it loaded her team; however, it had the 2 previous levelers listed. If I right-click on the spot, the Add Leveling... option was greyed out and the leveling icon is missing. I dragged the new level 1 from the queue to the spot and saved the team.

Next, I unselected Ashlei, loaded another team and then clicked on Ashlei again. Her team reloaded, but again, with the previous levelers still listed, even though I had re-saved with the new ones. Very odd.

I exited the game. Deleted the 'Rematch' folder. Re-downloaded the 4.4.9 release and re-launched the game. The leveling icons are back. I clicked on Ashlei and she loaded the team w/the correct levelers listed. I also tested this w/Vesharr (single leveling spot). Same problems with 4.4.10 and fixed when I rolled back to 4.4.9.

I didn't see any reports on WowInterface or Curse. Maybe it's just me for some reason ? For now, I'll run 4.4.9 to get my dailies done.

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

Re: Rematch 4.0

Post by Gello » July 25th, 2016, 10:38 am

Vongalin wrote:Good morning Gello,
I ran into a problem with 4.4.10 that I was able to solve by rolling back to 4.4.9. Here is what is/was happening to me w/the latest build.
Thanks for the detailed steps you went through.

Ironically, someone was reporting behavior similar to yours in 4.4.9 and part of 4.4.10 was an attempt to fix that. I wasn't confident the fix would work (which is why it says "Potential fix" in the changelog) and as it turned out it didn't work for him. I'll roll back that change.

I've also noticed that Fill Queue is not reliably kick-starting the queue with the new pets, so old pets will remain slotted. I'll definitely get this fixed. But I don't think this is your problem because "Put Leveling Pet Here" from a slot's right-click menu shouldn't be greyed.

If the next update (probably tonight) seems to make the behavior come back, can you check if you have errors enabled? You can find out by pasting this to chat:

Code: Select all

/run print("Errors are",GetCVarBool("scriptErrors") and "Enabled" or "Disabled")
I'm curious if an error happens and you don't see it. Once an error happens in an addon it stops the current execution path. It would explain why it believed there was nothing in the queue when trying to add from the right-click menu.

If the above says Errors are Disabled, could you paste this into chat and then try those steps again and copy/paste any errors if you see them?

Code: Select all

/console scriptErrors 1
That will turn errors on. Changing 1 to 0 will turn them back off.

I'd like to make the queue/leveling slots more resilient also so I will definitely invest some time in going over the queue.

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

Re: Rematch 4.0

Post by Vongalin » July 25th, 2016, 2:06 pm

Thank you for the quick response.

My errors were disabled, so I enabled them via your script. An error popped up immediately from another addon 'idTip', so I disabled that addon completely and did a /reload. I clicked through a few items, bags, AH, etc. to make sure nothing else was producing an error - all clear.

Starting off, my leveling queue is empty. I don't use any of the auto-fill options as I tend to select which ones I want to work on. I set my Filter to Collected / Without any 25s and set the sort to Reverse. I chose 2 level 1's and added them to the queue via right-click, Start Leveling. I also added another one by right-click, Add to Leveling Queue. All 3 pets were added to the queue. At this point, there are no leveling icons (the blue arrow) displayed on any of the pets. Also, if I right-click a pet from the leveling queue, the option to Stop Leveling is not there. I am only able to remove a pet by selecting Queue / Empty Queue (which removes all).

Since the dailies have been reset, I flew out to Ashlei. While flying, I went to Teams and loaded another team, e.g. Gargra. After landing, I clicked on Ashlei and her team loaded; however, the leveling slots didn't contain the new ones for leveling, but ones from my earlier session. When viewing the team from the Team tab, it shows my MPD and 2 leveling slots (blue up arrows). If I rearrange the leveling queue, the pets do not update (whereas they used to).

Next, I emptied my queue again and set my filter to Collected / Without any 25s. This time I went to Queue / Fill Queue and it populated the queue correctly with all my non-25s. I clicked on a team that doesn't contain a leveler and it loaded correctly. Finally, I clicked on a team that has leveling slots saved and it ignored the leveling slot and left the pet from the
last loaded team in the slot.

Also, no errors have popped up during this entire process.

I didn't run Ashlei, Vesharr, etc. yesterday, only the Garrison. That team doesn't use levelers, so it seems my issues are related to just teams w/leveling slots. I do have backups from the WTF folder, and full Team Exports, so I could nuke my setup and import fresh if needed. I can also wait until the next release and see how that works out. With all the Pet Charm nerfs, not like I'm in a rush to get any.

Let me know if you need any more information or testing.

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

Re: Rematch 4.0

Post by Gello » July 25th, 2016, 2:53 pm

I totally forgot you can add pets to the queue from right-clicking them. I've dragged hundreds upon hundreds of pets over but maybe less than a dozen by right-clicking. This is a real hazard to having too many ways to do stuff. People can be doing something I had no idea was possible and it can certainly break without me knowing. I can't do any testing right now but I'll be sure to look at it tonight when I get home and that bit will certainly get some scrutiny.

And this should not be necessary, but in the meantime if you click the "loaded team" panel (circled in red below) it will reload the team. It may help get the leveling pets properly loaded maybe.

Image

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

Re: Rematch 4.0

Post by Vongalin » July 25th, 2016, 5:46 pm

Too funny. Wife said the same thing - right click ? Phfft. I drag and drop.

Using 4.4.9 I selected Gargra and then clicked on Ashlei. The team loaded, but not with the leveling pets. I clicked the name (never knew that was clickable) and it instantly refreshed and loaded everything properly, including the missing icons and missing right-click option 'Stop Leveling'.

I exited the game, removed 4.4.9 and copied in 4.4.10 from Curse. Started the same as above, but everything was correctly displayed from the start. Not sure if maybe my WTF got updated after clicking the 'Ashlei' name and 4.4.10 read it in correctly or not, but it would appear that the click-the-name fixed all the anomalies that I was seeing.

I am going to fly around doing dailies now and see if the teams switch correctly.

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

Re: Rematch 4.0

Post by Gello » July 26th, 2016, 2:20 am

4.4.11 just posted reverts the change 4.4.10 made and adds another: the leveling queue is removed from the "sanctuary" system. This is a system that notes the stats of pets and tracks their changes in the event the server ever reassigns petIDs so it can find them again.

The only explanation I've come up with for the problems people are having is their petIDs were reassigned from the server.

I didn't even fix the fill queue like I said I was going to. It only really applies to multi-leveling slot teams with preferences (like ashlei) and I spent too many hours on this tonight. It was best to walk away before I start ripping out more stuff. :P

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

Re: Rematch 4.0

Post by Vongalin » July 28th, 2016, 6:11 pm

Good afternoon,
I was experimenting with the Backup All Teams and Import Teams and noticed that the Import Teams doesn't recreate the tabs and re-assign the Teams to those tabs. I did a full backup, exited the game, deleted my WTF (have a backup), loaded the game and did a full Import. Only option I had was 'General'. Continuing the Import placed all the teams on the General tab.

Is there an option to save the tab w/the team and then re-import (and re-create if missing) to that tab ? or I am missing an option - pretty sure I went through the options.

User avatar
Salus
Posts:67
Joined:May 6th, 2014
Pet Score:8751
Realm:Hyjal-us
Contact:

Re: Rematch 4.0

Post by Salus » July 28th, 2016, 8:35 pm

Vongalin wrote:Is there an option to save the tab w/the team and then re-import (and re-create if missing) to that tab ? or I am missing an option - pretty sure I went through the options.
Why not just save the WTF\Account\YOUR_ACCOUNT\SavedVariables\Rematch.lua as it sounds like you want to backup everything?

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

Re: Rematch 4.0

Post by Vongalin » July 28th, 2016, 8:51 pm

I do that already. I have plenty of backups. I was just experimenting with the backup/restore from nothing scenarios using only the in-addon options and noticed that tabs weren't restored.

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

Re: Rematch 4.0

Post by Gello » July 28th, 2016, 9:51 pm

There is no option, sorry. It says at the bottom of the backup dialog:
Note: These are just your teams and their notes and preferences. Tab information, sort orders, win records, specific breeds and other settings are not included.

For the most complete backup of all your addon data, please backup your World of Warcraft\WTF folder.
This backup option is a low-tech option that's not meant to be robust.

That said, when it exports the teams it does break them out a bit like:

Code: Select all

__ General __

Team Name:123:42:535:357:536:848:849:312:163:0:0:0:0:
Team Name:123:42:535:357:536:848:849:312:163:0:0:0:0:
Team Name:123:42:535:357:536:848:849:312:163:0:0:0:0:

__ PVP __

Team Name:123:42:535:357:536:848:849:312:163:0:0:0:0:
Team Name:123:42:535:357:536:848:849:312:163:0:0:0:0:
Team Name:123:42:535:357:536:848:849:312:163:0:0:0:0:
Team Name:123:42:535:357:536:848:849:312:163:0:0:0:0:
Team Name:123:42:535:357:536:848:849:312:163:0:0:0:0:

__ Dailies __

Team Name:123:42:535:357:536:848:849:312:163:0:0:0:0:
Team Name:123:42:535:357:536:848:849:312:163:0:0:0:0:
Team Name:123:42:535:357:536:848:849:312:163:0:0:0:0:
So someone restoring their teams can create the tabs and import them by copy-pasting each tab individually.

I had considered making import look for that __ Tab Name __ text to recreate the tabs automatically with its icon immediately after. But there are a few problems with that. One problem that immediately comes to mind is what does it do if there's not enough free tab slots to recreate them all? Dump the remaining into the first general tab? Offer a dialog to delete all existing teams/tabs? The low-tech solution becomes the source of new problems I'd prefer to leave off until after breeds are supported in import/export.

Also the parsing of these strings is something I want to tinker with as little as possible. It's critical that these remain backwards compatible. You can still import teams exported from version 2.0.3 of this addon back when export/import was added. And if 2.0.3 still works it would recognize any teams exported from 4.4.11 even if notes and preferences are included which wasn't a thing back then. I regret adding the "Export As Plain Text" option because that parsing is rather complicated and it now has to be supported for the rest of the life of the addon.

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

Re: Rematch 4.0

Post by Vongalin » July 29th, 2016, 7:17 am

Thank you for the detailed response and your continued work on your addons. I don't think the majority of us would ever want to battle or collect w/o your addons.

The backup and import does work great as-is, thank you for keeping it in there. If I need to do a restore, I always use the full WTF. I was just exploring some of the other options. For me, for an additional backup, I made a simple VBScript that splits the Team Backup into individual files based on their team name. This script kicks in after my SyncBack is done.

I am still working through some leveling queue issues and have been documenting my process and results. I am definitely with you thinking something is happening on the back-end. Results vary between battles, it is very odd. Obviously none of these problems were happening before the pre-patch. I have been able to add and remove from the queue by drag-drop or right-click options. My main issue now is the correct leveling pet not loading. Even when you click the name of the team, etc. I have found that when I load a team and it displays the previous leveled pet (even though removed from the queue), most times a /reload will correct the issue and the correct new leveling will be displayed.

I was also seeing an oddity when saving teams. For example, I have a Vesharr team with a leveling slot in the first position and then 2 normal pets. The team display shows the blue leveling icon, but doesn't load the correct pet (issue above). If I right-click the position and choose 'Add Leveling...' or drag-drop a leveling pet over, it will show the correct pet, but when I save the Team, the overwrite dialog box displays a non-leveling slot in that position (where-as before the pre-patch it would display correctly).

The pre-patch has borked so much, it's no surprise it is affecting many addons. I think it's best that I just manually make sure my teams are set and push through the dailies. Pretty sure it will save your sanity as well. Hopefully Blizz will get all the in-game oddities corrected soon(tm)...

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

Re: Rematch 4.0

Post by Gello » July 29th, 2016, 2:56 pm

I've done some more testing and I really can't reproduce what you're seeing. Can you describe for me HOW you use the addon? Are you reporting an edge case of problems when loading 80 teams within 3 seconds? Are you always emptying the queue? Something must be different between how you're using it and I am.

And are any others here having problems with the queue? Does it seem to be working okay?

This weekend is dedicated to recreating an addon that's died in Legion, but after that I'll be coming back to this addon and probably rewriting the entire complicated queue system. :(

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

Re: Rematch 4.0

Post by Vongalin » July 29th, 2016, 3:52 pm

Sure. I currently have 9 tabs and 61 teams. I keep my level queue near empty. Before I set out for a round of dailies, I use my Level ==> Without 25s, Collected, Sort by Level (Reverse) filter and choose 3 - 5 that I want to level this round, a few more on Battleground Weekends. I either drag them to the queue or right-click and choose Start Leveling. Once they are set and in the right order, I head out.

First - Ashlei. Team is MPD and 2 Leveling Pets (team icon shows MPD and 2 blue up arrows). Before the pre-patch, I would click on Ashlei and the team would load the MPD and the 2 correct leveling slotted pets. Now, the team loads; however, the previous leveling pets get added, even though they had been removed from the queue (and the game has been exited).
To correct this, I now have to do the following - 1) /reload, 2) click the Ashlei bar (that you showed me) to reload the team. Doing this properly loads the correct leveling pets.

After the battle is finished, I right-click on each of the pets that were leveled and choose Stop Leveling. Next I fly to Vesharr. When I click on Vesharr, his team loads; however, one of the previous leveling pets are loaded to his single leveling slot. His team is Leveling Slot / Chrominius / MPD. Doing a /reload and title bar click does not correct this
team. Now, I have to go to the Queue tab and drag-drop the leveling pet that I want over to the team. If I do a /reload before battling and check the team, it is still correct. If I load another team and then re-load Vesharr, the correct leveling stays put.

I now have to repeat this for each of the Draenor dailies. Again, this wasn't happening before the pre-patch on any of the Rematch versions. At this point, I may exit the game, delete my WTF, relaunch and rebuild the few teams that I am still using and see what happens on the dailies tomorrow.

If you need any of my files, let me know and I'll send them over.

User avatar
Jerebear
Posts:1232
Joined:September 15th, 2013
Pet Score:13370
Realm:Llane-us
Contact:

Re: Rematch 4.0

Post by Jerebear » July 29th, 2016, 7:32 pm

Biscuit wrote:Just bought a gaming laptop and was curious how to export the hundreds of teams I've saved on Rematch and send them over to the new PC?
Go to your saved variables file on the old computer, copy rematch.lua, and paste it into the same location on the new computer. You must be out of game when you do this.
Carry Pet Experience Reference Guide:
http://www.warcraftpets.com/community/forum/viewtopic.php?f=10&t=8829

User avatar
Pendabear
Top Rater
Posts:6
Joined:October 17th, 2008
Pet Score:5633
Realm:Silver Hand-us
Contact:

Re: Rematch 4.0

Post by Pendabear » August 1st, 2016, 10:22 am

I have been digging around but does anyone have a quick set up for people like me new to Rematch to just import all the tamer teams? Or do I need to set it up manually? I have been using Pet Battle Teams but want to try new things with Legion, don't mind setting them up again but not sure if there is a shortcut!

EDIT: After googling harder, I am finding a few blogs that have some teams but guess I am looking for a fresh list since 7.0.3 changes too, if anyone has something like that.
Last edited by Pendabear on August 1st, 2016, 12:43 pm, edited 1 time in total.

Post Reply