All pastes #30454 Raw Edit

Untitled

public lua v1 · immutable
#30454 ·published 2005-11-23 01:56 UTC
rendered paste body
function Historian_save_shot()	snap = {}		--Extract the list of buyouts for every item	auct_key = Auctioneer_GetAuctionKey()	for cat in pairs(AuctionConfig.snap[auct_key]) do		for auction, snapdata in pairs(AuctionConfig.snap[auct_key][cat]) do			id,rprop,enchant,name,count,min,buyout,uniq = Auctioneer_GetItemSignature(auction)			snapshot = Auctioneer_GetSnapshotFromData(snapdata)						if (snapshot.lastSeenTime == snapshot.initialSeenTime) then				if (not snap[name]) then snap[name] = {} end							table.insert(snap[name], buyout/count)			end		end	end		--Get the median of each list and store it in the database	for item in pairs(snap) do		if (not HISTORIAN[item]) then HISTORIAN[item] = {} end		HISTORIAN[item][date("%m/%d/%y/%H/%M")] = Auctioneer_GetMedian(snap[item])	end		Historian_chat_print("Historian: Snapshot archived")end