View Single Post
12-20-08, 01:54 PM   #11
Kyc
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 23
Revised for joining a raid and only asking once per session
Code:
local f = CreateFrame("frame")
f:SetScript("OnEvent", function(self, event, ...) if self[event] then return self[event](self, event, ...) end end)
f:RegisterEvent("RAID_ROSTER_UPDATE")

-- set to true to automatically start the log
local autoLog = false
local currentlyLogging = false

-- fired when joining/starting a raid
function f:RAID_ROSTER_UPDATE()
    
    if currentlyLogging == true then
        return
    end
    if autoLog == true then
	LoggingCombat(1)
	currentlyLogging = true
    else
	StaticPopup_Show("ENABLE_LOGGING_ON_RAID");
    end

end

-- simple dialog
StaticPopupDialogs["ENABLE_LOGGING_ON_RAID"] = {
  text = "Do you want to start logging?",
  button1 = "Yes",
  button2 = "No",
  OnAccept = function()
      LoggingCombat(1);
      currentlyLogging = true
  end,
  timeout = 0,
  whileDead = 1,
  hideOnEscape = 1
};

Last edited by Kyc : 12-20-08 at 01:55 PM. Reason: oops
  Reply With Quote