Add afk and battlepass timer for easier battle pass experience
This commit is contained in:
16
FreshShit/BattlePassTimer/event.lua
Normal file
16
FreshShit/BattlePassTimer/event.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
-- PLAYER_ENTERING_WORLD PLAYER_LEAVING_WORLD
|
||||
function(e)
|
||||
if WeakAurasSaved.Cyka.LoginInfo[UnitName("player")] == nil then WeakAurasSaved.Cyka.LoginInfo[UnitName("player")] = {} end
|
||||
local index = #WeakAurasSaved.Cyka.LoginInfo[UnitName("player")]
|
||||
|
||||
if e == "PLAYER_ENTERING_WORLD" then
|
||||
WeakAurasSaved.Cyka.LoginInfo[UnitName("player")][index + 1] = {LoginTime = GetTime()}
|
||||
if WeakAurasSaved.Cyka.LoginInfo[UnitName("player")][index] ~= nil then
|
||||
WeakAurasSaved.Cyka.LoginInfo[UnitName("player")][index].LogoutTime = GetTime()
|
||||
end
|
||||
elseif e == "PLAYER_LEAVING_WORLD" then
|
||||
WeakAurasSaved.Cyka.LoginInfo[UnitName("player")][index].LogoutTime = GetTime()
|
||||
end
|
||||
end
|
||||
|
||||
--/run WeakAuras.ScanEvents("PLAYER_ENTERING_WORLD")
|
||||
Reference in New Issue
Block a user