tracking "shortest" for research soon to complete.
His Dad [12-20-14 - 05:18]
tracking "shortest" for research soon to complete.
diff --git a/lua/CORE.lua b/lua/CORE.lua
index e0e676d..77bb9f0 100644
--- a/lua/CORE.lua
+++ b/lua/CORE.lua
@@ -2,7 +2,8 @@
-- v0.4.11
-function CRT_Collect_Data(playername)
+function CRT_Collect_Data(playername)
+ CRT.SV.Craft_data[playername].shortest = 99999999 -- for this player find next due.
CRT_Info_Research(CRAFTING_TYPE_BLACKSMITHING, 0, playername)
CRT_Info_Research(CRAFTING_TYPE_CLOTHIER, 1, playername)
CRT_Info_Research(CRAFTING_TYPE_WOODWORKING, 2, playername)
@@ -15,7 +16,7 @@ function CRT_Info_Research(craft_type,id_craft,playername)
local nbtype = GetNumSmithingResearchLines(craft_type) --Nombre de item craftable pour un craft(ex couture: jambe/robe/ect)
CRT.SV.Craft_data[playername][id_craft] = {}
- CRT.SV.Craft_data[playername].shortest = GetTimeStamp() + 99999999 -- for this player find next due.
+
for ResearchLines = 1, nbtype, 1 do
local item_name, item_icon, numTraits, timeRequiredForNextResearchSecs = GetSmithingResearchLineInfo(craft_type, ResearchLines)
@@ -42,8 +43,8 @@ function CRT_Info_Research(craft_type,id_craft,playername)
CRT.SV.Craft_data[playername][id_craft][Simu_craft]["Trait_icon"] = trait_icon
CRT.SV.Craft_data[playername][id_craft][Simu_craft]["Trait_description"] = trait_description
- if CRT.SV.Craft_data[playername].shortest > CRT.SV.Craft_data[playername][id_craft][Simu_craft]["EndTimeStamp"]
- then CRT.SV.Craft_data[playername].shortest = CRT.SV.Craft_data[playername][id_craft][Simu_craft]["EndTimeStamp"]
+ if CRT.SV.Craft_data[playername].shortest > timeRemaining
+ then CRT.SV.Craft_data[playername].shortest = timeRemaining
end
-- d("Type de craft :"..id_craft.." nom de l'item :"..name.." temps restant :"..temp_timer[Simu_craft])
end
diff --git a/lua/CraftResearchTimer.lua b/lua/CraftResearchTimer.lua
index 4201840..a169258 100644
--- a/lua/CraftResearchTimer.lua
+++ b/lua/CraftResearchTimer.lua
@@ -9,6 +9,7 @@ CRT = {
svName = "CraftResearchTimer_SavedVariables",
svVersion = 0.4,
version = "v0.4.11",
+ playername = "",
font = "ZoFontGame",
interval = 20,
width = 100,
@@ -115,7 +116,8 @@ function CRT_Init(eventCode, addOnName)
if(addOnName == CRT.name) then
CRT.Init_done = false
-
+ CRT.playername = GetUnitName("player")
+
-- SavedVariables
CRT.SV.Settings = ZO_SavedVars:New(CRT.svName, CRT.svVersion*100, nil, CRT.svDefaults, nil)
CRT.SV.Craft_data = ZO_SavedVars:NewAccountWide(CRT.svName, 1, "Craft_data", nil , nil )
@@ -609,6 +611,8 @@ function CRT_CommandText_setup(lparam)
d("Craft Research Timer (CRT) by @aTo (EU)")
d("Version " .. CRT.version)
d("The CRT have moved to the normal game settings")
+ d("Player: " .. CRT.playername)
+ d("Shortest: " .. CRT_Converthms(CRT.SV.Craft_data[CRT.playername].shortest))
elseif (lparam == "grid") then
CRT_toggleGRID()
else