Started "flattening" the collection, which will ultimately make it easier to import into a database. WOOHOO!
Basically, all lua tables will have keys that are equal to their DB table names and their data will have a key that contains the row data in a tab delimited format. Note: This is still a work in progress and some things need to be revisited... i.e. collect_merchant.lua, since we want to extract the currency id from the currency link... no documentation is thus far found for what the type part of a currency link is, so we're going to collect a little data and see.
Cette révision appartient à :
Parent
d3e9acc290
révision
b50a530943
|
@ -99,11 +99,13 @@ function QH_Collector_SetupData()
|
|||
end
|
||||
local realm = GetRealmName()
|
||||
|
||||
local sessiontime = time()
|
||||
|
||||
if not QuestHelper_Collector.created then
|
||||
QuestHelper_Collector.created = time();
|
||||
QuestHelper_Collector.created = sessiontime;
|
||||
end
|
||||
|
||||
local session = string.format("%q\t%q\t%q\t%q\t%q", svnversion, realm, buildInfo, locale, altfaction)
|
||||
local session = string.format("%s\t%s\t%s\t%s\t%s", svnversion, realm, buildInfo, locale, altfaction)
|
||||
|
||||
if not QuestHelper_Collector.sessions then QuestHelper_Collector.sessions = {} end
|
||||
|
||||
|
|
|
@ -23,9 +23,10 @@ local function AddChatType(typ)
|
|||
|
||||
target = GetMonsterType(target)
|
||||
|
||||
if not QHCM[target] then QHCM[target] = {} end
|
||||
QHCM[target]["chat_" .. typ] = (QHCM[target]["chat_" .. typ] or 0) + 1
|
||||
return QHCM[target]
|
||||
local ret = {}
|
||||
ret.base_info = string.format("%d\t%s", target, typ)
|
||||
table.insert(QHCM, ret)
|
||||
return ret
|
||||
end
|
||||
|
||||
local function MerchantShow()
|
||||
|
@ -42,18 +43,28 @@ local function MerchantShow()
|
|||
local itemid = GetMerchantItemLink(i)
|
||||
QuestHelper: Assert(itemid)
|
||||
itemid = GetItemType(itemid)
|
||||
local _, _, price, quant, avail, _, _ = GetMerchantItemInfo(i)
|
||||
local dstr = {}
|
||||
dstr.quant = quant
|
||||
dstr.avail = avail
|
||||
dstr.price = price
|
||||
local _, _, price, quant, avail, _, ext_cost = GetMerchantItemInfo(i)
|
||||
local shop_item = {}
|
||||
shop_item.base_info = string.format("%d\t%d\t%d\t%d", itemid, quant, avail, price)
|
||||
|
||||
if ext_cost then
|
||||
ext_costs = {}
|
||||
for curr = 1, GetMerchantItemCostInfo(i) do
|
||||
local tex, val, link, name = GetMerchantItemCostItem(i, curr)
|
||||
local ext_cost_detail = {}
|
||||
ext_cost_detail.base_info = string.format("%s\t%d", name, val)
|
||||
ext_cost_detail.link = link
|
||||
ext_cost_detail.texture = tex
|
||||
table.insert(ext_costs, ext_cost_detail)
|
||||
end
|
||||
|
||||
shop_item.ext_costs = ext_costs
|
||||
end
|
||||
|
||||
--if debug_output then QuestHelper:TextOut(dstr) end
|
||||
if not targ.shop then targ.shop = {} end
|
||||
if not targ.shop[itemid] then
|
||||
targ.shop[itemid] = dstr
|
||||
end
|
||||
|
||||
targ.shop[itemid].count = (targ.shop[itemid].count or 0) + 1
|
||||
table.insert(targ.shop, shop_item)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -67,8 +78,8 @@ end
|
|||
|
||||
|
||||
function QH_Collect_Merchant_Init(QHCData, API)
|
||||
if not QHCData.monster then QHCData.monster = {} end
|
||||
QHCM = QHCData.monster
|
||||
if not QHCData.merchant then QHCData.merchant = {} end
|
||||
QHCM = QHCData.merchant
|
||||
|
||||
QH_Event("MERCHANT_SHOW", MerchantShow)
|
||||
QH_Event("GOSSIP_SHOW", GossipShow)
|
||||
|
|
|
@ -65,13 +65,21 @@ local function MouseoverUnit()
|
|||
-- register the critter here
|
||||
local cid = GetMonsterType(guid)
|
||||
|
||||
if not QHCM[cid] then QHCM[cid] = {} end
|
||||
local critter = QHCM[cid]
|
||||
--if not QHCM[cid] then QHCM[cid] = {} end
|
||||
--local critter = QHCM[cid]
|
||||
local critter = {}
|
||||
critter.id = cid
|
||||
|
||||
if cid < 30621 or cid > 30625 then
|
||||
--AccumulateFrequency(critter, "name", UnitName("mouseover")) -- The exceptions are for Herald Volasj's minions, which are named after your partymembers.
|
||||
critter.name = UnitName("mouseover")
|
||||
end
|
||||
--AccumulateFrequency(critter, "reaction", UnitReaction("mouseover", "player"))
|
||||
critter.reaction = UnitReaction("mouseover", "player")
|
||||
|
||||
if cid < 30621 or cid > 30625 then AccumulateFrequency(critter, "name", UnitName("mouseover")) end -- The exceptions are for Herald Volasj's minions, which are named after your partymembers.
|
||||
AccumulateFrequency(critter, "reaction", UnitReaction("mouseover", "player"))
|
||||
if not drunk_logon and not drunk_message then
|
||||
AccumulateFrequency(critter, "level", UnitLevel("mouseover"))
|
||||
--AccumulateFrequency(critter, "level", UnitLevel("mouseover"))
|
||||
critter.level = UnitLevel("mouseover")
|
||||
end
|
||||
|
||||
local minrange = InteractDistances[1]
|
||||
|
@ -85,12 +93,18 @@ local function MouseoverUnit()
|
|||
end
|
||||
end
|
||||
QuestHelper: Assert(minrange >= 0 and minrange < 256 and maxrange >= 0 and maxrange < 256)
|
||||
critter.loc = GetLoc()
|
||||
critter.minrange = minrange
|
||||
critter.maxrange = maxrange
|
||||
table.insert(QHCM, critter)
|
||||
--[[
|
||||
local data = {}
|
||||
data.loc = GetLoc()
|
||||
data.minrange = minrange
|
||||
data.maxrange = maxrange
|
||||
if not critter.encounters then critter.encounters = {} end
|
||||
table.insert(critter.encounters, data)
|
||||
]]
|
||||
--Merger.Add(critter, string.format("(%s %s %s),", GetLoc(), tostring(minrange), tostring(maxrange))) --strchar(minrange, maxrange))
|
||||
|
||||
if #recentlySeenCritters_Recent >= 100 then
|
||||
|
|
Référencer dans un nouveau ticket