Code format

This commit is contained in:
2025-05-01 17:06:20 +02:00
parent c365178b99
commit 3d8fa46711
7 changed files with 642 additions and 490 deletions

View File

@@ -19,17 +19,29 @@ local skills = {}
---@field value number
local NumberValue = {
---@param other number
Gt = function(self, other) return self.value > other end,
Gt = function(self, other)
return self.value > other
end,
---@param other number
Lt = function(self, other) return self.value < other end,
Lt = function(self, other)
return self.value < other
end,
---@param other number
Eq = function(self, other) return self.value == other end,
Eq = function(self, other)
return self.value == other
end,
---@param other number
Ne = function(self, other) return self.value ~= other end,
Ne = function(self, other)
return self.value ~= other
end,
---@param other number
Ge = function(self, other) return self.value >= other end,
Ge = function(self, other)
return self.value >= other
end,
---@param other number
Le = function(self, other) return self.value <= other end,
Le = function(self, other)
return self.value <= other
end,
}
local function NewNumberValue(value)
local ret = { value = value }
@@ -47,21 +59,37 @@ end
---@field value string
local StringValue = {
---@param other string
Gt = function(self, other) return self.value > other end,
Gt = function(self, other)
return self.value > other
end,
---@param other string
Lt = function(self, other) return self.value < other end,
Lt = function(self, other)
return self.value < other
end,
---@param other string
Eq = function(self, other) return self.value == other end,
Eq = function(self, other)
return self.value == other
end,
---@param other string
Ne = function(self, other) return self.value ~= other end,
Ne = function(self, other)
return self.value ~= other
end,
---@param other string
Ge = function(self, other) return self.value >= other end,
Ge = function(self, other)
return self.value >= other
end,
---@param other string
Le = function(self, other) return self.value <= other end,
Le = function(self, other)
return self.value <= other
end,
---@param other string
Matches = function(self, other) return string.match(self.value, other) end,
Matches = function(self, other)
return string.match(self.value, other)
end,
---@param other string
Contains = function(self, other) return string.find(self.value, other) end,
Contains = function(self, other)
return string.find(self.value, other)
end,
}
local function NewStringValue(value)
local ret = { value = value }
@@ -98,9 +126,13 @@ function shared.Autoloot.Init()
---@return StringValue, string?
local function Link(slot)
local ret = NewStringValue("")
if slot == nil then return ret, "slot is nil" end
if slot == nil then
return ret, "slot is nil"
end
local link = GetLootSlotLink(slot)
if link == nil then return ret, "link is nil" end
if link == nil then
return ret, "link is nil"
end
ret.value = link
return ret, nil
end
@@ -109,9 +141,13 @@ function shared.Autoloot.Init()
---@return StringValue, string?
local function Name(slot)
local ret = NewStringValue("")
if slot == nil then return ret, "slot is nil" end
if slot == nil then
return ret, "slot is nil"
end
local name = select(2, GetLootSlotInfo(slot))
if name == nil then return ret, "name is nil" end
if name == nil then
return ret, "name is nil"
end
ret.value = name
return ret, nil
end
@@ -120,9 +156,13 @@ function shared.Autoloot.Init()
---@return StringValue, string?
local function Type(slot)
local ret = NewStringValue("")
if slot == nil then return ret, "slot is nil" end
if slot == nil then
return ret, "slot is nil"
end
local type = select(6, GetItemInfo(Link(slot).value))
if type == nil then return ret, "type is nil" end
if type == nil then
return ret, "type is nil"
end
ret.value = type
return ret, nil
end
@@ -131,9 +171,13 @@ function shared.Autoloot.Init()
---@return StringValue, string?
local function SubType(slot)
local ret = NewStringValue("")
if slot == nil then return ret, "slot is nil" end
if slot == nil then
return ret, "slot is nil"
end
local subType = select(7, GetItemInfo(Link(slot).value))
if subType == nil then return ret, "subType is nil" end
if subType == nil then
return ret, "subType is nil"
end
ret.value = subType
return ret, nil
end
@@ -142,9 +186,13 @@ function shared.Autoloot.Init()
---@return NumberValue, string?
local function ItemLevel(slot)
local ret = NewNumberValue(0)
if slot == nil then return ret, "slot is nil" end
if slot == nil then
return ret, "slot is nil"
end
local itemLevel = select(4, GetItemInfo(Link(slot).value))
if itemLevel == nil then return ret, "itemLevel is nil" end
if itemLevel == nil then
return ret, "itemLevel is nil"
end
ret.value = itemLevel
return ret, nil
end
@@ -153,9 +201,13 @@ function shared.Autoloot.Init()
---@return NumberValue, string?
local function Value(slot)
local ret = NewNumberValue(0)
if slot == nil then return ret, "slot is nil" end
if slot == nil then
return ret, "slot is nil"
end
local itemValue = select(11, GetItemInfo(Link(slot).value))
if itemValue == nil then return ret, "itemValue is nil" end
if itemValue == nil then
return ret, "itemValue is nil"
end
ret.value = itemValue
return ret, nil
end
@@ -164,9 +216,13 @@ function shared.Autoloot.Init()
---@return NumberValue, string?
local function SubclassId(slot)
local ret = NewNumberValue(0)
if slot == nil then return ret, "slot is nil" end
if slot == nil then
return ret, "slot is nil"
end
local subclassId = select(13, GetItemInfo(Link(slot).value))
if subclassId == nil then return ret, "subclassId is nil" end
if subclassId == nil then
return ret, "subclassId is nil"
end
ret.value = subclassId
return ret, nil
end
@@ -175,9 +231,13 @@ function shared.Autoloot.Init()
---@return NumberValue, string?
local function Quantity(slot)
local ret = NewNumberValue(1)
if slot == nil then return ret, "slot is nil" end
if slot == nil then
return ret, "slot is nil"
end
local quantity = select(3, GetLootSlotInfo(slot))
if quantity == nil then return ret, "quantity is nil" end
if quantity == nil then
return ret, "quantity is nil"
end
ret.value = quantity
return ret, nil
end
@@ -186,9 +246,13 @@ function shared.Autoloot.Init()
---@return StringValue, string?
local function EquipLocation(slot)
local ret = NewNumberValue(0)
if slot == nil then return ret, "slot is nil" end
if slot == nil then
return ret, "slot is nil"
end
local equipLocation = select(9, GetItemInfo(Link(slot).value))
if equipLocation == nil then return ret, "equipLocation is nil" end
if equipLocation == nil then
return ret, "equipLocation is nil"
end
ret.value = equipLocation
return ret, nil
end
@@ -197,9 +261,13 @@ function shared.Autoloot.Init()
---@return StringValue, string?
local function Icon(slot)
local ret = NewStringValue("")
if slot == nil then return ret, "slot is nil" end
if slot == nil then
return ret, "slot is nil"
end
local icon = select(10, GetItemInfo(Link(slot).value))
if icon == nil then return ret, "icon is nil" end
if icon == nil then
return ret, "icon is nil"
end
ret.value = icon
return ret, nil
end
@@ -208,9 +276,13 @@ function shared.Autoloot.Init()
---@return NumberValue, string?
local function BindType(slot)
local ret = NewStringValue("")
if slot == nil then return ret, "slot is nil" end
if slot == nil then
return ret, "slot is nil"
end
local bindType = select(14, GetItemInfo(Link(slot).value))
if bindType == nil then return ret, "bindType is nil" end
if bindType == nil then
return ret, "bindType is nil"
end
ret.value = bindType
return ret, nil
end
@@ -219,9 +291,13 @@ function shared.Autoloot.Init()
---@return NumberValue, string?
local function Quality(slot)
local ret = NewNumberValue(-1)
if slot == nil then return ret, "slot is nil" end
if slot == nil then
return ret, "slot is nil"
end
local quality = select(4, GetLootSlotInfo(slot))
if quality == nil then return ret, "quality is nil" end
if quality == nil then
return ret, "quality is nil"
end
ret.value = quality
return ret, nil
end
@@ -235,93 +311,121 @@ function shared.Autoloot.Init()
---@class GoldFilter : Filter
local GoldFilter = {
Matches = function(self, slot)
if not shared.config.autoloot.filter.gold.enabled then return false end
if not shared.config.autoloot.filter.gold.enabled then
return false
end
local name = Name(slot)
return name:Contains("Gold") or name:Contains("Silver") or name:Contains("Copper")
end
end,
}
---@class OrderResourceFilter : Filter
local OrderResourceFilter = {
Matches = function(self, slot)
if not shared.config.autoloot.filter.orderResource.enabled then return false end
return Name(slot):Contains("Order Resources")
if not shared.config.autoloot.filter.orderResource.enabled then
return false
end
return Name(slot):Contains("Order Resources")
end,
}
---@class MountFilter : Filter
local MountFilter = {
Matches = function(self, slot)
if not shared.config.autoloot.filter.mount.enabled then return false end
return Type(slot):Eq("Mount")
if not shared.config.autoloot.filter.mount.enabled then
return false
end
return Type(slot):Eq("Mount")
end,
}
---@class IlvlFilter : Filter
local IlvlFilter = {
Matches = function(self, slot)
if not shared.config.autoloot.filter.ilvl.enabled then return false end
return ItemLevel(slot):Ge(shared.config.autoloot.filter.ilvl.value)
if not shared.config.autoloot.filter.ilvl.enabled then
return false
end
return ItemLevel(slot):Ge(shared.config.autoloot.filter.ilvl.value)
end,
}
---@class ProfessionFilter : Filter
local ProfessionFilter = {
Matches = function(self, slot)
if not shared.config.autoloot.filter.profession.enabled then return false end
if not shared.config.autoloot.filter.profession.enabled then
return false
end
local type = Type(slot)
if not type:Eq("Tradeskill") then return false end
if not type:Eq("Tradeskill") then
return false
end
local subtype = SubType(slot)
local professions = { strsplit(",", shared.config.autoloot.filter.profession.professions) }
return shared.TableContains(professions, subtype) or false
end
end,
}
---@class ValueFilter : Filter
local ValueFilter = {
Matches = function(self, slot)
if not shared.config.autoloot.filter.value.enabled then return false end
if not shared.config.autoloot.filter.value.enabled then
return false
end
local value = Value(slot)
if shared.config.autoloot.filter.value.byStack then
value = value * Quantity(slot).value
end
return value:Ge(shared.config.autoloot.filter.value.value)
end
end,
}
---@class GreyValueFilter : Filter
local GreyValueFilter = {
Matches = function(self, slot)
if not shared.config.autoloot.filter.greyvalue.enabled then return false end
if not shared.config.autoloot.filter.greyvalue.enabled then
return false
end
local quality = Quality(slot)
if not quality:Eq(0) then return false end
if not quality:Eq(0) then
return false
end
local value = Value(slot)
if shared.config.autoloot.filter.greyvalue.byStack then
value = value * Quantity(slot).value
end
return value:Ge(shared.config.autoloot.filter.greyvalue.value)
end
end,
}
---@class QuestItemFilter : Filter
local QuestItemFilter = {
Matches = function(self, slot)
if not shared.config.autoloot.filter.questItem.enabled then return false end
return Type(slot):Eq("Quest") and SubType(slot):Eq("Quest")
if not shared.config.autoloot.filter.questItem.enabled then
return false
end
return Type(slot):Eq("Quest") and SubType(slot):Eq("Quest")
end,
}
---@class ClassGearFilter : Filter
local ClassGearFilter = {
Matches = function(self, slot)
if not shared.config.autoloot.filter.classGear.enabled then return false end
if not shared.config.autoloot.filter.classGear.enabled then
return false
end
local ilvlThreshold = shared.config.autoloot.filter.classGear.ilvlThreshold
local qualityThreshold = shared.config.autoloot.filter.classGear.qualityThreshold
local isEquippable = skills[select(3, UnitClass("player"))][SubType(slot).value] or false
if not isEquippable then return false end
return ItemLevel(slot):Ge(ilvlThreshold) and Quality(slot):Ge(qualityThreshold)
if not isEquippable then
return false
end
return ItemLevel(slot):Ge(ilvlThreshold) and Quality(slot):Ge(qualityThreshold)
end,
}
---@class NameFilter : Filter
local NameFilter = {
Matches = function(self, slot)
if not shared.config.autoloot.filter.name.enabled then return false end
if not shared.config.autoloot.filter.name.enabled then
return false
end
local whitelist = { strsplit(",", shared.config.autoloot.filter.name.whitelist) }
for _, name in ipairs(whitelist) do
if not shared.config.autoloot.filter.name.caseSensitive then name = name:lower() end
if not shared.config.autoloot.filter.name.caseSensitive then
name = name:lower()
end
if shared.config.autoloot.filter.name.exact then
return Name(slot):Eq(name)
else
@@ -329,37 +433,47 @@ function shared.Autoloot.Init()
end
end
return false
end
end,
}
---@class BoeFilter : Filter
local BoeFilter = {
types = { "Armor", "Weapon" },
equipLocs = { "INVTYPE_FINGER", "INVTYPE_TRINKET", "INVTYPE_CLOAK", "INVTYPE_NECK" },
Matches = function(self, slot)
if not shared.config.autoloot.filter.boe.enabled then return false end
if not shared.config.autoloot.filter.boe.enabled then
return false
end
local ilvlThreshold = shared.config.autoloot.filter.boe.ilvlThreshold
local qualityThreshold = shared.config.autoloot.filter.boe.qualityThreshold
local type = Type(slot)
local equipLoc = EquipLocation(slot)
if not shared.TableContains(self.types, type) or not shared.TableContains(self.equipLocs, equipLoc) then return false end
return BindType(slot):Eq(1) and ItemLevel(slot):Ge(ilvlThreshold) and Quality(slot):Ge(qualityThreshold)
if not shared.TableContains(self.types, type) or not shared.TableContains(self.equipLocs, equipLoc) then
return false
end
return BindType(slot):Eq(1) and ItemLevel(slot):Ge(ilvlThreshold) and Quality(slot):Ge(qualityThreshold)
end,
}
---@class APFilter : Filter
local APFilter = {
Matches = function(self, slot)
if not shared.config.autoloot.filter.ap.enabled then return false end
return Value(slot):Eq(0) and Type(slot):Eq("Consumable") and SubType(slot):Eq("Other") and
SubclassId(slot):Eq(8)
if not shared.config.autoloot.filter.ap.enabled then
return false
end
return Value(slot):Eq(0)
and Type(slot):Eq("Consumable")
and SubType(slot):Eq("Other")
and SubclassId(slot):Eq(8)
end,
}
---@class EverythingFilter : Filter
local EverythingFilter = {
Matches = function(self, slot)
if not shared.config.autoloot.filter.everything.enabled then return false end
return true
if not shared.config.autoloot.filter.everything.enabled then
return false
end
return true
end,
}
---@type Filter[]
@@ -401,11 +515,7 @@ function shared.Autoloot.Init()
local quality = Quality(slot).value
local icon = Icon(slot).value
local addonPayload = string.format("%s|%s|%s|%s",
name,
quantity,
quality,
icon)
local addonPayload = string.format("%s|%s|%s|%s", name, quantity, quality, icon)
SendAddonMessage("CYKA_AUTOLOOT", addonPayload, "WHISPER", UnitName("player"))
LootSlot(slot)

