diff --git a/FreshShit/BattlePassTimer/BattlePassAccountWideTimer/event.lua b/FreshShit/BattlePassTimer/BattlePassAccountWideTimer/event.lua deleted file mode 100644 index 4a52d96..0000000 --- a/FreshShit/BattlePassTimer/BattlePassAccountWideTimer/event.lua +++ /dev/null @@ -1,5 +0,0 @@ --- PINKY_BPASS_OPEN -function(allstates, e) - aura_env.DisplayString = aura_env.GetAllTimeLeft() - return true -end \ No newline at end of file diff --git a/FreshShit/BattlePassTimer/BattlePassAccountWideTimer/init.lua b/FreshShit/BattlePassTimer/BattlePassAccountWideTimer/init.lua deleted file mode 100644 index 1c51f86..0000000 --- a/FreshShit/BattlePassTimer/BattlePassAccountWideTimer/init.lua +++ /dev/null @@ -1,28 +0,0 @@ -if WeakAurasSaved.Cyka == nil then WeakAurasSaved.Cyka = {} end -if WeakAurasSaved.Cyka.LoginInfo == nil then WeakAurasSaved.Cyka.LoginInfo = {} end - -Today = date("%Y-%m-%d") -if WeakAurasSaved.Cyka.LoginInfo[UnitName("player")] == nil then WeakAurasSaved.Cyka.LoginInfo[UnitName("player")] = {} end -if WeakAurasSaved.Cyka.LoginInfo[UnitName("player")][Today] == nil then - WeakAurasSaved.Cyka.LoginInfo[UnitName("player")][Today] = { - isClaimed = false, - timeLeft = 120, - } -end - ----@param unit string ----@return number -aura_env.GetTimeLeft = function(unit) - local timeLeft = WeakAurasSaved.Cyka.LoginInfo[unit][Today].timeLeft - if timeLeft == nil then return 120 end - return timeLeft -end ----@return string -aura_env.GetAllTimeLeft = function() - local out = "" - for unit, _ in pairs(WeakAurasSaved.Cyka.LoginInfo) do - local timeLeft = aura_env.GetTimeLeft(unit) - out = out .. unit .. ": " .. timeLeft .. "\n" - end - return out -end \ No newline at end of file diff --git a/FreshShit/BattlePassTimer/BattlePassAccountWideTimer/text.lua b/FreshShit/BattlePassTimer/BattlePassAccountWideTimer/text.lua deleted file mode 100644 index 579e731..0000000 --- a/FreshShit/BattlePassTimer/BattlePassAccountWideTimer/text.lua +++ /dev/null @@ -1,4 +0,0 @@ -function() - -- TODO: Display completed chars in green or something - return aura_env.DisplayString -end \ No newline at end of file diff --git a/FreshShit/BattlePassTimer/BattlePassFrameController/event.lua b/FreshShit/BattlePassTimer/BattlePassFrameController/event.lua deleted file mode 100644 index e7b5b95..0000000 --- a/FreshShit/BattlePassTimer/BattlePassFrameController/event.lua +++ /dev/null @@ -1,4 +0,0 @@ --- TICKER_10000 -function() - aura_env.Tick() -end \ No newline at end of file diff --git a/FreshShit/BattlePassTimer/BattlePassFrameController/init.lua b/FreshShit/BattlePassTimer/BattlePassFrameController/init.lua deleted file mode 100644 index acdb4af..0000000 --- a/FreshShit/BattlePassTimer/BattlePassFrameController/init.lua +++ /dev/null @@ -1,21 +0,0 @@ -aura_env.BattlePass = { - Show = function() - if not uDailyRewFrame:IsVisible() then - -- uDailyRewFrame:Show() - udailyRewardIcon:Click() - end - end, - Hide = function() - if uDailyRewFrame:IsVisible() then - uDailyRewFrame:Hide() - end - end, -} - -local aura_env = aura_env -aura_env.Tick = function() - aura_env.BattlePass.Show() - C_Timer.After(0.1, function() - WeakAuras.ScanEvents("PINKY_BPASS_OPEN") - end) -end diff --git a/FreshShit/BattlePassTimer/BattlePassTimeDisplay/duration.lua b/FreshShit/BattlePassTimer/BattlePassTimeDisplay/duration.lua deleted file mode 100644 index 66dbfd3..0000000 --- a/FreshShit/BattlePassTimer/BattlePassTimeDisplay/duration.lua +++ /dev/null @@ -1,3 +0,0 @@ -function(e) - return 120 - aura_env.GetTimeLeft(), 120, 1 -end \ No newline at end of file diff --git a/FreshShit/BattlePassTimer/BattlePassTimeDisplay/event.lua b/FreshShit/BattlePassTimer/BattlePassTimeDisplay/event.lua deleted file mode 100644 index a39fe8c..0000000 --- a/FreshShit/BattlePassTimer/BattlePassTimeDisplay/event.lua +++ /dev/null @@ -1,4 +0,0 @@ --- PINKY_BPASS_OPEN -function() - return aura_env.GetTimeLeft() > 0 -end \ No newline at end of file diff --git a/FreshShit/BattlePassTimer/BattlePassTimeDisplay/init.lua b/FreshShit/BattlePassTimer/BattlePassTimeDisplay/init.lua deleted file mode 100644 index 2aa0777..0000000 --- a/FreshShit/BattlePassTimer/BattlePassTimeDisplay/init.lua +++ /dev/null @@ -1,17 +0,0 @@ -if WeakAurasSaved.Cyka == nil then WeakAurasSaved.Cyka = {} end -if WeakAurasSaved.Cyka.LoginInfo == nil then WeakAurasSaved.Cyka.LoginInfo = {} end - -Today = date("%Y-%m-%d") -if WeakAurasSaved.Cyka.LoginInfo[UnitName("player")] == nil then WeakAurasSaved.Cyka.LoginInfo[UnitName("player")] = {} end -if WeakAurasSaved.Cyka.LoginInfo[UnitName("player")][Today] == nil then - WeakAurasSaved.Cyka.LoginInfo[UnitName("player")][Today] = { - isClaimed = false, - timeLeft = 120, - } -end - -aura_env.GetTimeLeft = function() - local timeLeft = WeakAurasSaved.Cyka.LoginInfo[UnitName("player")][Today].timeLeft - if timeLeft == nil then return 120 end - return timeLeft -end \ No newline at end of file diff --git a/FreshShit/BattlePassTimer/BattlePassTimeReader/event.lua b/FreshShit/BattlePassTimer/BattlePassTimeReader/event.lua deleted file mode 100644 index 7d52d7e..0000000 --- a/FreshShit/BattlePassTimer/BattlePassTimeReader/event.lua +++ /dev/null @@ -1,4 +0,0 @@ --- PINKY_BPASS_OPEN -function() - aura_env.Tick() -end \ No newline at end of file diff --git a/FreshShit/BattlePassTimer/BattlePassTimeReader/init.lua b/FreshShit/BattlePassTimer/BattlePassTimeReader/init.lua deleted file mode 100644 index 659ba33..0000000 --- a/FreshShit/BattlePassTimer/BattlePassTimeReader/init.lua +++ /dev/null @@ -1,79 +0,0 @@ -if WeakAurasSaved.Cyka == nil then WeakAurasSaved.Cyka = {} end -if WeakAurasSaved.Cyka.LoginInfo == nil then WeakAurasSaved.Cyka.LoginInfo = {} end - -Today = date("%Y-%m-%d") -if WeakAurasSaved.Cyka.LoginInfo[UnitName("player")] == nil then WeakAurasSaved.Cyka.LoginInfo[UnitName("player")] = {} end -if WeakAurasSaved.Cyka.LoginInfo[UnitName("player")][Today] == nil then - WeakAurasSaved.Cyka.LoginInfo[UnitName("player")][Today] = { - isClaimed = false, - timeLeft = 120, - } -end - -aura_env.BattlePass = { - Hide = function() - uDailyRewFrame:Hide() - end, - ---@param day number - ---@return Frame, string|nil - GetDayCard = function(day) - local frame = _G[string.format("card%d", day)] - if frame == nil then - return UIParent, string.format("card%d is nil", day) - end - return frame, nil - end, - ---@return {day: number, text: Frame, button: Frame}, string|nil - GetActiveDayInfo = function() - for i = 1, 7 do - local dayCard, err = aura_env.BattlePass.GetDayCard(i) - if err ~= nil then return { day = i, text = nil, button = nil }, err end - - local textFrame = dayCard.text_w - if textFrame ~= nil then - if textFrame:GetText() ~= nil then - return { day = i, text = textFrame, button = nil }, nil - end - else - print(string.format("card%d.text_w is nil", i)) - end - - local button = _G[string.format("uDRWbutton_get%d", i)] - if button ~= nil then - return { day = i, text = nil, button = button }, nil - end - end - return { day = 0, text = nil, button = nil }, "No active days found" - end, - GetRemainingTime = function() - local activeDayInfo, err = aura_env.BattlePass.GetActiveDayInfo() - if err ~= nil then return 0, err end - if activeDayInfo.text == nil then return 0, "No time text found" end - local minutes = tonumber(activeDayInfo.text:GetText():match("(%d+) minutes")) - if minutes == nil then return 0, "No time text found" end - return minutes, nil - end -} - -local aura_env = aura_env -aura_env.Tick = function() - -- TODO: If cannot find time text try find claim button - -- If claim button then click claim button and set isClaimed to true - -- OR better yet change the click handler to one that updates isClaimed to true - -- And THEN click the button - -- idk if that works though - -- uDRWbutton_get is the button - local remainingTime = aura_env.BattlePass.GetRemainingTime() - if remainingTime == 0 then - local activeDayInfo, err = aura_env.BattlePass.GetActiveDayInfo() - if activeDayInfo.button ~= nil then - activeDayInfo.button:Click() - WeakAurasSaved.Cyka.LoginInfo[UnitName("player")][Today].isClaimed = true - end - end - WeakAurasSaved.Cyka.LoginInfo[UnitName("player")][Today].timeLeft = remainingTime - aura_env.BattlePass.Hide() - C_Timer.After(0.1, function() - aura_env.BattlePass.Hide() - end) -end diff --git a/FreshShit/BattlePassTimer/duration.lua b/FreshShit/BattlePassTimer/duration.lua new file mode 100644 index 0000000..2676ae3 --- /dev/null +++ b/FreshShit/BattlePassTimer/duration.lua @@ -0,0 +1,3 @@ +function() + return BattlepassInfo.currentDayOnlineTimeMinutes, 120, 1 +end \ No newline at end of file diff --git a/FreshShit/BattlePassTimer/event.lua b/FreshShit/BattlePassTimer/event.lua new file mode 100644 index 0000000..a5e7733 --- /dev/null +++ b/FreshShit/BattlePassTimer/event.lua @@ -0,0 +1,6 @@ +-- CHAT_MSG_ADDON +function(e, opcode, msg) + if opcode ~= "UISMSG_TO_CLIENT" then return end + BattlepassInfo.ParseApi(msg) + return true +end diff --git a/FreshShit/BattlePassTimer/event2.lua b/FreshShit/BattlePassTimer/event2.lua new file mode 100644 index 0000000..574f81a --- /dev/null +++ b/FreshShit/BattlePassTimer/event2.lua @@ -0,0 +1,4 @@ +--- TICKER_10000 +function() + BattlepassInfo() +end \ No newline at end of file diff --git a/FreshShit/BattlePassTimer/export b/FreshShit/BattlePassTimer/export index 43f7b99..5ab9679 100644 --- a/FreshShit/BattlePassTimer/export +++ b/FreshShit/BattlePassTimer/export @@ -1 +1 @@ -!TVrIYPns2)fQk1IRnqb(ECTZulGXXKXb8IWXjZmlI2snGccjgDyB8mHV9996drlrloIDMnBTPCsSuRUF397Q70VA)E9nc7BSF5Qhx(G(gt7ByJ)bg9oI1e7a)zn8D9dGbAxL9N9z)7bS)9W(TRu(O(rWK9dSPb1flPVrDxNNEIeyVyqpFF3ihyisC0y)GoZIC89cb4LSQ(3jFQP9iAFdJFpMeqxm4Iyx3fdUDStemyaDeSUEZNbppkWpEMCngoprrQs8Qk1wHrTvyuBfg1wfXQLV3qNrCk4XodhgsJWVBqSKKMryejiIpJHoEoHJ5pdpYhfEokWz0iAqihx9sgaF0MEx8WHCI9YMxD9f3Cf8D2RK4acqSHZOUUTSfYHW47O3t9ImGv58yFdZg1m6zA0RwxayXisnM5sMd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n)arTcLqPmSQyqi3p0q0gmu1tKF(amoTukfxxi2lqQFo8RUOs2CArAjuF8tvqCjI4H66CVuAQVrnRs1UwdI8ov1RTicl6zkLkRn9nQrTwNH7xGFQhtL567A8s64N95NK4dokEOu8R9rATdlc(fPVZpW(r4EjofaiAGAsKBtfBu7R5avgTpS(tsTBRdKh5TN)jye1TGd4pEWyq5ChAnKoyG5O3K(dkflZG6fgUg7xbXIpBtkrmzEfbX6ml3u6JAWZ)uJIw2NU1x8Xh0FFjX5bCS60S95n76yTd61Rxhr7Eo)Nd \ No newline at end of file diff --git a/FreshShit/BattlePassTimer/init.lua b/FreshShit/BattlePassTimer/init.lua new file mode 100644 index 0000000..9ca10ef --- /dev/null +++ b/FreshShit/BattlePassTimer/init.lua @@ -0,0 +1,66 @@ +---@param input string +---@param deliminer string +---@return table +aura_env.Split = function(input, deliminer) + local ret = {} + for str in string.gmatch(input, "([^" .. deliminer .. "]+)") do + table.insert(ret, str) + end + return ret +end + +---@class BattlepassInfo +---@field week number +---@field getRew number +---@field dayRewardComplete number +---@field lostDay number +---@field cost number +---@field currentDayOnlineTimeMinutes number +---@field currentDayOnlineTimeMilliseconds number +BattlepassInfo = { + PingApi = function() + SendAddonMessage('UIMSG_TO_SERVER', "UIMSG_GET_ONLINETIME_DAY" .. "\t", 'WHISPER', UnitName('player')) + end, + ParseApi = function(msg) + local packets = aura_env.Split(msg, ":") + if packets[1] ~= "UISMSG_EVT_WEEK_TIME" then return end + + BattlepassInfo.currentDayOnlineTimeMilliseconds = tonumber(packets[2]) + BattlepassInfo.week = tonumber(packets[3]) + 1 + BattlepassInfo.getRew = tonumber(packets[4]) + BattlepassInfo.dayRewardComplete = tonumber(packets[5]) + BattlepassInfo.lostDay = tonumber(packets[6]) + BattlepassInfo.cost = tonumber(packets[7]) + BattlepassInfo.currentDayOnlineTimeMinutes = math.ceil(BattlepassInfo.currentDayOnlineTimeMilliseconds / 60000) + + if BattlepassInfo.currentDayOnlineTimeMinutes >= 120 then + print(BattlepassInfo) + end + end, +} +setmetatable(BattlepassInfo, { + __call = BattlepassInfo.PingApi, + __index = BattlepassInfo, + __tostring = function() + local ret = {} + for k, v in pairs(BattlepassInfo) do + table.insert(ret, k .. ": " .. tostring(v)) + end + return table.concat(ret, "\n") + end +}) + +for k, v in pairs(BattlepassInfo) do + if type(v) == "number" then + BattlepassInfo[k] = 0 + end +end +BattlepassInfo() + +-- TODO: Make DINGDINGDING when cooked +-- TODO: Make hide when reward complete +-- dayRewardComplete = 1 for cooked (or complete?) +-- delta < 0 for day complete +-- in this case BattlepassInfo.currentDayOnlineTimeMinutes >= 120 +-- TODO: To auto claim reward do: +-- UENR:SendPacket('UIMSG_WEEKLY_REW_GET')