Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function events:LOOT_OPENED(...)
- if addonEnabled() then
- local loot = {} -- create a temporary table to organize the loot on the mob
- for i=1,GetNumLootItems() do -- loop through all items in the window
- local sourceInfo = {GetLootSourceInfo(i)}
- for j=1,#sourceInfo/2 do
- local mobID = sourceInfo[j*2-1] -- retrieve GUID of the mob that holds the item
- for k=1,#hasBeenLooted do
- if hasBeenLooted[i] == mobID then
- mobID = nil
- break
- end
- end
- if mobID then
- if debugOn then
- DevTools_Dump(loot)
- DevTools_Dump(#loot)
- end
- local id
- for k=1,#loot do
- if loot[i][1] == mobID then -- line 1388
- id = i
- break
- end
- end
- if not id then
- table.insert(loot, {mobID}) -- create an entry in table for the mobID
- id = #loot
- end
- local link = GetLootSlotLink(i) -- retrieve link of item
- if link and checkFilters(link) then
- for l=1,sourceInfo[j*2] do -- repeat the insert if there is multiple of the item in that slot
- table.insert(loot[id], link)
- end
- end
- end
- end
- end
- for i=1,#loot do
- FARaidTools:sendMessage("FA_RTreport", {addonVersion, loot[i]}, "RAID", nil, "BULK") -- send addon message to tell others to add this to their window
- local data = loot[i]
- local mobID = table.remove(data, 1)
- for j=1, #data do
- if checkFilters(data[j]) then
- FARaidTools:cacheItem(data[j])
- end
- end
- table.insert(hasBeenLooted, mobID)
- end
- end
- end
- -- Example DevTools_Dump() output
- [10:59:18 PM] [1]={
- [10:59:18 PM] [1]="0xF150F604000088E0",
- [10:59:18 PM] [2]="|cffa335ee|Hitem:86203:0:0:0:0:0:0:12:1295524864:90:0:445|h[Articulated Legplates]|h|r"
- [10:59:18 PM] } -- DevTools_Dump(loot)
- [10:59:18 PM] 1 -- DevTools_Dump(#loot)
- -- Error
- Message: Interface\AddOns\FARaidTools\main.lua:1388: attempt to index field '?' (a nil value)
- Time: 01/23/13 00:02:21
- Count: 2
- Stack: [string "*:OnLoad"]:6: in function <[string "*:OnLoad"]:1>
- Interface\AddOns\Auctionator\AtrErrorInspector.lua:106: in function <Interface\AddOns\Auctionator\AtrErrorInspector.lua:51>
- [C]: ?
- Interface\AddOns\FARaidTools\main.lua:1388: in function `?'
- Interface\AddOns\FARaidTools\main.lua:1450: in function <Interface\AddOns\FARaidTools\main.lua:1449>
- Locals: msg = nil
- self = <unnamed> {
- 0 = <userdata>
- origErrorHandler = <function> defined Interface\FrameXML\BasicControls.xml:<Scripts>:4
- errorHandler = <function> defined @Interface\AddOns\TradeSkillMaster\Util\ErrorHandler.lua:215
- handler = <function> defined *:OnLoad:1
- }
Advertisement
Add Comment
Please, Sign In to add comment