Thread Tools Display Modes
12-21-23, 06:05 PM   #1
Aethereality
A Defias Bandit
Join Date: Dec 2023
Posts: 2
Request: Prevent an addon from firing its script on reload?

Howdy. I'm trying to write an overly basic addon that runs some code when the player first logs in, but not when they do a /reload. Is there a way to prevent this from happening?

The code is very basic;

Lua Code:
  1. local frame=CreateFrame("Frame");
  2. frame:RegisterEvent("PLAYER_LOGIN");
  3. frame:SetScript("OnEvent",function(self,event,...)
  4.     --My code is here, it's one line
  5. end);
  Reply With Quote
12-21-23, 07:29 PM   #2
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
Code:
local frame=CreateFrame("Frame")
frame:RegisterEvent("PLAYER_ENTERING_WORLD")
frame:SetScript("OnEvent",function(self,event,...)
    local isLogin, isReload = ...
    if isLogin then
    -- your action here
    end
end)
  Reply With Quote
12-21-23, 07:34 PM   #3
Aethereality
A Defias Bandit
Join Date: Dec 2023
Posts: 2
Originally Posted by Dridzt View Post
Code:
local frame=CreateFrame("Frame")
frame:RegisterEvent("PLAYER_ENTERING_WORLD")
frame:SetScript("OnEvent",function(self,event,...)
    local isLogin, isReload = ...
    if isLogin then
    -- your action here
    end
end)
Thank you very much @_@
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Request: Prevent an addon from firing its script on reload?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off