View Single Post
11-27-12, 01:36 AM   #8
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
What about this ?

It is not so beautifull but when you login you move and walk a little bit it should trigger :-)


Lua Code:
  1. local frame_cleu = CreateFrame("FRAME", "remgankframe_cleu");
  2.  
  3. -- Don't register CLEU here!
  4. frame_cleu:RegisterEvent("ZONE_CHANGED_NEW_AREA")
  5. frame_cleu:RegisterEvent("ZONE_CHANGED")
  6.  
  7. frame_cleu:SetScript("OnEvent", function(self, event, ...)
  8.    
  9.     print ( prgname .. " : " .. event)
  10.    
  11.     if event == "ZONE_CHANGED_NEW_AREA" or event == "ZONE_CHANGED" then
  12.    
  13.         local _, instanceType = IsInInstance()
  14.        
  15.         if instanceType == "arena" or instanceType == "pvp" or (instanceType == "none" and GetZonePVPInfo() == "combat") then
  16.  
  17.  
  18. --- code continues as above


If you login and don't move it doesn't trigger but in this case you want stress the poor programmer :-)


P.s
I have also add the line:
local string_format = string.format
to "upvalued" also the declared string_format (local of string.format) function I presume.

Last edited by gmarco : 11-27-12 at 02:10 AM.
  Reply With Quote