View File

@@ -11,12 +11,12 @@ local function Init()
["destGUID"] = 8,
["destName"] = 9,
["destFlags"] = 10,
["destRaidFlags"] = 11
["destRaidFlags"] = 11,
},
["GENERIC_SPELL"] = {
["spellId"] = 12,
["spellName"] = 13,
["spellSchool"] = 14
["spellSchool"] = 14,
},
["GENERIC_DAMAGE"] = {
["amount"] = 15,
@@ -28,19 +28,19 @@ local function Init()
["critical"] = 21,
["glancing"] = 22,
["crushing"] = 23,
["isOffHand"] = 24
["isOffHand"] = 24,
},
["GENERIC_MISSED"] = {
["missType"] = 15,
["isOffHand"] = 16,
["amountMissed"] = 17,
["critical"] = 18
["critical"] = 18,
},
["GENERIC_HEAL"] = {
["amount"] = 15,
["overhealing"] = 16,
["absorbed"] = 17,
["critical"] = 18
["critical"] = 18,
},
["GENERIC_HEAL_ABSORBED"] = {
["extraGUID"] = 15,
@@ -51,44 +51,44 @@ local function Init()
["extraSpellName"] = 20,
["extraSchool"] = 21,
["absorbedAmount"] = 22,
["totalAmount"] = 23
["totalAmount"] = 23,
},
["GENERIC_ENERGIZE"] = {
["amount"] = 15,
["overEnergize"] = 16,
["powerType"] = 17
["powerType"] = 17,
},
["GENERIC_DRAIN"] = {
["amount"] = 15,
["powerType"] = 16,
["extraAmount"] = 17
["extraAmount"] = 17,
},
["GENERIC_LEECH"] = {
["amount"] = 15,
["powerType"] = 16,
["extraAmount"] = 17
["extraAmount"] = 17,
},
["GENERIC_INTERRUPT"] = {
["extraSpellId"] = 15,
["extraSpellName"] = 16,
["extraSchool"] = 17
["extraSchool"] = 17,
},
["GENERIC_DISPEL"] = {
["extraSpellId"] = 15,
["extraSpellName"] = 16,
["extraSchool"] = 17,
["auraType"] = 18
["auraType"] = 18,
},
["GENERIC_DISPEL_FAILED"] = {
["extraSpellId"] = 15,
["extraSpellName"] = 16,
["extraSchool"] = 17
["extraSchool"] = 17,
},
["GENERIC_STOLEN"] = {
["extraSpellId"] = 15,
["extraSpellName"] = 16,
["extraSchool"] = 17,
["auraType"] = 18
["auraType"] = 18,
},
["GENERIC_EXTRA_ATTACKS"] = { ["amount"] = 15 },
["GENERIC_AURA_APPLIED"] = { ["auraType"] = 15, ["amount"] = 16 },
@@ -101,38 +101,32 @@ local function Init()
["extraSpellId"] = 15,
["extraSpellName"] = 16,
["extraSchool"] = 17,
["auraType"] = 18
["auraType"] = 18,
},
["GENERIC_CAST_START"] = {},
["GENERIC_CAST_SUCCESS"] = {},
["GENERIC_CAST_FAILED"] = {}
["GENERIC_CAST_FAILED"] = {},
}
CLEUEventInfo["SWING_DAMAGE"] = CLEUEventInfo["GENERIC_DAMAGE"]
CLEUEventInfo["SWING_MISSED"] = CLEUEventInfo["GENERIC_MISSED"]
CLEUEventInfo["SWING_HEAL"] = CLEUEventInfo["GENERIC_HEAL"]
CLEUEventInfo["SWING_HEAL_ABSORBED"] =
CLEUEventInfo["GENERIC_HEAL_ABSORBED"]
CLEUEventInfo["SWING_HEAL_ABSORBED"] = CLEUEventInfo["GENERIC_HEAL_ABSORBED"]
CLEUEventInfo["SWING_ENERGIZE"] = CLEUEventInfo["GENERIC_ENERGIZE"]
CLEUEventInfo["SWING_DRAIN"] = CLEUEventInfo["GENERIC_DRAIN"]
CLEUEventInfo["SWING_LEECH"] = CLEUEventInfo["GENERIC_LEECH"]
CLEUEventInfo["SWING_INTERRUPT"] = CLEUEventInfo["GENERIC_INTERRUPT"]
CLEUEventInfo["SWING_DISPEL"] = CLEUEventInfo["GENERIC_DISPEL"]
CLEUEventInfo["SWING_DISPEL_FAILED"] =
CLEUEventInfo["GENERIC_DISPEL_FAILED"]
CLEUEventInfo["SWING_DISPEL_FAILED"] = CLEUEventInfo["GENERIC_DISPEL_FAILED"]
CLEUEventInfo["SWING_STOLEN"] = CLEUEventInfo["GENERIC_STOLEN"]
CLEUEventInfo["SWING_EXTRA_ATTACKS"] =
CLEUEventInfo["GENERIC_EXTRA_ATTACKS"]
CLEUEventInfo["SWING_EXTRA_ATTACKS"] = CLEUEventInfo["GENERIC_EXTRA_ATTACKS"]
CLEUEventInfo["SWING_AURA_APPLIED"] = CLEUEventInfo["GENERIC_AURA_APPLIED"]
CLEUEventInfo["SWING_AURA_REMOVED"] = CLEUEventInfo["GENERIC_AURA_REMOVED"]
CLEUEventInfo["SWING_AURA_APPLIED_DOSE"] =
CLEUEventInfo["GENERIC_AURA_APPLIED_DOSE"]
CLEUEventInfo["SWING_AURA_REMOVED_DOSE"] =
CLEUEventInfo["GENERIC_AURA_REMOVED_DOSE"]
CLEUEventInfo["SWING_AURA_APPLIED_DOSE"] = CLEUEventInfo["GENERIC_AURA_APPLIED_DOSE"]
CLEUEventInfo["SWING_AURA_REMOVED_DOSE"] = CLEUEventInfo["GENERIC_AURA_REMOVED_DOSE"]
CLEUEventInfo["SWING_AURA_REFRESH"] = CLEUEventInfo["GENERIC_AURA_REFRESH"]
CLEUEventInfo["SWING_AURA_BROKEN"] = CLEUEventInfo["GENERIC_AURA_BROKEN"]
CLEUEventInfo["SWING_AURA_BROKEN_SPELL"] =
CLEUEventInfo["GENERIC_AURA_BROKEN_SPELL"]
CLEUEventInfo["SWING_AURA_BROKEN_SPELL"] = CLEUEventInfo["GENERIC_AURA_BROKEN_SPELL"]
CLEUEventInfo["SWING_CAST_START"] = CLEUEventInfo["GENERIC_CAST_START"]
CLEUEventInfo["SWING_CAST_SUCCESS"] = CLEUEventInfo["GENERIC_CAST_SUCCESS"]
CLEUEventInfo["SWING_CAST_FAILED"] = CLEUEventInfo["GENERIC_CAST_FAILED"]
@@ -140,28 +134,22 @@ local function Init()
CLEUEventInfo["RANGE_DAMAGE"] = CLEUEventInfo["GENERIC_DAMAGE"]
CLEUEventInfo["RANGE_MISSED"] = CLEUEventInfo["GENERIC_MISSED"]
CLEUEventInfo["RANGE_HEAL"] = CLEUEventInfo["GENERIC_HEAL"]
CLEUEventInfo["RANGE_HEAL_ABSORBED"] =
CLEUEventInfo["GENERIC_HEAL_ABSORBED"]
CLEUEventInfo["RANGE_HEAL_ABSORBED"] = CLEUEventInfo["GENERIC_HEAL_ABSORBED"]
CLEUEventInfo["RANGE_ENERGIZE"] = CLEUEventInfo["GENERIC_ENERGIZE"]
CLEUEventInfo["RANGE_DRAIN"] = CLEUEventInfo["GENERIC_DRAIN"]
CLEUEventInfo["RANGE_LEECH"] = CLEUEventInfo["GENERIC_LEECH"]
CLEUEventInfo["RANGE_INTERRUPT"] = CLEUEventInfo["GENERIC_INTERRUPT"]
CLEUEventInfo["RANGE_DISPEL"] = CLEUEventInfo["GENERIC_DISPEL"]
CLEUEventInfo["RANGE_DISPEL_FAILED"] =
CLEUEventInfo["GENERIC_DISPEL_FAILED"]
CLEUEventInfo["RANGE_DISPEL_FAILED"] = CLEUEventInfo["GENERIC_DISPEL_FAILED"]
CLEUEventInfo["RANGE_STOLEN"] = CLEUEventInfo["GENERIC_STOLEN"]
CLEUEventInfo["RANGE_EXTRA_ATTACKS"] =
CLEUEventInfo["GENERIC_EXTRA_ATTACKS"]
CLEUEventInfo["RANGE_EXTRA_ATTACKS"] = CLEUEventInfo["GENERIC_EXTRA_ATTACKS"]
CLEUEventInfo["RANGE_AURA_APPLIED"] = CLEUEventInfo["GENERIC_AURA_APPLIED"]
CLEUEventInfo["RANGE_AURA_REMOVED"] = CLEUEventInfo["GENERIC_AURA_REMOVED"]
CLEUEventInfo["RANGE_AURA_APPLIED_DOSE"] =
CLEUEventInfo["GENERIC_AURA_APPLIED_DOSE"]
CLEUEventInfo["RANGE_AURA_REMOVED_DOSE"] =
CLEUEventInfo["GENERIC_AURA_REMOVED_DOSE"]
CLEUEventInfo["RANGE_AURA_APPLIED_DOSE"] = CLEUEventInfo["GENERIC_AURA_APPLIED_DOSE"]
CLEUEventInfo["RANGE_AURA_REMOVED_DOSE"] = CLEUEventInfo["GENERIC_AURA_REMOVED_DOSE"]
CLEUEventInfo["RANGE_AURA_REFRESH"] = CLEUEventInfo["GENERIC_AURA_REFRESH"]
CLEUEventInfo["RANGE_AURA_BROKEN"] = CLEUEventInfo["GENERIC_AURA_BROKEN"]
CLEUEventInfo["RANGE_AURA_BROKEN_SPELL"] =
CLEUEventInfo["GENERIC_AURA_BROKEN_SPELL"]
CLEUEventInfo["RANGE_AURA_BROKEN_SPELL"] = CLEUEventInfo["GENERIC_AURA_BROKEN_SPELL"]
CLEUEventInfo["RANGE_CAST_START"] = CLEUEventInfo["GENERIC_CAST_START"]
CLEUEventInfo["RANGE_CAST_SUCCESS"] = CLEUEventInfo["GENERIC_CAST_SUCCESS"]
CLEUEventInfo["RANGE_CAST_FAILED"] = CLEUEventInfo["GENERIC_CAST_FAILED"]
@@ -169,28 +157,22 @@ local function Init()
CLEUEventInfo["SPELL_DAMAGE"] = CLEUEventInfo["GENERIC_DAMAGE"]
CLEUEventInfo["SPELL_MISSED"] = CLEUEventInfo["GENERIC_MISSED"]
CLEUEventInfo["SPELL_HEAL"] = CLEUEventInfo["GENERIC_HEAL"]
CLEUEventInfo["SPELL_HEAL_ABSORBED"] =
CLEUEventInfo["GENERIC_HEAL_ABSORBED"]
CLEUEventInfo["SPELL_HEAL_ABSORBED"] = CLEUEventInfo["GENERIC_HEAL_ABSORBED"]
CLEUEventInfo["SPELL_ENERGIZE"] = CLEUEventInfo["GENERIC_ENERGIZE"]
CLEUEventInfo["SPELL_DRAIN"] = CLEUEventInfo["GENERIC_DRAIN"]
CLEUEventInfo["SPELL_LEECH"] = CLEUEventInfo["GENERIC_LEECH"]
CLEUEventInfo["SPELL_INTERRUPT"] = CLEUEventInfo["GENERIC_INTERRUPT"]
CLEUEventInfo["SPELL_DISPEL"] = CLEUEventInfo["GENERIC_DISPEL"]
CLEUEventInfo["SPELL_DISPEL_FAILED"] =
CLEUEventInfo["GENERIC_DISPEL_FAILED"]
CLEUEventInfo["SPELL_DISPEL_FAILED"] = CLEUEventInfo["GENERIC_DISPEL_FAILED"]
CLEUEventInfo["SPELL_STOLEN"] = CLEUEventInfo["GENERIC_STOLEN"]
CLEUEventInfo["SPELL_EXTRA_ATTACKS"] =
CLEUEventInfo["GENERIC_EXTRA_ATTACKS"]
CLEUEventInfo["SPELL_EXTRA_ATTACKS"] = CLEUEventInfo["GENERIC_EXTRA_ATTACKS"]
CLEUEventInfo["SPELL_AURA_APPLIED"] = CLEUEventInfo["GENERIC_AURA_APPLIED"]
CLEUEventInfo["SPELL_AURA_REMOVED"] = CLEUEventInfo["GENERIC_AURA_REMOVED"]
CLEUEventInfo["SPELL_AURA_APPLIED_DOSE"] =
CLEUEventInfo["GENERIC_AURA_APPLIED_DOSE"]
CLEUEventInfo["SPELL_AURA_REMOVED_DOSE"] =
CLEUEventInfo["GENERIC_AURA_REMOVED_DOSE"]
CLEUEventInfo["SPELL_AURA_APPLIED_DOSE"] = CLEUEventInfo["GENERIC_AURA_APPLIED_DOSE"]
CLEUEventInfo["SPELL_AURA_REMOVED_DOSE"] = CLEUEventInfo["GENERIC_AURA_REMOVED_DOSE"]
CLEUEventInfo["SPELL_AURA_REFRESH"] = CLEUEventInfo["GENERIC_AURA_REFRESH"]
CLEUEventInfo["SPELL_AURA_BROKEN"] = CLEUEventInfo["GENERIC_AURA_BROKEN"]
CLEUEventInfo["SPELL_AURA_BROKEN_SPELL"] =
CLEUEventInfo["GENERIC_AURA_BROKEN_SPELL"]
CLEUEventInfo["SPELL_AURA_BROKEN_SPELL"] = CLEUEventInfo["GENERIC_AURA_BROKEN_SPELL"]
CLEUEventInfo["SPELL_CAST_START"] = CLEUEventInfo["GENERIC_CAST_START"]
CLEUEventInfo["SPELL_CAST_SUCCESS"] = CLEUEventInfo["GENERIC_CAST_SUCCESS"]
CLEUEventInfo["SPELL_CAST_FAILED"] = CLEUEventInfo["GENERIC_CAST_FAILED"]
@@ -198,39 +180,25 @@ local function Init()
CLEUEventInfo["SPELL_PERIODIC_DAMAGE"] = CLEUEventInfo["GENERIC_DAMAGE"]
CLEUEventInfo["SPELL_PERIODIC_MISSED"] = CLEUEventInfo["GENERIC_MISSED"]
CLEUEventInfo["SPELL_PERIODIC_HEAL"] = CLEUEventInfo["GENERIC_HEAL"]
CLEUEventInfo["SPELL_PERIODIC_HEAL_ABSORBED"] =
CLEUEventInfo["GENERIC_HEAL_ABSORBED"]
CLEUEventInfo["SPELL_PERIODIC_HEAL_ABSORBED"] = CLEUEventInfo["GENERIC_HEAL_ABSORBED"]
CLEUEventInfo["SPELL_PERIODIC_ENERGIZE"] = CLEUEventInfo["GENERIC_ENERGIZE"]
CLEUEventInfo["SPELL_PERIODIC_DRAIN"] = CLEUEventInfo["GENERIC_DRAIN"]
CLEUEventInfo["SPELL_PERIODIC_LEECH"] = CLEUEventInfo["GENERIC_LEECH"]
CLEUEventInfo["SPELL_PERIODIC_INTERRUPT"] =
CLEUEventInfo["GENERIC_INTERRUPT"]
CLEUEventInfo["SPELL_PERIODIC_INTERRUPT"] = CLEUEventInfo["GENERIC_INTERRUPT"]
CLEUEventInfo["SPELL_PERIODIC_DISPEL"] = CLEUEventInfo["GENERIC_DISPEL"]
CLEUEventInfo["SPELL_PERIODIC_DISPEL_FAILED"] =
CLEUEventInfo["GENERIC_DISPEL_FAILED"]
CLEUEventInfo["SPELL_PERIODIC_DISPEL_FAILED"] = CLEUEventInfo["GENERIC_DISPEL_FAILED"]
CLEUEventInfo["SPELL_PERIODIC_STOLEN"] = CLEUEventInfo["GENERIC_STOLEN"]
CLEUEventInfo["SPELL_PERIODIC_EXTRA_ATTACKS"] =
CLEUEventInfo["GENERIC_EXTRA_ATTACKS"]
CLEUEventInfo["SPELL_PERIODIC_AURA_APPLIED"] =
CLEUEventInfo["GENERIC_AURA_APPLIED"]
CLEUEventInfo["SPELL_PERIODIC_AURA_REMOVED"] =
CLEUEventInfo["GENERIC_AURA_REMOVED"]
CLEUEventInfo["SPELL_PERIODIC_AURA_APPLIED_DOSE"] =
CLEUEventInfo["GENERIC_AURA_APPLIED_DOSE"]
CLEUEventInfo["SPELL_PERIODIC_AURA_REMOVED_DOSE"] =
CLEUEventInfo["GENERIC_AURA_REMOVED_DOSE"]
CLEUEventInfo["SPELL_PERIODIC_AURA_REFRESH"] =
CLEUEventInfo["GENERIC_AURA_REFRESH"]
CLEUEventInfo["SPELL_PERIODIC_AURA_BROKEN"] =
CLEUEventInfo["GENERIC_AURA_BROKEN"]
CLEUEventInfo["SPELL_PERIODIC_AURA_BROKEN_SPELL"] =
CLEUEventInfo["GENERIC_AURA_BROKEN_SPELL"]
CLEUEventInfo["SPELL_PERIODIC_CAST_START"] =
CLEUEventInfo["GENERIC_CAST_START"]
CLEUEventInfo["SPELL_PERIODIC_CAST_SUCCESS"] =
CLEUEventInfo["GENERIC_CAST_SUCCESS"]
CLEUEventInfo["SPELL_PERIODIC_CAST_FAILED"] =
CLEUEventInfo["GENERIC_CAST_FAILED"]
CLEUEventInfo["SPELL_PERIODIC_EXTRA_ATTACKS"] = CLEUEventInfo["GENERIC_EXTRA_ATTACKS"]
CLEUEventInfo["SPELL_PERIODIC_AURA_APPLIED"] = CLEUEventInfo["GENERIC_AURA_APPLIED"]
CLEUEventInfo["SPELL_PERIODIC_AURA_REMOVED"] = CLEUEventInfo["GENERIC_AURA_REMOVED"]
CLEUEventInfo["SPELL_PERIODIC_AURA_APPLIED_DOSE"] = CLEUEventInfo["GENERIC_AURA_APPLIED_DOSE"]
CLEUEventInfo["SPELL_PERIODIC_AURA_REMOVED_DOSE"] = CLEUEventInfo["GENERIC_AURA_REMOVED_DOSE"]
CLEUEventInfo["SPELL_PERIODIC_AURA_REFRESH"] = CLEUEventInfo["GENERIC_AURA_REFRESH"]
CLEUEventInfo["SPELL_PERIODIC_AURA_BROKEN"] = CLEUEventInfo["GENERIC_AURA_BROKEN"]
CLEUEventInfo["SPELL_PERIODIC_AURA_BROKEN_SPELL"] = CLEUEventInfo["GENERIC_AURA_BROKEN_SPELL"]
CLEUEventInfo["SPELL_PERIODIC_CAST_START"] = CLEUEventInfo["GENERIC_CAST_START"]
CLEUEventInfo["SPELL_PERIODIC_CAST_SUCCESS"] = CLEUEventInfo["GENERIC_CAST_SUCCESS"]
CLEUEventInfo["SPELL_PERIODIC_CAST_FAILED"] = CLEUEventInfo["GENERIC_CAST_FAILED"]
---@class CLEUParser
CLEUParser = {
@@ -378,7 +346,9 @@ local function Init()
---@return number, nil|string
GetSpellId = function(...)
local val = select(CLEUEventInfo["GENERIC_SPELL"]["spellId"], ...)
if val == nil then return 0, "SpellId is nil or missing" end
if val == nil then
return 0, "SpellId is nil or missing"
end
if type(val) ~= "number" then
return 0, "SpellId is not a number"
end
@@ -413,8 +383,7 @@ local function Init()
---@param ... any
---@return number, nil|string
GetSpellSchool = function(...)
local val = select(CLEUEventInfo["GENERIC_SPELL"]["spellSchool"],
...)
local val = select(CLEUEventInfo["GENERIC_SPELL"]["spellSchool"], ...)
if val == nil then
return 0, "SpellSchool is nil or missing"
end
@@ -451,11 +420,12 @@ local function Init()
GetAmount = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return 0,
string.format("Failed getting subevent due to: %s", err)
return 0, string.format("Failed getting subevent due to: %s", err)
end
local val = select(CLEUEventInfo[subevent]["amount"], ...)
if val == nil then return 0, "Amount is nil or missing" end
if val == nil then
return 0, "Amount is nil or missing"
end
if type(val) ~= "number" then
return 0, "Amount is not a number"
end
@@ -479,8 +449,7 @@ local function Init()
GetOverkill = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return 0,
string.format("Failed getting subevent due to: %s", err)
return 0, string.format("Failed getting subevent due to: %s", err)
end
if not CLEUEventInfo[subevent] then
return 0, "Subevent is not a valid event"
@@ -489,7 +458,9 @@ local function Init()
return 0, "Overkill is nil or missing"
end
local val = select(CLEUEventInfo[subevent]["overkill"], ...)
if val == nil then return 0, "Overkill is nil or missing" end
if val == nil then
return 0, "Overkill is nil or missing"
end
if type(val) ~= "number" then
return 0, "Overkill is not a number"
end
@@ -513,11 +484,12 @@ local function Init()
GetSchool = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return 0,
string.format("Failed getting subevent due to: %s", err)
return 0, string.format("Failed getting subevent due to: %s", err)
end
local val = select(CLEUEventInfo[subevent]["school"], ...)
if val == nil then return 0, "School is nil or missing" end
if val == nil then
return 0, "School is nil or missing"
end
if type(val) ~= "number" then
return 0, "School is not a number"
end
@@ -543,8 +515,7 @@ local function Init()
GetResisted = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return false,
string.format("Failed getting subevent due to: %s", err)
return false, string.format("Failed getting subevent due to: %s", err)
end
local val = select(CLEUEventInfo[subevent]["resisted"], ...)
if val == nil then
@@ -575,8 +546,7 @@ local function Init()
GetBlocked = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return false,
string.format("Failed getting subevent due to: %s", err)
return false, string.format("Failed getting subevent due to: %s", err)
end
local val = select(CLEUEventInfo[subevent]["blocked"], ...)
if val == nil then
@@ -608,8 +578,7 @@ local function Init()
GetAbsorbed = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return false,
string.format("Failed getting subevent due to: %s", err)
return false, string.format("Failed getting subevent due to: %s", err)
end
local val = select(CLEUEventInfo[subevent]["absorbed"], ...)
if val == nil then
@@ -640,8 +609,7 @@ local function Init()
GetCritical = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return false,
string.format("Failed getting subevent due to: %s", err)
return false, string.format("Failed getting subevent due to: %s", err)
end
local val = select(CLEUEventInfo[subevent]["critical"], ...)
if val == nil then
@@ -670,8 +638,7 @@ local function Init()
GetGlancing = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return false,
string.format("Failed getting subevent due to: %s", err)
return false, string.format("Failed getting subevent due to: %s", err)
end
local val = select(CLEUEventInfo[subevent]["glancing"], ...)
if val == nil then
@@ -700,8 +667,7 @@ local function Init()
GetCrushing = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return false,
string.format("Failed getting subevent due to: %s", err)
return false, string.format("Failed getting subevent due to: %s", err)
end
local val = select(CLEUEventInfo[subevent]["crushing"], ...)
if val == nil then
@@ -731,8 +697,7 @@ local function Init()
GetIsOffHand = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return false,
string.format("Failed getting subevent due to: %s", err)
return false, string.format("Failed getting subevent due to: %s", err)
end
local val = select(CLEUEventInfo[subevent]["isOffHand"], ...)
if val == nil then
@@ -764,8 +729,7 @@ local function Init()
GetMissType = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return "",
string.format("Failed getting subevent due to: %s", err)
return "", string.format("Failed getting subevent due to: %s", err)
end
local val = select(CLEUEventInfo[subevent]["missType"], ...)
if val == nil then
@@ -797,8 +761,7 @@ local function Init()
GetAmountMissed = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return 0,
string.format("Failed getting subevent due to: %s", err)
return 0, string.format("Failed getting subevent due to: %s", err)
end
local val = select(CLEUEventInfo[subevent]["amountMissed"], ...)
if val == nil then
@@ -830,8 +793,7 @@ local function Init()
GetOverhealing = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return 0,
string.format("Failed getting subevent due to: %s", err)
return 0, string.format("Failed getting subevent due to: %s", err)
end
local val = select(CLEUEventInfo[subevent]["overhealing"], ...)
if val == nil then
@@ -861,8 +823,7 @@ local function Init()
GetExtraGUID = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return "",
string.format("Failed getting subevent due to: %s", err)
return "", string.format("Failed getting subevent due to: %s", err)
end
local val = select(CLEUEventInfo[subevent]["extraGUID"], ...)
if val == nil then
@@ -892,8 +853,7 @@ local function Init()
GetExtraName = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return "",
string.format("Failed getting subevent due to: %s", err)
return "", string.format("Failed getting subevent due to: %s", err)
end
local val = select(CLEUEventInfo[subevent]["extraName"], ...)
if val == nil then
@@ -923,8 +883,7 @@ local function Init()
GetExtraFlags = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return 0,
string.format("Failed getting subevent due to: %s", err)
return 0, string.format("Failed getting subevent due to: %s", err)
end
local val = select(CLEUEventInfo[subevent]["extraFlags"], ...)
if val == nil then
@@ -954,8 +913,7 @@ local function Init()
GetExtraRaidFlags = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return 0,
string.format("Failed getting subevent due to: %s", err)
return 0, string.format("Failed getting subevent due to: %s", err)
end
local val = select(CLEUEventInfo[subevent]["extraRaidFlags"], ...)
if val == nil then
@@ -989,8 +947,7 @@ local function Init()
GetExtraSpellID = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return 0,
string.format("Failed getting subevent due to: %s", err)
return 0, string.format("Failed getting subevent due to: %s", err)
end
local val = select(CLEUEventInfo[subevent]["extraSpellID"], ...)
if val == nil then
@@ -1025,8 +982,7 @@ local function Init()
GetExtraSpellName = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return "",
string.format("Failed getting subevent due to: %s", err)
return "", string.format("Failed getting subevent due to: %s", err)
end
local val = select(CLEUEventInfo[subevent]["extraSpellName"], ...)
if val == nil then
@@ -1061,8 +1017,7 @@ local function Init()
GetExtraSchool = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return 0,
string.format("Failed getting subevent due to: %s", err)
return 0, string.format("Failed getting subevent due to: %s", err)
end
local val = select(CLEUEventInfo[subevent]["extraSchool"], ...)
if val == nil then
@@ -1092,8 +1047,7 @@ local function Init()
GetAbsorbedAmount = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return 0,
string.format("Failed getting subevent due to: %s", err)
return 0, string.format("Failed getting subevent due to: %s", err)
end
local val = select(CLEUEventInfo[subevent]["absorbedAmount"], ...)
if val == nil then
@@ -1123,8 +1077,7 @@ local function Init()
GetOverEnergize = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return 0,
string.format("Failed getting subevent due to: %s", err)
return 0, string.format("Failed getting subevent due to: %s", err)
end
local val = select(CLEUEventInfo[subevent]["overEnergize"], ...)
if val == nil then
@@ -1158,8 +1111,7 @@ local function Init()
GetPowerType = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return 0,
string.format("Failed getting subevent due to: %s", err)
return 0, string.format("Failed getting subevent due to: %s", err)
end
local val = select(CLEUEventInfo[subevent]["powerType"], ...)
if val == nil then
@@ -1190,8 +1142,7 @@ local function Init()
GetExtraAmount = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return 0,
string.format("Failed getting subevent due to: %s", err)
return 0, string.format("Failed getting subevent due to: %s", err)
end
local val = select(CLEUEventInfo[subevent]["extraAmount"], ...)
if val == nil then
@@ -1229,8 +1180,7 @@ local function Init()
GetExtraSpellId = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return 0,
string.format("Failed getting subevent due to: %s", err)
return 0, string.format("Failed getting subevent due to: %s", err)
end
local val = select(CLEUEventInfo[subevent]["extraSpellId"], ...)
if val == nil then
@@ -1268,16 +1218,17 @@ local function Init()
GetExtraAuraType = function(...)
local subevent, err = CLEUParser.GetSubevent(...)
if err then
return 0,
string.format("Failed getting subevent due to: %s", err)
return 0, string.format("Failed getting subevent due to: %s", err)
end
local val = select(CLEUEventInfo[subevent]["auraType"], ...)
if val == nil then return 0, "AuraType is nil or missing" end
if val == nil then
return 0, "AuraType is nil or missing"
end
if type(val) ~= "number" then
return 0, "AuraType is not a number"
end
return val, nil
end
end,
}
end

