WoW:Parsing event messages: Difference between revisions

m
No edit summary
Line 62: Line 62:
Harnessing this information yourself can be quite a task.  You need to revise your code to look at this variable, transform the value of this variable into a value suitable for your pattern variable, run your pattern, and then be able to reorder the parameters correctly based on the value of this variable.
Harnessing this information yourself can be quite a task.  You need to revise your code to look at this variable, transform the value of this variable into a value suitable for your pattern variable, run your pattern, and then be able to reorder the parameters correctly based on the value of this variable.


However, each AddOn author should not have to do nearly this much work.  There's a library called MarsMessageParser.  I don't have a link to that file directly, but you will find it as a separate file inside of [[http://www.curse-gaming.com/mod.php?addid=2275 this AddOn]].  You can copy MarsMessageParser.lua out of there and put it in your AddOn, say MyHonorTracker.  Make sure MarsMessageParser.lua is listed before MyHonorTracker.lua in your MyHonorTracker.toc file or your MyHonorTracker.xml file.  Then, all of the above code can be trimmed down to just this:
However, each AddOn author should not have to do nearly this much work.  There's a library called MarsMessageParser.  I don't have a link to that file directly, but you will find it as a separate file inside of [[http://ui.worldofwar.net/ui.php?id=291 this AddOn]].  You can copy MarsMessageParser.lua out of MarsNeedyGreedy and put it in your AddOn, say MyHonorTracker.  Make sure MarsMessageParser.lua is listed before MyHonorTracker.lua in your MyHonorTracker.toc file or your MyHonorTracker.xml file.  Then, all of the above code can be trimmed down to just this:


  function MyHonorTracker_OnEvent()
  function MyHonorTracker_OnEvent()
Anonymous user