1
0
Bifurcation 0

Replaced GetTime() with time() where it seemed appropriate to do so. In two cases, the precision of GetTime was actually in use and the desired difference was rounded up to the next second.

Cette révision appartient à :
Nathanial.C.Jones 2011-12-03 00:36:48 +00:00
Parent 91d99b09f4
révision 3edb977f52
27 fichiers modifiés avec 118 ajouts et 118 suppressions

Voir le fichier

@ -220,7 +220,7 @@ OnUpdate = function()
arrow:SetVertexColor(0, 1, 0)
end
local cell = math.floor(mod(GetTime() * 20, 55)) -- 20 fps seems to be around the right number
local cell = math.floor(mod(time() * 20, 55)) -- 20 fps seems to be around the right number
local column = cell % 9
local row = floor(cell / 9)

Voir le fichier

@ -178,7 +178,7 @@ function QH_Collector_Init()
do -- Clean some stuff up!
local obliterate = {}
for k, v in pairs(QuestHelper_Collector) do
if not v.modified or v.modified + 30 * 24 * 60 * 60 < GetTime() then
if not v.modified or v.modified + 30 * 24 * 60 * 60 < time() then
table.insert(obliterate, k)
end
end
@ -201,7 +201,7 @@ QH_OnUpdate(function ()
for _, v in pairs(OnUpdateRegistrar) do
v()
end
QH_Timeslice_Increment(GetTime() - tstart, "collect_update")
QH_Timeslice_Increment(time() - tstart, "collect_update")
end)
@ -252,7 +252,7 @@ end
local function DoCompress(item, merger, comp)
if debug_output then QuestHelper: TextOut("Item condensing") end
local ts = GetTime()
local ts = time()
local target = {}
for k, v in pairs(item) do
@ -265,7 +265,7 @@ local function DoCompress(item, merger, comp)
seritem(target, function(dat) merger.Add(mg, dat) end)
local tg = merger.Finish(mg)
if debug_output then QuestHelper: TextOut(string.format("Item condensed to %d bytes, %f taken so far", #tg, GetTime() - ts)) end
if debug_output then QuestHelper: TextOut(string.format("Item condensed to %d bytes, %f taken so far", #tg, time() - ts)) end
mg = nil
local cmp = {}
@ -290,7 +290,7 @@ local function DoCompress(item, merger, comp)
end
item.compressed = cmp
if debug_output then QuestHelper: TextOut(string.format("Item compressed to %d bytes in %d shards (previously %d), %f taken", cmptot, type(cmp) == "table" and #cmp or 1, #tg, GetTime() - ts)) end
if debug_output then QuestHelper: TextOut(string.format("Item compressed to %d bytes in %d shards (previously %d), %f taken", cmptot, type(cmp) == "table" and #cmp or 1, #tg, time() - ts)) end
end
CompressCollection = function(active, active2, merger, comp)

Voir le fichier

@ -107,7 +107,7 @@ local function Looted(message)
if not nonempty then return end -- congratulations you are better than nothing, we do not care
Notifier(GetTime() + 5 * 60, function () Recheck(item, equiploc, competing) end)
Notifier(time() + 5 * 60, function () Recheck(item, equiploc, competing) end)
end
end

Voir le fichier

@ -13,7 +13,7 @@ local last_hearth = 0
local function OnZoneChanged()
local start, cd, _ = GetItemCooldown(6948)
if last_hearth + 1800 < GetTime() and cd == 1800 then
if last_hearth + 1800 < time() and cd == 1800 then
last_hearth = start
local home = GetBindLocation()
if not QHCZ[home] then QHCZ[home] = {} end

Voir le fichier

@ -78,7 +78,7 @@ local MS_TAPPED_LOOTABLE = 4
local MS_TAPPED_LOOTABLE_TRIVIAL = 5
local MS_TAPPED_LOOTED = 6
local last_cleanup = GetTime()
local last_cleanup = time()
local monsterstate = {}
local monsterrefresh = {}
@ -98,7 +98,7 @@ local function CombatLogEvent(_, event, sourceguid, _, _, destguid, _, _, _, spe
-- First, if there's any damage messages coming either to or from a party member, we check to see if that monster is tapped by us. If it's tapped, we cache the value for 15 seconds, expiring entirely in 30.
-- Second, there's the Death message. If it's tapped by us, increases the kill count by 1/partymembers and changes its state to lootable.
if event ~= "UNIT_DIED" then
if last_scan > GetTime() then return end -- welp
if last_scan > time() then return end -- welp
-- Something has been attacked by something, maybe.
if not string.find(event, "_DAMAGE$") then return end -- We only care about something punching something else.
@ -114,7 +114,7 @@ local function CombatLogEvent(_, event, sourceguid, _, _, destguid, _, _, _, spe
if not target then return end -- If we don't have a target, then nobody is in our party, and we don't care.
if monsterrefresh[target] and monsterrefresh[target] > GetTime() then return end -- we already have fresh data, so we're good
if monsterrefresh[target] and monsterrefresh[target] > time() then return end -- we already have fresh data, so we're good
-- Now comes the tricky part. We can't just look at the target because we're not allowed to target by GUID. So we iterate through all the party/raid members and hope *someone* has it targeted. Luckily, we can stop once we find someone who does.
local targ
@ -122,7 +122,7 @@ local function CombatLogEvent(_, event, sourceguid, _, _, destguid, _, _, _, spe
targ = v .. "target" if UnitGUID(targ) == target then break end
targ = nil
end
last_scan = GetTime() + 1
last_scan = time() + 1
if not targ then
--monsterrefresh[target] = GetTime() + 5
@ -134,13 +134,13 @@ local function CombatLogEvent(_, event, sourceguid, _, _, destguid, _, _, _, spe
if not UnitIsTapped(targ) then
-- Great. Nobody is. That is just *great*. Look how exuberant I feel at this moment. You know what? 5-second timeout.
monsterstate[target] = nil
monsterrefresh[target] = GetTime() + 5
monstertimeout[target] = GetTime() + 5
monsterrefresh[target] = time() + 5
monstertimeout[target] = time() + 5
--if debug_output then QuestHelper:TextOut(string.format("Monster ignorified")) end
else
-- We know someone is, so we're going to set up our caching . . .
monsterrefresh[target] = GetTime() + 15
monstertimeout[target] = GetTime() + 30
monsterrefresh[target] = time() + 15
monstertimeout[target] = time() + 30
monsterstate[target] = (UnitIsTappedByPlayer(targ)) and (not UnitIsTrivial(targ) and MS_TAPPED_US or MS_TAPPED_US_TRIVIAL) or MS_TAPPED_OTHER -- and figure out if it's us. Or if it's trivial. We somewhat-ignore it if it's trivial, since it's much less likely to be looted and that could throw off our numbers
--if debug_output then QuestHelper:TextOut(string.format("Monster %s set to %d, %s, %s", target, monsterstate[target], tostring(UnitIsTappedByPlayer(targ)), tostring(UnitIsTrivial(targ)))) end
end
@ -149,7 +149,7 @@ local function CombatLogEvent(_, event, sourceguid, _, _, destguid, _, _, _, spe
else
-- It's dead. Hooray!
if monsterstate[destguid] and monstertimeout[destguid] > GetTime() and (monsterstate[destguid] == MS_TAPPED_US or monsterstate[destguid] == MS_TAPPED_US_TRIVIAL) and members_count > 0 then -- yaaay
if monsterstate[destguid] and monstertimeout[destguid] > time() and (monsterstate[destguid] == MS_TAPPED_US or monsterstate[destguid] == MS_TAPPED_US_TRIVIAL) and members_count > 0 then -- yaaay
local type = GetMonsterType(destguid)
if not QHC.monster[type] then QHC.monster[type] = {} end
if monsterstate[destguid] == MS_TAPPED_US then
@ -157,8 +157,8 @@ local function CombatLogEvent(_, event, sourceguid, _, _, destguid, _, _, _, spe
end
monsterstate[destguid] = (monsterstate[destguid] == MS_TAPPED_US and MS_TAPPED_LOOTABLE or MS_TAPPED_LOOTABLE_TRIVIAL)
monsterrefresh[destguid] = GetTime() + 600
monstertimeout[destguid] = GetTime() + 600
monsterrefresh[destguid] = time() + 600
monstertimeout[destguid] = time() + 600
--QuestHelper:TextOut(string.format("Tapped monster %s slain, set to lootable", destguid))
else
monsterstate[destguid] = nil
@ -181,7 +181,7 @@ local function SkinnableflagsTooltipy(self, ...)
if UnitExists("mouseover") and UnitIsVisible("mouseover") and not UnitIsPlayer("mouseover") and not UnitPlayerControlled("mouseover") and UnitIsDead("mouseover") then
local guid = UnitGUID("mouseover")
--QuestHelper:TextOut("critar")
if not monsterstate[guid] or monsterstate[guid] ~= MS_TAPPED_LOOTED or monsterrefresh[guid] > GetTime() then return end
if not monsterstate[guid] or monsterstate[guid] ~= MS_TAPPED_LOOTED or monsterrefresh[guid] > time() then return end
--QuestHelper:TextOut("runin")
local cid = GetMonsterType(guid)
@ -240,19 +240,19 @@ local function PPSent(player, spell, _, target)
if spell ~= pickpocket_name then return end
if UnitName("target") ~= target then return end -- DENY
pickpocket_timestamp, pickpocket_target, pickpocket_otarget_guid, pickpocket_phase = GetTime(), target, UnitGUID("target"), PP_PHASE_SENT
pickpocket_timestamp, pickpocket_target, pickpocket_otarget_guid, pickpocket_phase = time(), target, UnitGUID("target"), PP_PHASE_SENT
end
local function PPSucceed(player, spell, rank)
if player ~= "player" then return end
if spell ~= pickpocket_name then return end
if pickpocket_phase ~= PP_PHASE_SENT and (not pickpocket_otarget_guid or last_timestamp + 1 < GetTime()) then
if pickpocket_phase ~= PP_PHASE_SENT and (not pickpocket_otarget_guid or last_timestamp + 1 < time()) then
pp_reset()
return
end
pickpocket_timestamp, pickpocket_phase = GetTime(), PP_PHASE_COMPLETE
pickpocket_timestamp, pickpocket_phase = time(), PP_PHASE_COMPLETE
end
@ -272,7 +272,7 @@ local function ItemLock(bag, slot)
QuestHelper:TextOut(string.format("trying lock %s", tostring(type(touched_itemid))))
QuestHelper:TextOut(string.format("trying lock %s", tostring(QHC.item[touched_itemid].open_yes)))
QuestHelper:TextOut(string.format("trying lock %s", tostring(QHC.item[touched_itemid].open_no)))]]
touched_timestamp = GetTime()
touched_timestamp = time()
if not QHC.item[touched_itemid] or (QHC.item[touched_itemid].open_yes or 0) <= (QHC.item[touched_itemid].open_no or 0) then
touched_itemid = nil
touched_timestamp = nil
@ -301,7 +301,7 @@ local last_otarget
local last_otarget_guid
local last_timestamp
local last_succeed = false
local last_succeed_trade = GetTime()
local last_succeed_trade = time()
local gathereffects = {}
@ -334,7 +334,7 @@ local function SpellSent(player, spell, rank, target)
if player ~= "player" then return end
spell = normalize_spell(spell)
last_timestamp, last_spell, last_rank, last_target, last_target_guid, last_otarget, last_otarget_guid, last_succeed, last_phase = GetTime(), spell, rank, target, nil, UnitName("target"), UnitGUID("target"), false, LAST_PHASE_SENT
last_timestamp, last_spell, last_rank, last_target, last_target_guid, last_otarget, last_otarget_guid, last_succeed, last_phase = time(), spell, rank, target, nil, UnitName("target"), UnitGUID("target"), false, LAST_PHASE_SENT
if last_otarget and last_otarget ~= last_target then last_reset() return end
@ -345,11 +345,11 @@ local function SpellStart(player, spell, rank)
if player ~= "player" then return end
spell = normalize_spell(spell)
if spell ~= last_spell or rank ~= last_rank or last_target_guid or last_phase ~= LAST_PHASE_SENT or last_timestamp + 1 < GetTime() then
if spell ~= last_spell or rank ~= last_rank or last_target_guid or last_phase ~= LAST_PHASE_SENT or last_timestamp + 1 < time() then
last_reset()
else
--QuestHelper:TextOut(string.format("sst %s", spell))
last_timestamp, last_phase = GetTime(), LAST_PHASE_START
last_timestamp, last_phase = time(), LAST_PHASE_START
end
end
@ -359,9 +359,9 @@ local function SpellCombatLog(_, event, sourceguid, _, _, destguid, _, _, _, spe
if sourceguid ~= UnitGUID("player") then return end
spellname = normalize_spell(spellname)
--QuestHelper:TextOut(string.format("cle_ss enter %s %s %s %s", tostring(spellname ~= last_spell), tostring(not last_target), tostring(not not last_target_guid), tostring(last_timestamp + 1 < GetTime())))
--QuestHelper:TextOut(string.format("cle_ss enter %s %s %s %s", tostring(spellname ~= last_spell), tostring(not last_target), tostring(not not last_target_guid), tostring(last_timestamp + 1 < time())))
if spellname ~= last_spell or not last_target or last_target_guid or last_timestamp + 1 < GetTime() then
if spellname ~= last_spell or not last_target or last_target_guid or last_timestamp + 1 < time() then
last_reset()
return
end
@ -374,7 +374,7 @@ local function SpellCombatLog(_, event, sourceguid, _, _, destguid, _, _, _, spe
end
--QuestHelper:TextOut(string.format("cesst %s", spellname))
last_timestamp, last_target_guid, last_phase = GetTime(), destguid, LAST_PHASE_COMBATLOG
last_timestamp, last_target_guid, last_phase = time(), destguid, LAST_PHASE_COMBATLOG
if last_target_guid == "0x0000000000000000" then last_target_guid = nil end
if last_target_guid and last_target_guid ~= last_otarget_guid then last_reset() return end
@ -384,7 +384,7 @@ local function SpellSucceed(player, spell, rank)
if player ~= "player" then return end
spell = normalize_spell(spell)
if gathereffects[spell] then last_succeed_trade = GetTime() end
if gathereffects[spell] then last_succeed_trade = time() end
--QuestHelper:TextOut(string.format("sscu enter %s %s %s %s %s", tostring(last_spell), tostring(last_target), tostring(last_rank), tostring(spell), tostring(rank)))
@ -396,19 +396,19 @@ local function SpellSucceed(player, spell, rank)
--QuestHelper:TextOut("sscu enter")
if gathereffects[spell] and gathereffects[spell].noclog then
if last_phase ~= LAST_PHASE_START or last_timestamp + 10 < GetTime() then
if last_phase ~= LAST_PHASE_START or last_timestamp + 10 < time() then
last_reset()
return
end
else
if last_phase ~= LAST_PHASE_COMBATLOG or last_timestamp + 10 < GetTime() then
if last_phase ~= LAST_PHASE_COMBATLOG or last_timestamp + 10 < time() then
last_reset()
return
end
end
--QuestHelper:TextOut(string.format("sscu %s, %d, %s, %s", spell, last_phase, tostring(last_phase == LAST_PHASE_SENT), tostring((last_phase == LAST_PHASE_SENT) and LAST_PHASE_SHORT_SUCCEEDED)))
last_timestamp, last_succeed, last_phase = GetTime(), true, LAST_PHASE_COMPLETE
last_timestamp, last_succeed, last_phase = time(), true, LAST_PHASE_COMPLETE
--QuestHelper:TextOut(string.format("last_phase %d", last_phase))
--[[if last_phase == LAST_PHASE_COMPLETE then
@ -429,10 +429,10 @@ local function LootOpened()
local targetguid = UnitGUID("target")
-- We're cleaning up the monster charts here, on the theory that if someone is looting, they're okay with a tiny lag spike.
if last_cleanup + 300 < GetTime() then
if last_cleanup + 300 < time() then
local cleanup = {}
for k, v in pairs(monstertimeout) do
if v < GetTime() then table.insert(cleanup, k) end
if v < time() then table.insert(cleanup, k) end
end
for _, v in pairs(cleanup) do
@ -458,14 +458,14 @@ local function LootOpened()
spot.loc = loc
prefix = "fish"
elseif pickpocket_phase == PP_PHASE_COMPLETE and pickpocket_timestamp and pickpocket_timestamp + 1 > GetTime() and targetguid == pickpocket_otarget_guid then
elseif pickpocket_phase == PP_PHASE_COMPLETE and pickpocket_timestamp and pickpocket_timestamp + 1 > time() and targetguid == pickpocket_otarget_guid then
--if debug_output then QuestHelper:TextOut(string.format("Pickpocketing from %s/%s", pickpocket_target, UnitName("target"), targetguid)) end
local mid = GetMonsterType(targetguid)
if not QHC.monster[mid] then QHC.monster[mid] = {} end
spot = QHC.monster[mid]
prefix = "rob"
elseif last_phase == LAST_PHASE_COMPLETE and gathereffects[last_spell] and last_timestamp + 1 > GetTime() then
elseif last_phase == LAST_PHASE_COMPLETE and gathereffects[last_spell] and last_timestamp + 1 > time() then
local beef = string.format("%s/%s %s/%s", tostring(last_target), tostring(last_target_guid), tostring(last_otarget), tostring(last_otarget_guid))
if gathereffects[last_spell].ignore then return end
@ -487,14 +487,14 @@ local function LootOpened()
spot = QHC.object[last_target]
end
elseif touched_timestamp and touched_timestamp + 1 > GetTime() then
elseif touched_timestamp and touched_timestamp + 1 > time() then
-- Opening a container, possibly
--if debug_output then QuestHelper:TextOut(string.format("Opening container %d", touched_itemid)) end
if not QHC.item[touched_itemid] then QHC.item[touched_itemid] = {} end
spot = QHC.item[touched_itemid]
prefix = "open"
elseif targetguid and (monsterstate[targetguid] == MS_TAPPED_LOOTABLE or monsterstate[targetguid] == MS_TAPPED_LOOTABLE_TRIVIAL) and monstertimeout[targetguid] > GetTime() and (not pickpocket_timestamp or pickpocket_timestamp + 5 < GetTime()) and (not last_timestamp or last_timestamp + 5 < GetTime()) and (last_succeed_trade + 5 < GetTime()) then -- haha holy shit
elseif targetguid and (monsterstate[targetguid] == MS_TAPPED_LOOTABLE or monsterstate[targetguid] == MS_TAPPED_LOOTABLE_TRIVIAL) and monstertimeout[targetguid] > time() and (not pickpocket_timestamp or pickpocket_timestamp + 5 < time()) and (not last_timestamp or last_timestamp + 5 < time()) and (last_succeed_trade + 5 < time()) then -- haha holy shit
-- Monster is lootable, so we loot the monster. Should we check to see if it's dead first? Probably.
--if debug_output then QuestHelper:TextOut(string.format("%s from %s/%s", (monsterstate[targetguid] == MS_TAPPED_LOOTABLE and "Monsterloot" or "Trivial monsterloot"), UnitName("target"), targetguid)) end
@ -508,8 +508,8 @@ local function LootOpened()
end
monsterstate[targetguid] = MS_TAPPED_LOOTED
monstertimeout[targetguid] = GetTime() + 300
monsterrefresh[targetguid] = GetTime() + 2
monstertimeout[targetguid] = time() + 300
monsterrefresh[targetguid] = time() + 2
else
--if debug_output then QuestHelper:TextOut("Who knows") end -- ugh
local loc = GetLoc()

Voir le fichier

@ -14,7 +14,7 @@ local IsMonsterGUID
local GetMonsterUID
local GetMonsterType
local logon = GetTime() -- Because I'm incredibly paranoid, I'm waiting fifteen minutes after logon to assume they're not drunk.
local logon = time() -- Because I'm incredibly paranoid, I'm waiting fifteen minutes after logon to assume they're not drunk.
local drunk_logon = true
local drunk_message = false
@ -42,7 +42,7 @@ local function AccumulateFrequency(target, name, data)
end
local function MouseoverUnit()
if logon and logon + 60 * 15 < GetTime() then
if logon and logon + 60 * 15 < time() then
logon = nil
drunk_logon = false
end

Voir le fichier

@ -4,7 +4,7 @@ QuestHelper_Loadtime["collect_notifier.lua"] = GetTime()
local NotificationsPending = {}
local function OnUpdate()
while #NotificationsPending > 0 and GetTime() >= NotificationsPending[1].time do
while #NotificationsPending > 0 and time() >= NotificationsPending[1].time do
NotificationsPending[1].func()
table.remove(NotificationsPending, 1) -- okay okay n^2 deal with it
end

Voir le fichier

@ -156,7 +156,7 @@ local function Looted(message)
if type(ltype) ~= "number" then
error(string.format("Expected a number but got a %s.", type(ltype)) .. "The value is:" .. ltype)
end
table.insert(eventy, {time = GetTime(), event = {type = "item", value = ltype}})
table.insert(eventy, {time = time(), event = {type = "item", value = ltype}})
--if debug_output then QuestHelper:TextOut(string.format("Added event %s", string.format("I%di", ltype))) end
end
@ -164,7 +164,7 @@ local function Combat(_, event, _, _, _, _, _, guid)
if event ~= "UNIT_DIED" then return end
if not IsMonsterGUID(guid) then return end
local mtype = GetMonsterType(guid, true)
table.insert(eventy, {time = GetTime(), event = { type = "monster", value = mtype}})
table.insert(eventy, {time = time(), event = { type = "monster", value = mtype}})
--if debug_output then QuestHelper:TextOut(string.format("Added event %s", string.format("M%dm", mtype))) end
end
@ -211,14 +211,14 @@ local abandoncomplete_timestamp = nil
local GetQuestReward_Orig = GetQuestReward
GetQuestReward = function (...)
abandoncomplete = "complete"
abandoncomplete_timestamp = GetTime()
abandoncomplete_timestamp = time()
GetQuestReward_Orig(...)
end
local AbandonQuest_Orig = AbandonQuest
AbandonQuest = function ()
abandoncomplete = "abandon"
abandoncomplete_timestamp = GetTime()
abandoncomplete_timestamp = time()
AbandonQuest_Orig()
end
@ -239,7 +239,7 @@ local function UpdateQuests()
if not changed then return end
changed = false
local tim = GetTime()
local tim = time()
local noobey = ScanQuests()
@ -255,7 +255,7 @@ local function UpdateQuests()
QuestHelper:TextOut(string.format("%d %d", QuestHelper:TableSize(deebey), QuestHelper:TableSize(noobey)))
end]]
while #eventy > 0 and eventy[1].time < GetTime() - 1 do table.remove(eventy, 1) end -- slurp
while #eventy > 0 and eventy[1].time < time() - 1 do table.remove(eventy, 1) end -- slurp
local token
local debugtok
@ -270,7 +270,7 @@ local function UpdateQuests()
elseif not noobey[k] then
-- Quest was dropped or completed
if abandoncomplete == "complete" and abandoncomplete_timestamp + 30 >= GetTime() then
if abandoncomplete == "complete" and abandoncomplete_timestamp + 30 >= time() then
if debug_output then QuestHelper:TextOut(string.format("Completed! Questid %d", k)) end
StartOrEnd("end", k)
abandoncomplete = ""
@ -318,7 +318,7 @@ local function UpdateQuests()
deebey = noobey
--QuestHelper: Assert(diffs <= 5, string.format("excessive quest diffs - delta is %d, went from %d to %d", diffs, dsize, nsize))
--QuestHelper:TextOut(string.format("done in %f", GetTime() - tim))
--QuestHelper:TextOut(string.format("done in %f", time() - tim))
end
local enable_quest_hints = GetBuildInfo():match("0%.1%..*") or (GetBuildInfo():match("3%..*") and not GetBuildInfo():match("3%.0%..*"))

Voir le fichier

@ -83,10 +83,10 @@ end
local function CompressAndComplete(ki)
--QuestHelper:TextOut(string.format("%d tokens", #QHCT.compressing[ki].data))
local tim = GetTime()
local tim = time()
local lzwed = LZW.Compress_Dicts(QHCT.compressing[ki].data, "^<>vCSXMYD")
if debug_output then
QuestHelper:TextOut(string.format("%d tokens: compressed to %d in %f", #QHCT.compressing[ki].data, #lzwed, GetTime() - tim))
QuestHelper:TextOut(string.format("%d tokens: compressed to %d in %f", #QHCT.compressing[ki].data, #lzwed, time() - tim))
end
if not QHCT.done then QHCT.done = {} end
@ -106,7 +106,7 @@ local function CompileData()
if #data > 0 then
if not QHCT.compressing then QHCT.compressing = {} end
local ki = GetTime()
local ki = time()
while QHCT.compressing[ki] do ki = ki + 1 end -- if this ever triggers, I'm shocked
QHCT.compressing[ki] = {data = data, prefix = prefix}

Voir le fichier

@ -41,12 +41,12 @@ local function OnUpdate()
if debug_output then QuestHelper:TextOut("Warpy!") end
end
if last_warp + 10 < GetTime() and leapy then
if last_warp + 10 < time() and leapy then
if debug_output then QuestHelper:TextOut("REAL Warpy!") end
local warpy = { last = lastloc_bolus, current = bolus }
table.insert(QHCW, warpy)
--Merger.Add(QHCW, "(" .. lastloc_bolus .. ")(" .. bolus .. ")")
last_warp = GetTime()
last_warp = time()
end
end

Voir le fichier

@ -37,9 +37,9 @@ end
local lastupdate = 0
local function OnUpdate()
if lastupdate + 15 <= GetTime() then
if lastupdate + 15 <= time() then
DoZoneUpdate("update")
lastupdate = GetTime()
lastupdate = time()
end
end

Voir le fichier

@ -48,14 +48,14 @@ QH_Event("ADDON_LOADED", function (addonid)
end);
function addon:OnInit()
addonTable.Profile_OnInit_Start = GetTime();
addonTable.Profile_OnInit_Start = time();
self:GenerateQHLocales();
self.Locale:SetCurrentLocale(GetLocale());
self.Version = GetAddOnMetadata("QuestHelper", "Version");
self:GenerateOptions();
self:SetupLDB();
self:SetupGUI();
addonTable.Profile_OnInit_Stop = GetTime();
addonTable.Profile_OnInit_Stop = time();
end
function addon:SetupGUI()

Voir le fichier

@ -911,7 +911,7 @@ QH_Event("UNIT_QUEST_LOG_CHANGED", UpdateTrigger)
QH_Event("QUEST_LOG_UPDATE", QH_UpdateQuests)
-- We don't return anything here, but I don't think that's actually an issue - those functions don't return anything anyway. Someday I'll regret writing this. Delay because of beql which is a bitch.
QH_AddNotifier(GetTime() + 5, function ()
QH_AddNotifier(time() + 5, function ()
local aqw_orig = AddQuestWatch
AddQuestWatch = function(...)
aqw_orig(...)
@ -927,9 +927,9 @@ end)
-- We seem to end up out of sync sometimes. Why? I'm not sure. Maybe my current events aren't reliable. So let's just scan every five seconds and see what happens, scanning is fast and efficient anyway.
--[[local function autonotify()
QH_UpdateQuests(true)
QH_AddNotifier(GetTime() + 5, autonotify)
QH_AddNotifier(time() + 5, autonotify)
end
QH_AddNotifier(GetTime() + 30, autonotify)]]
QH_AddNotifier(time() + 30, autonotify)]]
local old_playerlist = {}

Voir le fichier

@ -154,7 +154,7 @@ local filter_quest_raid_accessible = QH_MakeFilter("filter_quest_raid_accessible
end, {friendly_reason = QHText("FILTERED_RAID"), friendly_name = "raidaccessible"})
-- Delay because of beql which is a bitch.
QH_AddNotifier(GetTime() + 5, function ()
QH_AddNotifier(time() + 5, function ()
local aqw_orig = AddQuestWatch -- yoink
AddQuestWatch = function(...)
QH_Route_Filter_Rescan("filter_quest_watched")

Voir le fichier

@ -470,7 +470,7 @@ end
function QuestHelper:flightBegan()
if self.flight_data and not self.flight_data.start_time then
self.flight_data.start_time = GetTime()
self.flight_data.start_time = time()
local src, dest = self.flight_data.src, self.flight_data.dest
@ -511,7 +511,7 @@ end
function QuestHelper:flightEnded(interrupted)
local flight_data = self.flight_data
if flight_data and not flight_data.end_time then
flight_data.end_time = GetTime()
flight_data.end_time = time()
self:UnsetTargetLocation()
self:StopCustomSearch()

Voir le fichier

@ -19,7 +19,7 @@ local QH_Timeslice_Yield = QH_Timeslice_Yield
local tinsert, tremove = table.insert, table.remove
local pairs, ipairs = pairs, ipairs
local sqrt = math.sqrt
local GetTime = GetTime
local GetTime = time
local function heap_left(x) return (2*x) end
local function heap_right(x) return (2*x + 1) end

Voir le fichier

@ -201,7 +201,7 @@ QH_Event("ADDON_LOADED", function (addonid)
local self = QuestHelper -- whee hack hack hack
QuestHelper_Loadtime["init2_start"] = GetTime()
QuestHelper_Loadtime["init2_start"] = time()
local file_problem_version = false
@ -410,7 +410,7 @@ QH_Event("ADDON_LOADED", function (addonid)
QH_Timeslice_Add(function ()
QuestHelper_Loadtime["init3_start"] = GetTime()
QuestHelper_Loadtime["init3_start"] = time()
QuestHelper.loading_main = QuestHelper.CreateLoadingCounter()
@ -611,7 +611,7 @@ QH_Event("ADDON_LOADED", function (addonid)
QH_Event("CHAT_MSG_CHANNEL_NOTICE", function()
if please_submit_enabled and not please_submit_initted then
please_submit_enabled = QHNagInit()
startup_time = GetTime()
startup_time = time()
please_submit_initted = true
end
end)
@ -624,10 +624,10 @@ QH_Event("ADDON_LOADED", function (addonid)
QuestHelper.loading_init3:SetPercentage(1.0) -- victory
QuestHelper_Loadtime["init3_end"] = GetTime()
QuestHelper_Loadtime["init3_end"] = time()
end, "preinit")
QuestHelper_Loadtime["init2_end"] = GetTime()
QuestHelper_Loadtime["init2_end"] = time()
end)
@ -880,7 +880,7 @@ function QuestHelper:OnEvent(event)
QH_Route_Filter_Rescan()
end
QH_Timeslice_Increment(GetTime() - tstart, "event")
QH_Timeslice_Increment(time() - tstart, "event")
end]==]
local map_shown_decay = 0
@ -914,7 +914,7 @@ Thanks for testing!]], "QuestHelper " .. version_string, 500, 20, 10)
end
--if frams == 5000 then please_submit_enabled = false end -- TOOK TOO LONG >:(
if please_submit_enabled and startup_time and startup_time + 10 < GetTime() then
if please_submit_enabled and startup_time and startup_time + 10 < time() then
QuestHelper:TextOut(QHText("PLEASE_SUBMIT"))
startup_time = nil
please_submit_enabled = false

Voir le fichier

@ -42,7 +42,7 @@ local function notify()
end
local poll_again = true
local poll_timeout = GetTime() + 30
local poll_timeout = time() + 30
local poll_first = true
QH_Event("QUEST_QUERY_COMPLETE", function ()
@ -58,7 +58,7 @@ GetQuestReward = function (...)
end
QH_OnUpdate(function()
if poll_again and poll_timeout < GetTime() then
if poll_again and poll_timeout < time() then
QueryQuestsCompleted()
--print("QQC")
poll_again = false

Voir le fichier

@ -42,26 +42,26 @@ local function wraptime(ident, func, ...)
SO MUCH PRETTIER! AND EASIER TO READ TO BOOT!
--]]
QH_Hook_NotMyFault = function(func, ...)
local zst = GetTime()
local zst = time()
local ret = {func(...)}
qhh_adj = qhh_adj + (GetTime() - zst)
qhh_adj = qhh_adj + (time() - zst)
return unpack(ret)
--print("a", GetTime())
--[[
return (function(...)
--print("c", GetTime(), GetTime() - zst, qhh_adj)
qhh_adj = qhh_adj + (GetTime() - zst)
qhh_adj = qhh_adj + (time() - zst)
--print(qhh_adj)
return ...
end)(func(...))
--]]
end
st = GetTime()
st = time()
end
func(...)
if qh_loud_and_annoying then
if GetTime() - st - qhh_adj > 0.0025 then
QuestHelper: TextOut(string.format("Took way too long, %4f, at %s (adjusted by %4f)", (GetTime() - st - qhh_adj) * 1000, ident, qhh_adj * 1000))
if time() - st - qhh_adj > 1 then --0.0025 then
QuestHelper: TextOut(string.format("Took way too long, %4f, at %s (adjusted by %4f)", (time() - st - qhh_adj) * 1000, ident, qhh_adj * 1000))
end
QH_Hook_NotMyFault = qhh_nmf
end
@ -75,7 +75,7 @@ local function OnEvent(_, event, ...)
for _, v in pairs(EventRegistrar[event]) do
wraptime(v.id, v.func, ...)
end
time_used = time_used + (GetTime() - tstart)
time_used = time_used + (time() - tstart)
end
end
@ -99,7 +99,7 @@ function QH_Event(event, func, identifier)
end
end
local tls = GetTime()
local tls = time()
-- I'm just putting this here so I can stop rewriting it
@ -109,7 +109,7 @@ Try "/script qh_hackery_no_work = true". See if that fixes things.
Whether it does or not, log out, log back in, then do "/qh hackery_event_timing = true". Wait a few seconds, then take a screenshot. Post that here.
]]
local last_frame = GetTime()
local last_frame = time()
local time_per_frame = 0.01 -- Assume 100fps so we don't fuck with people's framerate
local OnUpdate = {}
@ -128,10 +128,10 @@ local function OnUpdateTrigger(_, ...)
for _, v in pairs(OnUpdate) do
if v.func then wraptime(v.id, v.func, ...) end
end
time_used = time_used + (GetTime() - tstart)
time_used = time_used + (time() - tstart)
end
local tframe = GetTime()
local tframe = time()
local tplf = tframe - last_frame
tplf = math.min(time_per_frame + 0.1, tplf)
local tplf_weight = tplf * 20
@ -140,15 +140,15 @@ local function OnUpdateTrigger(_, ...)
QuestHelper: Assert(time_per_frame > 0 and time_per_frame < 10000) -- hmmm
local verbose = false
if qh_hackery_event_timing and tls < GetTime() - 1 then
tls = GetTime()
if qh_hackery_event_timing and tls < time() - 1 then
tls = time()
print(string.format("Avg TPF %f, current TPLF %f, time_used %f, this adjustment %f, bonus time %f", time_per_frame, tplf, time_used, time_per_frame - tplf - time_used, math.min(time_per_frame - tplf, (time_per_frame - tplf) * 0.8, 0.05)))
verbose = true
end
if not qh_hackery_no_work then
QH_Timeslice_Work(time_used, time_per_frame, math.min(time_per_frame - tplf, (time_per_frame - tplf) * 0.8, 0.05), verbose)
end
last_frame = GetTime()
last_frame = time()
next_started = false
end

Voir le fichier

@ -1,7 +1,7 @@
QuestHelper_File["radar.lua"] = "4.0.1.$svnversion$"
QuestHelper_Loadtime["radar.lua"] = GetTime()
local tick = GetTime()
local tick = time()
local anchor = nil
@ -33,10 +33,10 @@ QH_OnUpdate(function()
if not rc then rc = LibStub("LibRangeCheck-2.0") end
if tick <= GetTime() then
if tick <= time() then
tick = tick + 1
if tick < GetTime() then
tick = GetTime()
if tick < time() then
tick = time()
end
local targ = UnitGUID("target")

Voir le fichier

@ -827,7 +827,7 @@ function Routing:RouteUpdateRoutine()
local best_route = self.best_route
local last_cache_clear = GetTime()
local last_cache_clear = time()
------ EVIL HACK OF DEBUG
@ -835,9 +835,9 @@ function Routing:RouteUpdateRoutine()
while true do
-- Clear caches out a bit
if GetTime() + 15 >= last_cache_clear then
if time() + 15 >= last_cache_clear then
qh:CacheCleanup()
last_cache_clear = GetTime()
last_cache_clear = time()
end
-- Update the player's position data.

Voir le fichier

@ -433,7 +433,7 @@ Route_Core_Init(
local StartObjective = {desc = "Start", tracker_hidden = true} -- this should never be displayed
local lapa = GetTime()
local lapa = time()
local passcount = 0
local lc, lx, ly, lrc, lrz
@ -455,8 +455,8 @@ local function process()
local first = true
-- Order here is important. We don't want to update the location, then wait for a while as we add nodes. We also need the location updated before the first nodes are added. This way, it all works and we don't need anything outside the loop.
while true do
if last_cull + 120 < GetTime() then
last_cull = GetTime()
if last_cull + 120 < time() then
last_cull = time()
for k, v in pairs(pathcache_inactive) do
ReleaseShard(k, v)
@ -467,7 +467,7 @@ local function process()
pathcache_active = new_pathcache_table()
end
if last_movement + 1 < GetTime() then
if last_movement + 1 < time() then
local c, x, y, rc, rz = QuestHelper.routing_ac, QuestHelper.routing_ax, QuestHelper.routing_ay, QuestHelper.routing_c, QuestHelper.routing_z -- ugh we need a better solution to this, but with this weird "planes" hybrid there just isn't one right now
if c and x and y and rc and rz and (c ~= lc or x ~= lx or y ~= ly or rc ~= lrc or rz ~= lrz) then
--local t = GetTime()
@ -490,7 +490,7 @@ local function process()
last_playerpos = new_playerpos
last_movement = GetTime()
last_movement = time()
end
end
@ -507,7 +507,7 @@ local function process()
first = false
passcount = passcount + 1
if lapa + 60 < GetTime() then
if lapa + 60 < time() then
if debug_output then QuestHelper:TextOut(string.format("%d passes in the last minute, %d nodes", passcount, Route_Core_NodeCount())) end
lapa = lapa + 60
passcount = 0

Voir le fichier

@ -54,7 +54,7 @@ function QuestHelper:TeleportInfoUseNode(info, node, time_delta)
if data then
self:TextOut("Used "..(node.name or "unnamed node").." in path.")
data[1] = GetTime()+time_delta
data[1] = time()+time_delta
if data[3] then
local count = info.reag[data[3]] or 0
count = count - 1
@ -97,7 +97,7 @@ end
function QuestHelper:TeleportInfoAddGraphPoints(info, graph, end_list, time_delta)
for node, data in pairs(info.node) do
if data[1]+data[2] >= time_delta+GetTime() and (not data[4] or (data[4] and info.reag[data[4]])) then
if data[1]+data[2] >= time_delta+time() and (not data[4] or (data[4] and info.reag[data[4]])) then
self:TextOut("Considering "..(node.name or "unnamed node").." for use in pathing.")
graph:AddStartNode(node, data[3], end_list)
end

Voir le fichier

@ -13,7 +13,7 @@ local coroutine_route_pass = 1
local coroutine_verbose = false
local coroutine_time_used = {}
local coroutine_power_up = GetTime()
local coroutine_power_up = time()
local coroutine_time_exceeded = 0
@ -26,12 +26,12 @@ function QH_Timeslice_DumpPerf()
for _, v in pairs(sortable) do
QuestHelper:TextOut(string.format("%s: %f", QuestHelper:HighlightText(v.name), v.amount))
end
QuestHelper:TextOut(string.format("%s: %f", QuestHelper:HighlightText("poweron"), GetTime() - coroutine_power_up))
QuestHelper:TextOut(string.format("%s: %f", QuestHelper:HighlightText("poweron"), time() - coroutine_power_up))
end
local last_stack = nil
local yield_ct = 0
local GetTime = GetTime
local GetTime = time
local unyieldable = 0
function QH_Timeslice_PushUnyieldable()
unyieldable = unyieldable + 1
@ -49,7 +49,7 @@ function QH_Timeslice_Yield()
yield_ct = yield_ct + 1
if GetTime() > coroutine_stop_time then
local sti = debugstack(2, 5, 5) -- string.gsub(debugstack(2, 1, 1), "\n.*", "")
if qh_loud_and_annoying and GetTime() > coroutine_stop_time + 0.0015 then
if qh_loud_and_annoying and GetTime() > coroutine_stop_time + 1 then --0.0015 then
print(yield_ct, (GetTime() - coroutine_stop_time) * 1000, "took too long", sti, "------ from", last_stack, "------")
end

Voir le fichier

@ -363,7 +363,7 @@ end
local unit_to_adjust = nil
-- SmoothQuest and possibly others
QH_AddNotifier(GetTime() + 5, function ()
QH_AddNotifier(time() + 5, function ()
local ottsu = GameTooltip:GetScript("OnTooltipSetUnit")
QH_Hook(GameTooltip, "OnTooltipSetUnit", function (self, ...)
if qh_tooltip_print_a_lot then print("lol") end

Voir le fichier

@ -506,13 +506,13 @@ function QH_Tracker_Rescan()
end
if not QuestHelper.loading_main and not QuestHelper.flightpathing and QuestHelper.route_change_progress then
if recalculating_start then
if recalculating_start + 5 < GetTime() then
if recalculating_start + 5 < time() then
recalculating_vquest.tracker_desc = QHFormat("QH_RECALCULATING", string.format("%d", QuestHelper.route_change_progress:GetPercentage() * 100))
local x, ty = addItem(recalculating_vquest, y)
y = ty + 10
end
else
recalculating_start = GetTime()
recalculating_start = time()
end
else
recalculating_start = nil

Voir le fichier

@ -57,8 +57,8 @@ end
function QuestHelper:CreateUID(length)
local result = ""
local characters = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
for k = 1, (math.floor(GetTime() % 1000) + 5) do math.random() end -- it's sort of like seeding. only worse.
local base = GetUnitName("player")..":"..GetRealmName()..":"..math.random(0, 2147483647)..":"..GetTime()..":"..time()
for k = 1, (math.floor(time() % 1000) + 5) do math.random() end -- it's sort of like seeding. only worse.
local base = GetUnitName("player")..":"..GetRealmName()..":"..math.random(0, 2147483647)..":"..time()..":"..time()
for c = 1,(length or 32) do
local pos = 1+math.floor(self:HashString(result..base..math.random(0, 2147483647))%string.len(characters))
@ -177,7 +177,7 @@ function QuestHelper:CountItem(item_id)
end
function QuestHelper:ItemCooldown(item_id)
local now = GetTime()
local now = time()
local cooldown = nil
for bag = 0,NUM_BAG_SLOTS do