View File

@@ -6,8 +6,7 @@ local addonname, shared = ...
---@field Init fun()
shared.CameraSettings = {
Init = function()
end
Init = function() end,
}
function shared.CameraSettings.Init()
if not shared.config.camera.enabled then

210
Cyka.lua
View File

@@ -16,7 +16,6 @@ local addonname, shared = ...
---@field CameraSettings CameraSettings
---@field SpellQSettings SpellQSettings
---@class CykaData
---@class CykaConfig
@@ -44,13 +43,21 @@ local addonname, shared = ...
---@field everything { enabled: boolean }
local function init()
if not CykaPersistentData then CykaPersistentData = {} end
if not CykaPersistentData.config then CykaPersistentData.config = {} end
if not CykaPersistentData then
CykaPersistentData = {}
end
if not CykaPersistentData.config then
CykaPersistentData.config = {}
end
shared.GetOrDefault = function(table, keys, default)
local value = default
if not table then return value end
if not keys then return value end
if not table then
return value
end
if not keys then
return value
end
local traverse = table
for i = 1, #keys do
@@ -78,12 +85,12 @@ local function init()
if depth == nil then
depth = 0
end
if (depth > 200) then
if depth > 200 then
print("Error: Depth > 200 in dumpTable()")
return
end
for k, v in pairs(table) do
if (type(v) == "table") then
if type(v) == "table" then
print(string.rep(" ", depth) .. k .. ":")
shared.DumpTable(v, depth + 1)
else
@@ -96,7 +103,9 @@ local function init()
---@param value any
shared.TableContains = function(table, value)
for _, v in pairs(table) do
if v == value then return true end
if v == value then
return true
end
end
return false
end
@@ -114,84 +123,163 @@ local function init()
enabled = shared.GetOrDefault(CykaPersistentData.config, { "autoloot", "enabled" }, true),
filter = {
gold = {
enabled = shared.GetOrDefault(CykaPersistentData.config, { "autoloot", "filter", "gold", "enabled" },
true),
enabled = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "gold", "enabled" },
true
),
},
orderResource = {
enabled = shared.GetOrDefault(CykaPersistentData.config,
{ "autoloot", "filter", "orderResource", "enabled" }, true),
enabled = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "orderResource", "enabled" },
true
),
},
mount = {
enabled = shared.GetOrDefault(CykaPersistentData.config, { "autoloot", "filter", "mount", "enabled" },
true),
enabled = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "mount", "enabled" },
true
),
},
ilvl = {
enabled = shared.GetOrDefault(CykaPersistentData.config, { "autoloot", "filter", "ilvl", "enabled" },
true),
value = shared.GetOrDefault(CykaPersistentData.config, { "autoloot", "filter", "ilvl", "value" }, 910),
enabled = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "ilvl", "enabled" },
true
),
value = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "ilvl", "value" },
910
),
},
profession = {
enabled = shared.GetOrDefault(CykaPersistentData.config,
{ "autoloot", "filter", "profession", "enabled" }, true),
professions = shared.GetOrDefault(CykaPersistentData.config,
{ "autoloot", "filter", "profession", "professions" }, ""),
enabled = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "profession", "enabled" },
true
),
professions = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "profession", "professions" },
""
),
},
value = {
enabled = shared.GetOrDefault(CykaPersistentData.config, { "autoloot", "filter", "value", "enabled" },
true),
byStack = shared.GetOrDefault(CykaPersistentData.config, { "autoloot", "filter", "value", "byStack" },
false),
value = shared.GetOrDefault(CykaPersistentData.config, { "autoloot", "filter", "value", "value" },
10000),
enabled = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "value", "enabled" },
true
),
byStack = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "value", "byStack" },
false
),
value = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "value", "value" },
10000
),
},
greyvalue = {
enabled = shared.GetOrDefault(CykaPersistentData.config,
{ "autoloot", "filter", "greyvalue", "enabled" }, true),
byStack = shared.GetOrDefault(CykaPersistentData.config,
{ "autoloot", "filter", "greyvalue", "byStack" }, false),
value = shared.GetOrDefault(CykaPersistentData.config, { "autoloot", "filter", "greyvalue", "value" },
100000),
enabled = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "greyvalue", "enabled" },
true
),
byStack = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "greyvalue", "byStack" },
false
),
value = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "greyvalue", "value" },
100000
),
},
questItem = {
enabled = shared.GetOrDefault(CykaPersistentData.config,
{ "autoloot", "filter", "questItem", "enabled" }, true),
enabled = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "questItem", "enabled" },
true
),
},
classGear = {
enabled = shared.GetOrDefault(CykaPersistentData.config,
{ "autoloot", "filter", "classGear", "enabled" }, true),
ilvlThreshold = shared.GetOrDefault(CykaPersistentData.config,
{ "autoloot", "filter", "classGear", "ilvlThreshold" }, 910),
qualityThreshold = shared.GetOrDefault(CykaPersistentData.config,
{ "autoloot", "filter", "classGear", "qualityThreshold" }, 3),
enabled = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "classGear", "enabled" },
true
),
ilvlThreshold = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "classGear", "ilvlThreshold" },
910
),
qualityThreshold = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "classGear", "qualityThreshold" },
3
),
},
boe = {
enabled = shared.GetOrDefault(CykaPersistentData.config, { "autoloot", "filter", "boe", "enabled" },
true),
ilvlThreshold = shared.GetOrDefault(CykaPersistentData.config,
{ "autoloot", "filter", "boe", "ilvlThreshold" }, 910),
qualityThreshold = shared.GetOrDefault(CykaPersistentData.config,
{ "autoloot", "filter", "boe", "qualityThreshold" }, 3),
enabled = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "boe", "enabled" },
true
),
ilvlThreshold = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "boe", "ilvlThreshold" },
910
),
qualityThreshold = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "boe", "qualityThreshold" },
3
),
},
ap = {
enabled = shared.GetOrDefault(CykaPersistentData.config, { "autoloot", "filter", "ap", "enabled" },
true),
enabled = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "ap", "enabled" },
true
),
},
name = {
enabled = shared.GetOrDefault(CykaPersistentData.config, { "autoloot", "filter", "name", "enabled" },
false),
exact = shared.GetOrDefault(CykaPersistentData.config, { "autoloot", "filter", "name", "exact" },
false),
caseSensitive = shared.GetOrDefault(CykaPersistentData.config,
{ "autoloot", "filter", "name", "caseSensitive" }, false),
whitelist = shared.GetOrDefault(CykaPersistentData.config,
{ "autoloot", "filter", "name", "whitelist" }, ""),
enabled = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "name", "enabled" },
false
),
exact = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "name", "exact" },
false
),
caseSensitive = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "name", "caseSensitive" },
false
),
whitelist = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "name", "whitelist" },
""
),
},
everything = {
enabled = shared.GetOrDefault(CykaPersistentData.config,
{ "autoloot", "filter", "everything", "enabled" }, true),
enabled = shared.GetOrDefault(
CykaPersistentData.config,
{ "autoloot", "filter", "everything", "enabled" },
true
),
},
},
},
}
}
}
shared.Autoloot.Init()

View File

@@ -13,7 +13,9 @@ function shared.SpellQSettings.Init()
end
local function SetSpellQueue(window)
if not window then return end
if not window then
return
end
print("Spell queue window set to " .. tostring(window))
SetCVar("SpellQueueWindow", window)
end
@@ -26,7 +28,9 @@ function shared.SpellQSettings.Init()
end)
SlashCmdList["SPELLQSETTINGS"] = function(window)
if window then shared.config.spellQueue.queue = window end
if window then
shared.config.spellQueue.queue = window
end
SetSpellQueue(shared.config.spellQueue.queue)
end
SLASH_SPELLQSETTINGS1 = "/sq"

View File

@@ -1,2 +1,2 @@
local foo = {1, 2, 3, 4}
local foo = { 1, 2, 3, 4 }
print(table.contains(foo, 3))