View Single Post
12-12-12, 06:38 AM   #11
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
I did something like this to check if the addon db was in an old format and eventually convert.

Lua Code:
  1. frame_cleu:RegisterEvent("ZONE_CHANGED_NEW_AREA")
  2. frame_cleu:RegisterEvent("PLAYER_ENTERING_WORLD")
  3. frame_cleu:RegisterEvent("PLAYER_LOGIN")
  4.  
  5. frame_cleu:SetScript("OnEvent", function(self, event, ...)
  6.  
  7.     if event == "PLAYER_LOGIN" then    
  8.        
  9.         if RemGankCFG["newdbver"] == nil then RemGank_DB_Convert() end
  10.        
  11.         if RemGankCFG["enabled"] == true then
  12.             print(string_format("%s: enabled", prgname))
  13.         else
  14.             print(string_format("%s: disabled. Type /remgank enable to start", prgname))           
  15.         end
  16.        
  17.     end
  18.  
  19.     if event == "ZONE_CHANGED_NEW_AREA" or event == "PLAYER_ENTERING_WORLD" then   
  20.  
  21.               -- blabla
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote