comparison ProspectMe.lua @ 32:fc13da07d8e4 Prospect Me 2

Cleaned up some code, added comments, refined ProspectMe:AddEntry()
author Vynn <mischivin@gmail.com>
date Tue, 08 Nov 2016 02:36:30 -0500
parents c11461d5095c
children 31cf11210635
comparison
equal deleted inserted replaced
31:c11461d5095c 32:fc13da07d8e4
1 --Check for Saved Variables, if they don't exist, set defaults. 1 --[[
2 Check for Saved Variables, if they don't exist, set defaults.
3 ]]
2 if not ProspectMe then 4 if not ProspectMe then
3 ProspectMe = { 5 ProspectMe = {
4 Config = { 6 Config = {
5 ShowQualities = { 7 ShowQualities = {
6 junk = false 8 junk = false
15 } 17 }
16 18
17 } 19 }
18 end 20 end
19 21
20 function ProspectMe:Debug(object) { 22 --[[
21 Dump(self) 23 Creates an table entry, if it does not exist, and adds results to the entry.
22 if object then 24 Expects the Item ID and pairs of arguments in table with key being the results ItemID and value being the quantity returned
23 Dump(object) 25 ]]
24 end 26 local function ProspectMe:AddEntry (ItemID, ...)
25 } 27 if not ProspectMe[ItemID] then
26 28 ProspectMe[ItemID] = {}
27 29 end
30 for k, v in pairs arg do
31 if not ProspectMe[ItemID][k] then
32 ProspectMe[ItemID][k] = v
33 else
34 ProspectMe[ItemID][k] = ProspectMe[ItemID][k] = v
35 end
36 end
37 return true
38 end
28 39
29 40
30 local PROSPECT_ID = 31252 41 local PROSPECT_ID = 31252
31 local MILLING_ID = 51005 42 local MILLING_ID = 51005
32 local MASS_PROSPECT_FELSLATE_ID = 225902 43 local MASS_PROSPECT_FELSLATE_ID = 225902