known state
This commit is contained in:
parent
e2e8a053f0
commit
3ae60e444e
@ -5,7 +5,7 @@
|
|||||||
## Version: 1.2
|
## Version: 1.2
|
||||||
|
|
||||||
# Stats stated here are saved per character.
|
# Stats stated here are saved per character.
|
||||||
## SavedVariablesPerCharacter: Trackster_jumpCounter, Trackster_critCounter, Trackster_castCounter, Trackster_loginCounter, Trackster_bossCounter, Trackster_chatCounter, Trackster_itemCounter, Trackster_goldCounter, Trackster_distanceTravelledCounter, Trackster_distanceTravelledCounter__swam, Trackster_distanceTravelledCounter__walked, Trackster_distanceTravelledCounter__groundmount, Trackster_distanceTravelledCounter__flight, Trackster_distanceTravelledCounter__taxi, Trackster_distanceTravelledCounter__ghost
|
## SavedVariablesPerCharacter: Trackster_jumpCounter, Trackster_critCounter, Trackster_questCounter, Trackster_castCounter, Trackster_loginCounter, Trackster_bossCounter, Trackster_chatCounter, Trackster_itemCounter, Trackster_goldCounter, Trackster_distanceTravelledCounter, Trackster_distanceTravelledCounter__swam, Trackster_distanceTravelledCounter__walked, Trackster_distanceTravelledCounter__groundmount, Trackster_distanceTravelledCounter__flight, Trackster_distanceTravelledCounter__taxi, Trackster_distanceTravelledCounter__ghost
|
||||||
|
|
||||||
|
|
||||||
# Stats stated here are saved for the whole wow client.
|
# Stats stated here are saved for the whole wow client.
|
||||||
|
37
main.lua
37
main.lua
@ -3,7 +3,7 @@
|
|||||||
if you feel personally insulted, feel free to contact /2
|
if you feel personally insulted, feel free to contact /2
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local mainFrame = CreateFrame("frame", "TracksterMainFrame", self, BackdropTemplateMixin and "BackdropTemplate");
|
local mainFrame = CreateFrame("frame", "TracksterMainFrame", nil, BackdropTemplateMixin and "BackdropTemplate");
|
||||||
Trackster = {};
|
Trackster = {};
|
||||||
|
|
||||||
Trackster_jumpCounter = 0;
|
Trackster_jumpCounter = 0;
|
||||||
@ -14,6 +14,7 @@ Trackster_bossCounter = 0;
|
|||||||
Trackster_chatCounter = 0;
|
Trackster_chatCounter = 0;
|
||||||
Trackster_itemCounter = 0;
|
Trackster_itemCounter = 0;
|
||||||
Trackster_goldCounter = 0;
|
Trackster_goldCounter = 0;
|
||||||
|
Trackster_questCounter = 0;
|
||||||
Trackster_distanceTravelledCounter = 0;
|
Trackster_distanceTravelledCounter = 0;
|
||||||
Trackster_distanceTravelledCounter__swam = 0;
|
Trackster_distanceTravelledCounter__swam = 0;
|
||||||
Trackster_distanceTravelledCounter__walked = 0;
|
Trackster_distanceTravelledCounter__walked = 0;
|
||||||
@ -458,14 +459,7 @@ end
|
|||||||
|
|
||||||
local function UpdateQuests()
|
local function UpdateQuests()
|
||||||
Trackster_questsOffset = round(Trackster_questsOffset);
|
Trackster_questsOffset = round(Trackster_questsOffset);
|
||||||
|
fsQuests:SetText("Quest count: " .. textCol_value .. (Trackster_questCounter + Trackster_questsOffset));
|
||||||
local val = select(1, GetStatistic(98));
|
|
||||||
|
|
||||||
if (val == "--") then
|
|
||||||
fsQuests:SetText("Quest count: " .. textCol_value .. (Trackster_questsOffset));
|
|
||||||
else
|
|
||||||
fsQuests:SetText("Quest count: " .. textCol_value .. (val + Trackster_questsOffset));
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function UpdateHearthstones()
|
local function UpdateHearthstones()
|
||||||
@ -574,11 +568,12 @@ local function UpdateTime()
|
|||||||
Trackster_timeOffset = round(Trackster_timeOffset);
|
Trackster_timeOffset = round(Trackster_timeOffset);
|
||||||
|
|
||||||
local d, h, m, s = select(1, FormatTime(lastConfirmedTime + internalTimeOffset + Trackster_timeOffset));
|
local d, h, m, s = select(1, FormatTime(lastConfirmedTime + internalTimeOffset + Trackster_timeOffset));
|
||||||
|
local totalHours = math.floor((lastConfirmedTime + internalTimeOffset + Trackster_timeOffset) / 3600);
|
||||||
|
|
||||||
fsTime:SetText("Time played: " .. textCol_value .. d .. " days, " .. h .. ":" .. m .. ":" .. s);
|
fsTime:SetText("Time played: " .. textCol_value .. d .. "d, " .. h .. ":" .. m .. ":" .. s .. " (" .. totalHours .. "h)");
|
||||||
|
|
||||||
local d, h, m, s = select(1, FormatTime(time() - Trackster_timestampRunBegin));
|
local d, h, m, s = select(1, FormatTime(time() - Trackster_timestampRunBegin));
|
||||||
fsAbsTime:SetText("Time real: " .. textCol_value .. d .. " days, " .. h .. ":" .. m .. ":" .. s);
|
fsAbsTime:SetText("Time real: " .. textCol_value .. d .. "d, " .. h .. ":" .. m .. ":" .. s);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -761,8 +756,7 @@ end
|
|||||||
mainFrame:SetScript("OnShow", UpdateAll);
|
mainFrame:SetScript("OnShow", UpdateAll);
|
||||||
|
|
||||||
local function ProcessChatMsg(...)
|
local function ProcessChatMsg(...)
|
||||||
|
author = select(2, ...)
|
||||||
author = select(2, ...);
|
|
||||||
|
|
||||||
if(author == GetUnitName("player") .. "-" .. GetRealmName()) then
|
if(author == GetUnitName("player") .. "-" .. GetRealmName()) then
|
||||||
Trackster_chatCounter = Trackster_chatCounter + 1;
|
Trackster_chatCounter = Trackster_chatCounter + 1;
|
||||||
@ -806,8 +800,9 @@ local GetGoldDifference = function()
|
|||||||
return tmp;
|
return tmp;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local timeLastQuestCompleted = time() --> This event may fire multiple times per quest turnin -.- so we'll just add a cooldown to it...
|
||||||
local function eventHandler(self, event, ...)
|
local function eventHandler(self, event, ...)
|
||||||
|
|
||||||
if (event == "PLAYER_ENTERING_WORLD") then
|
if (event == "PLAYER_ENTERING_WORLD") then
|
||||||
UpdateAll();
|
UpdateAll();
|
||||||
RequestTimePlayed();
|
RequestTimePlayed();
|
||||||
@ -851,7 +846,19 @@ local function eventHandler(self, event, ...)
|
|||||||
--UpdateDmg();
|
--UpdateDmg();
|
||||||
|
|
||||||
elseif (event == "QUEST_TURNED_IN") then
|
elseif (event == "QUEST_TURNED_IN") then
|
||||||
UpdateQuests();
|
--> This event may fire multiple times per quest turnin -.- so we'll just add a cooldown to it...
|
||||||
|
local timeNow = time();
|
||||||
|
if (timeNow - timeLastQuestCompleted > 3) then
|
||||||
|
print("Quest turned in, fired, and counted!");
|
||||||
|
Trackster_questCounter = Trackster_questCounter + 1;
|
||||||
|
UpdateQuests();
|
||||||
|
else
|
||||||
|
print("Quest turned in, fired, but it was ignored as a duplicate!");
|
||||||
|
end
|
||||||
|
timeLastQuestCompleted = timeNow;
|
||||||
|
|
||||||
|
echo()
|
||||||
|
|
||||||
|
|
||||||
elseif (event == "PLAYER_EQUIPMENT_CHANGED") then
|
elseif (event == "PLAYER_EQUIPMENT_CHANGED") then
|
||||||
UpdateIlvl();
|
UpdateIlvl();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user