Compare commits
3 Commits
596b287fe6
...
21b6ecccd0
Author | SHA1 | Date | |
---|---|---|---|
21b6ecccd0 | |||
3d8fa46711 | |||
c365178b99 |
262
Autoloot.lua
262
Autoloot.lua
@@ -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
|
||||
if not shared.config.autoloot.filter.orderResource.enabled then
|
||||
return false
|
||||
end
|
||||
return Name(slot):Contains("Order Resources")
|
||||
end
|
||||
end,
|
||||
}
|
||||
---@class MountFilter : Filter
|
||||
local MountFilter = {
|
||||
Matches = function(self, slot)
|
||||
if not shared.config.autoloot.filter.mount.enabled then return false end
|
||||
if not shared.config.autoloot.filter.mount.enabled then
|
||||
return false
|
||||
end
|
||||
return Type(slot):Eq("Mount")
|
||||
end
|
||||
end,
|
||||
}
|
||||
---@class IlvlFilter : Filter
|
||||
local IlvlFilter = {
|
||||
Matches = function(self, slot)
|
||||
if not shared.config.autoloot.filter.ilvl.enabled then return false end
|
||||
if not shared.config.autoloot.filter.ilvl.enabled then
|
||||
return false
|
||||
end
|
||||
return ItemLevel(slot):Ge(shared.config.autoloot.filter.ilvl.value)
|
||||
end
|
||||
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
|
||||
if not shared.config.autoloot.filter.questItem.enabled then
|
||||
return false
|
||||
end
|
||||
return Type(slot):Eq("Quest") and SubType(slot):Eq("Quest")
|
||||
end
|
||||
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
|
||||
if not isEquippable then
|
||||
return false
|
||||
end
|
||||
return ItemLevel(slot):Ge(ilvlThreshold) and Quality(slot):Ge(qualityThreshold)
|
||||
end
|
||||
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
|
||||
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
|
||||
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)
|
||||
end
|
||||
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
|
||||
if not shared.config.autoloot.filter.everything.enabled then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
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)
|
||||
|
231
CLEUParser.lua
231
CLEUParser.lua
@@ -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
|
||||
|
||||
@@ -1288,4 +1239,4 @@ frame:RegisterEvent("GUILD_ROSTER_UPDATE")
|
||||
frame:SetScript("OnEvent", function(self, event, ...)
|
||||
Init()
|
||||
end)
|
||||
Init()
|
||||
Init()
|
||||
|
@@ -6,129 +6,128 @@ 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
|
||||
print("Cyka - Camera settings disabled")
|
||||
return
|
||||
end
|
||||
if not shared.config.camera.enabled then
|
||||
print("Cyka - Camera settings disabled")
|
||||
return
|
||||
end
|
||||
|
||||
local function SetCameraSpeed(speed)
|
||||
if not speed then
|
||||
return
|
||||
end
|
||||
print("Camera speed set to " .. tostring(speed))
|
||||
SetCVar("cameraYawMoveSpeed", speed)
|
||||
SetCVar("cameraPitchMoveSpeed", speed)
|
||||
local function SetCameraSpeed(speed)
|
||||
if not speed then
|
||||
return
|
||||
end
|
||||
print("Camera speed set to " .. tostring(speed))
|
||||
SetCVar("cameraYawMoveSpeed", speed)
|
||||
SetCVar("cameraPitchMoveSpeed", speed)
|
||||
|
||||
SetBinding("BUTTON3", "TOGGLEAUTORUN")
|
||||
SetBinding("A", "STRAFELEFT")
|
||||
SetBinding("D", "STRAFERIGHT")
|
||||
SetBinding("Q", "ACTIONBUTTON1")
|
||||
SetBinding("E", "ACTIONBUTTON2")
|
||||
SetBinding("SPACE", "ACTIONBUTTON5")
|
||||
SetBinding("NUMPAD0", "NONE")
|
||||
SetBinding("Z", "TOGGLESHEATH")
|
||||
SetBinding("NUMLOCK", "NONE")
|
||||
SetBinding("BUTTON4", "MULTIACTIONBAR2BUTTON11")
|
||||
SetBinding("R", "ACTIONBUTTON6")
|
||||
SetBinding("SHIFT-R", "MULTIACTIONBAR1BUTTON6")
|
||||
SetBinding("1", "ACTIONBUTTON8")
|
||||
SetBinding("2", "ACTIONBUTTON9")
|
||||
SetBinding("3", "ACTIONBUTTON10")
|
||||
SetBinding("4", "ACTIONBUTTON11")
|
||||
SetBinding("5", "MULTIACTIONBAR2BUTTON2")
|
||||
SetBinding("6", "MULTIACTIONBAR2BUTTON3")
|
||||
SetBinding("7", "MULTIACTIONBAR2BUTTON4")
|
||||
SetBinding("8", "MULTIACTIONBAR2BUTTON5")
|
||||
SetBinding("9", "NONE")
|
||||
SetBinding("0", "NONE")
|
||||
SetBinding("-", "NONE")
|
||||
SetBinding("=", "NONE")
|
||||
SetBinding("CTRL-1", "ELVUIBAR6BUTTON3")
|
||||
SetBinding("CTRL-2", "ELVUIBAR6BUTTON4")
|
||||
SetBinding("CTRL-3", "ELVUIBAR6BUTTON5")
|
||||
SetBinding("CTRL-4", "ELVUIBAR6BUTTON6")
|
||||
SetBinding("CTRL-5", "ELVUIBAR6BUTTON2")
|
||||
SetBinding("SHIFT-1", "MULTIACTIONBAR1BUTTON8")
|
||||
SetBinding("SHIFT-2", "MULTIACTIONBAR1BUTTON9")
|
||||
SetBinding("SHIFT-3", "MULTIACTIONBAR1BUTTON10")
|
||||
SetBinding("SHIFT-4", "MULTIACTIONBAR1BUTTON11")
|
||||
SetBinding("SHIFT-5", "MULTIACTIONBAR1BUTTON12")
|
||||
SetBinding("SHIFT-MOUSEWHEELUP", "INTERACTMOUSEOVER")
|
||||
SetBinding("SHIFT-MOUSEWHEELDOWN", "MULTIACTIONBAR4BUTTON3")
|
||||
SetBinding("TAB", "ACTIONBUTTON12")
|
||||
SetBinding("G", "INTERACTTARGET")
|
||||
SetBinding("F", "ACTIONBUTTON7")
|
||||
SetBinding("V", "JUMP")
|
||||
SetBinding("C", "ACTIONBUTTON3")
|
||||
SetBinding("SHIFT-P", "TOGGLECOLLECTIONSMOUNTJOURNAL")
|
||||
SetBinding("Y", "ACTIONBUTTON4")
|
||||
SetBinding("SHIFT-Y", "MULTIACTIONBAR1BUTTON4")
|
||||
SetBinding("MOUSEWHEELUP", "MULTIACTIONBAR2BUTTON9")
|
||||
SetBinding("MOUSEWHEELDOWN", "MULTIACTIONBAR2BUTTON10")
|
||||
SetBinding("CTRL-Q", "MULTIACTIONBAR4BUTTON10")
|
||||
SetBinding("CTRL-E", "MULTIACTIONBAR4BUTTON9")
|
||||
SetBinding("CTRL-MOUSEWHEELUP", "CAMERAZOOMIN")
|
||||
SetBinding("CTRL-MOUSEWHEELDOWN", "CAMERAZOOMOUT")
|
||||
SetBinding("SHIFT-C", "MULTIACTIONBAR1BUTTON3")
|
||||
SetBinding("¸", "MULTIACTIONBAR2BUTTON1")
|
||||
SetBinding("ALT-1", "MULTIACTIONBAR3BUTTON8")
|
||||
SetBinding("ALT-2", "MULTIACTIONBAR3BUTTON9")
|
||||
SetBinding("ALT-3", "MULTIACTIONBAR3BUTTON10")
|
||||
SetBinding("ALT-4", "MULTIACTIONBAR3BUTTON11")
|
||||
SetBinding("SHIFT-Q", "MULTIACTIONBAR1BUTTON1")
|
||||
SetBinding("SHIFT-E", "MULTIACTIONBAR1BUTTON2")
|
||||
SetBinding("ALT-E", "MULTIACTIONBAR3BUTTON2")
|
||||
SetBinding("ALT-C", "MULTIACTIONBAR3BUTTON3")
|
||||
SetBinding("ALT-Y", "MULTIACTIONBAR3BUTTON4")
|
||||
SetBinding("SHIFT-F", "MULTIACTIONBAR1BUTTON7")
|
||||
SetBinding("ALT-R", "MULTIACTIONBAR3BUTTON6")
|
||||
SetBinding("ALT-F", "MULTIACTIONBAR3BUTTON7")
|
||||
SetBinding("SHIFT-BUTTON5", "MULTIACTIONBAR4BUTTON1")
|
||||
SetBinding("BUTTON5", "MULTIACTIONBAR2BUTTON12")
|
||||
SetBinding("SHIFT-BUTTON4", "MULTIACTIONBAR4BUTTON2")
|
||||
SetBinding("CTRL-BUTTON4", "ELVUIBAR6BUTTON11")
|
||||
SetBinding("CTRL-BUTTON5", "ELVUIBAR6BUTTON12")
|
||||
SetBinding("SHIFT-L", "TOGGLEACHIEVEMENT")
|
||||
SetBinding("ALT-G", "DEATH_NOTE_SHOW_TARGET_DEATH")
|
||||
SetBinding("[", "PAWN_COMPARE_LEFT")
|
||||
SetBinding("]", "PAWN_COMPARE_RIGHT")
|
||||
SetBinding("ALT-5", "MULTIACTIONBAR3BUTTON12")
|
||||
SetBinding("ALT-6", "MULTIACTIONBAR2BUTTON6")
|
||||
SetBinding("SHIFT-¸", "HEKILI_TOGGLE_COOLDOWNS")
|
||||
SetBinding("CTRL-C", "MULTIACTIONBAR4BUTTON6")
|
||||
SetBinding("ALT-CTRL-P", "MULTIACTIONBAR2BUTTON7")
|
||||
SetBinding("BUTTON3", "TOGGLEAUTORUN")
|
||||
SetBinding("A", "STRAFELEFT")
|
||||
SetBinding("D", "STRAFERIGHT")
|
||||
SetBinding("Q", "ACTIONBUTTON1")
|
||||
SetBinding("E", "ACTIONBUTTON2")
|
||||
SetBinding("SPACE", "ACTIONBUTTON5")
|
||||
SetBinding("NUMPAD0", "NONE")
|
||||
SetBinding("Z", "TOGGLESHEATH")
|
||||
SetBinding("NUMLOCK", "NONE")
|
||||
SetBinding("BUTTON4", "MULTIACTIONBAR2BUTTON11")
|
||||
SetBinding("R", "ACTIONBUTTON6")
|
||||
SetBinding("SHIFT-R", "MULTIACTIONBAR1BUTTON6")
|
||||
SetBinding("1", "ACTIONBUTTON8")
|
||||
SetBinding("2", "ACTIONBUTTON9")
|
||||
SetBinding("3", "ACTIONBUTTON10")
|
||||
SetBinding("4", "ACTIONBUTTON11")
|
||||
SetBinding("5", "MULTIACTIONBAR2BUTTON2")
|
||||
SetBinding("6", "MULTIACTIONBAR2BUTTON3")
|
||||
SetBinding("7", "MULTIACTIONBAR2BUTTON4")
|
||||
SetBinding("8", "MULTIACTIONBAR2BUTTON5")
|
||||
SetBinding("9", "NONE")
|
||||
SetBinding("0", "NONE")
|
||||
SetBinding("-", "NONE")
|
||||
SetBinding("=", "NONE")
|
||||
SetBinding("CTRL-1", "ELVUIBAR6BUTTON3")
|
||||
SetBinding("CTRL-2", "ELVUIBAR6BUTTON4")
|
||||
SetBinding("CTRL-3", "ELVUIBAR6BUTTON5")
|
||||
SetBinding("CTRL-4", "ELVUIBAR6BUTTON6")
|
||||
SetBinding("CTRL-5", "ELVUIBAR6BUTTON2")
|
||||
SetBinding("SHIFT-1", "MULTIACTIONBAR1BUTTON8")
|
||||
SetBinding("SHIFT-2", "MULTIACTIONBAR1BUTTON9")
|
||||
SetBinding("SHIFT-3", "MULTIACTIONBAR1BUTTON10")
|
||||
SetBinding("SHIFT-4", "MULTIACTIONBAR1BUTTON11")
|
||||
SetBinding("SHIFT-5", "MULTIACTIONBAR1BUTTON12")
|
||||
SetBinding("MOUSEWHEELUP", "INTERACTMOUSEOVER")
|
||||
SetBinding("SHIFT-MOUSEWHEELDOWN", "MULTIACTIONBAR4BUTTON3")
|
||||
SetBinding("TAB", "ACTIONBUTTON12")
|
||||
SetBinding("G", "INTERACTTARGET")
|
||||
SetBinding("F", "ACTIONBUTTON7")
|
||||
SetBinding("V", "JUMP")
|
||||
SetBinding("C", "ACTIONBUTTON3")
|
||||
SetBinding("SHIFT-P", "TOGGLECOLLECTIONSMOUNTJOURNAL")
|
||||
SetBinding("Y", "ACTIONBUTTON4")
|
||||
SetBinding("SHIFT-Y", "MULTIACTIONBAR1BUTTON4")
|
||||
SetBinding("SHIFT-MOUSEWHEELUP", "MULTIACTIONBAR2BUTTON9")
|
||||
SetBinding("MOUSEWHEELDOWN", "MULTIACTIONBAR2BUTTON10")
|
||||
SetBinding("CTRL-Q", "MULTIACTIONBAR4BUTTON10")
|
||||
SetBinding("CTRL-E", "MULTIACTIONBAR4BUTTON9")
|
||||
SetBinding("CTRL-MOUSEWHEELUP", "CAMERAZOOMIN")
|
||||
SetBinding("CTRL-MOUSEWHEELDOWN", "CAMERAZOOMOUT")
|
||||
SetBinding("SHIFT-C", "MULTIACTIONBAR1BUTTON3")
|
||||
SetBinding("¸", "MULTIACTIONBAR2BUTTON1")
|
||||
SetBinding("ALT-1", "MULTIACTIONBAR3BUTTON8")
|
||||
SetBinding("ALT-2", "MULTIACTIONBAR3BUTTON9")
|
||||
SetBinding("ALT-3", "MULTIACTIONBAR3BUTTON10")
|
||||
SetBinding("ALT-4", "MULTIACTIONBAR3BUTTON11")
|
||||
SetBinding("SHIFT-Q", "MULTIACTIONBAR1BUTTON1")
|
||||
SetBinding("SHIFT-E", "MULTIACTIONBAR1BUTTON2")
|
||||
SetBinding("ALT-E", "MULTIACTIONBAR3BUTTON2")
|
||||
SetBinding("ALT-C", "MULTIACTIONBAR3BUTTON3")
|
||||
SetBinding("ALT-Y", "MULTIACTIONBAR3BUTTON4")
|
||||
SetBinding("SHIFT-F", "MULTIACTIONBAR1BUTTON7")
|
||||
SetBinding("ALT-R", "MULTIACTIONBAR3BUTTON6")
|
||||
SetBinding("ALT-F", "MULTIACTIONBAR3BUTTON7")
|
||||
SetBinding("SHIFT-BUTTON5", "MULTIACTIONBAR4BUTTON1")
|
||||
SetBinding("BUTTON5", "MULTIACTIONBAR2BUTTON12")
|
||||
SetBinding("SHIFT-BUTTON4", "MULTIACTIONBAR4BUTTON2")
|
||||
SetBinding("CTRL-BUTTON4", "ELVUIBAR6BUTTON11")
|
||||
SetBinding("CTRL-BUTTON5", "ELVUIBAR6BUTTON12")
|
||||
SetBinding("SHIFT-L", "TOGGLEACHIEVEMENT")
|
||||
SetBinding("ALT-G", "DEATH_NOTE_SHOW_TARGET_DEATH")
|
||||
SetBinding("[", "PAWN_COMPARE_LEFT")
|
||||
SetBinding("]", "PAWN_COMPARE_RIGHT")
|
||||
SetBinding("ALT-5", "MULTIACTIONBAR3BUTTON12")
|
||||
SetBinding("ALT-6", "MULTIACTIONBAR2BUTTON6")
|
||||
SetBinding("SHIFT-¸", "HEKILI_TOGGLE_COOLDOWNS")
|
||||
SetBinding("CTRL-C", "MULTIACTIONBAR4BUTTON6")
|
||||
SetBinding("ALT-CTRL-P", "MULTIACTIONBAR2BUTTON7")
|
||||
|
||||
InterfaceOptionsControlsPanelInteractOnLeftClick:SetValue(0)
|
||||
InterfaceOptionsControlsPanelStickyTargeting:SetValue(1)
|
||||
InterfaceOptionsCombatPanelTargetOfTarget:SetValue(1)
|
||||
InterfaceOptionsDisplayPanelShowTutorials:SetValue(0)
|
||||
InterfaceOptionsDisplayPanelAJAlerts:SetValue(1)
|
||||
InterfaceOptionsSocialPanelProfanityFilter:SetValue(0)
|
||||
InterfaceOptionsSocialPanelSpamFilter:SetValue(0)
|
||||
InterfaceOptionsNamesPanelMyName:SetValue(1)
|
||||
InterfaceOptionsCameraPanelStyleDropDown:SetValue(0)
|
||||
InterfaceOptionsMousePanelClickToMove:SetValue(1)
|
||||
InterfaceOptionsMousePanelClickMoveStyleDropDown:SetValue(0)
|
||||
end
|
||||
InterfaceOptionsControlsPanelInteractOnLeftClick:SetValue(0)
|
||||
InterfaceOptionsControlsPanelStickyTargeting:SetValue(1)
|
||||
InterfaceOptionsCombatPanelTargetOfTarget:SetValue(1)
|
||||
InterfaceOptionsDisplayPanelShowTutorials:SetValue(0)
|
||||
InterfaceOptionsDisplayPanelAJAlerts:SetValue(1)
|
||||
InterfaceOptionsSocialPanelProfanityFilter:SetValue(0)
|
||||
InterfaceOptionsSocialPanelSpamFilter:SetValue(0)
|
||||
InterfaceOptionsNamesPanelMyName:SetValue(1)
|
||||
InterfaceOptionsCameraPanelStyleDropDown:SetValue(0)
|
||||
InterfaceOptionsMousePanelClickToMove:SetValue(1)
|
||||
InterfaceOptionsMousePanelClickMoveStyleDropDown:SetValue(0)
|
||||
end
|
||||
|
||||
local frame = CreateFrame("Frame")
|
||||
frame:RegisterEvent("PLAYER_LOGIN")
|
||||
frame:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
frame:SetScript("OnEvent", function(self, event, ...)
|
||||
SetCameraSpeed(shared.config.camera.speed)
|
||||
end)
|
||||
local frame = CreateFrame("Frame")
|
||||
frame:RegisterEvent("PLAYER_LOGIN")
|
||||
frame:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
frame:SetScript("OnEvent", function(self, event, ...)
|
||||
SetCameraSpeed(shared.config.camera.speed)
|
||||
end)
|
||||
|
||||
SlashCmdList["CAMERASETTINGS"] = function(speed)
|
||||
if speed then
|
||||
shared.config.camera.speed = speed
|
||||
end
|
||||
SetCameraSpeed(shared.config.camera.speed)
|
||||
end
|
||||
SLASH_CAMERASETTINGS1 = "/cs"
|
||||
SlashCmdList["CAMERASETTINGS"] = function(speed)
|
||||
if speed then
|
||||
shared.config.camera.speed = speed
|
||||
end
|
||||
SetCameraSpeed(shared.config.camera.speed)
|
||||
end
|
||||
SLASH_CAMERASETTINGS1 = "/cs"
|
||||
|
||||
print("Cyka - Camera settings loaded")
|
||||
print("Cyka - Camera settings loaded")
|
||||
end
|
||||
|
403
Cyka.lua
403
Cyka.lua
@@ -16,7 +16,6 @@ local addonname, shared = ...
|
||||
---@field CameraSettings CameraSettings
|
||||
---@field SpellQSettings SpellQSettings
|
||||
|
||||
|
||||
---@class CykaData
|
||||
|
||||
---@class CykaConfig
|
||||
@@ -44,173 +43,273 @@ 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
|
||||
shared.GetOrDefault = function(table, keys, default)
|
||||
local value = default
|
||||
if not table then
|
||||
return value
|
||||
end
|
||||
if not keys then
|
||||
return value
|
||||
end
|
||||
|
||||
local traverse = table
|
||||
for i = 1, #keys do
|
||||
local key = keys[i]
|
||||
if traverse[key] ~= nil then
|
||||
traverse = traverse[key]
|
||||
else
|
||||
break
|
||||
end
|
||||
local traverse = table
|
||||
for i = 1, #keys do
|
||||
local key = keys[i]
|
||||
if traverse[key] ~= nil then
|
||||
traverse = traverse[key]
|
||||
else
|
||||
break
|
||||
end
|
||||
|
||||
if i == #keys then
|
||||
value = traverse
|
||||
end
|
||||
end
|
||||
return value
|
||||
end
|
||||
if i == #keys then
|
||||
value = traverse
|
||||
end
|
||||
end
|
||||
return value
|
||||
end
|
||||
|
||||
---@param table table
|
||||
---@param depth number?
|
||||
shared.DumpTable = function(table, depth)
|
||||
if not table then
|
||||
print(tostring(table))
|
||||
return
|
||||
end
|
||||
if depth == nil then
|
||||
depth = 0
|
||||
end
|
||||
if (depth > 200) then
|
||||
print("Error: Depth > 200 in dumpTable()")
|
||||
return
|
||||
end
|
||||
for k, v in pairs(table) do
|
||||
if (type(v) == "table") then
|
||||
print(string.rep(" ", depth) .. k .. ":")
|
||||
shared.DumpTable(v, depth + 1)
|
||||
else
|
||||
print(string.rep(" ", depth) .. k .. ": ", v)
|
||||
end
|
||||
end
|
||||
end
|
||||
---@param table table
|
||||
---@param depth number?
|
||||
shared.DumpTable = function(table, depth)
|
||||
if not table then
|
||||
print(tostring(table))
|
||||
return
|
||||
end
|
||||
if depth == nil then
|
||||
depth = 0
|
||||
end
|
||||
if depth > 200 then
|
||||
print("Error: Depth > 200 in dumpTable()")
|
||||
return
|
||||
end
|
||||
for k, v in pairs(table) do
|
||||
if type(v) == "table" then
|
||||
print(string.rep(" ", depth) .. k .. ":")
|
||||
shared.DumpTable(v, depth + 1)
|
||||
else
|
||||
print(string.rep(" ", depth) .. k .. ": ", v)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---@param table table<any, any>
|
||||
---@param value any
|
||||
shared.TableContains = function(table, value)
|
||||
for _, v in pairs(table) do
|
||||
if v == value then return true end
|
||||
end
|
||||
return false
|
||||
end
|
||||
---@param table table<any, any>
|
||||
---@param value any
|
||||
shared.TableContains = function(table, value)
|
||||
for _, v in pairs(table) do
|
||||
if v == value then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
shared.config = {
|
||||
camera = {
|
||||
enabled = shared.GetOrDefault(CykaPersistentData.config, { "camera", "enabled" }, true),
|
||||
speed = shared.GetOrDefault(CykaPersistentData.config, { "camera", "speed" }, 30),
|
||||
},
|
||||
spellQueue = {
|
||||
enabled = shared.GetOrDefault(CykaPersistentData.config, { "spellQueue", "enabled" }, true),
|
||||
queue = shared.GetOrDefault(CykaPersistentData.config, { "spellQueue", "queue" }, 1),
|
||||
},
|
||||
autoloot = {
|
||||
enabled = shared.GetOrDefault(CykaPersistentData.config, { "autoloot", "enabled" }, true),
|
||||
filter = {
|
||||
gold = {
|
||||
enabled = shared.GetOrDefault(CykaPersistentData.config, { "autoloot", "filter", "gold", "enabled" },
|
||||
true),
|
||||
},
|
||||
orderResource = {
|
||||
enabled = shared.GetOrDefault(CykaPersistentData.config,
|
||||
{ "autoloot", "filter", "orderResource", "enabled" }, true),
|
||||
},
|
||||
mount = {
|
||||
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),
|
||||
},
|
||||
profession = {
|
||||
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),
|
||||
},
|
||||
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),
|
||||
},
|
||||
questItem = {
|
||||
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),
|
||||
},
|
||||
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),
|
||||
},
|
||||
ap = {
|
||||
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" }, ""),
|
||||
},
|
||||
everything = {
|
||||
enabled = shared.GetOrDefault(CykaPersistentData.config,
|
||||
{ "autoloot", "filter", "everything", "enabled" }, true),
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
shared.config = {
|
||||
camera = {
|
||||
enabled = shared.GetOrDefault(CykaPersistentData.config, { "camera", "enabled" }, true),
|
||||
speed = shared.GetOrDefault(CykaPersistentData.config, { "camera", "speed" }, 30),
|
||||
},
|
||||
spellQueue = {
|
||||
enabled = shared.GetOrDefault(CykaPersistentData.config, { "spellQueue", "enabled" }, true),
|
||||
queue = shared.GetOrDefault(CykaPersistentData.config, { "spellQueue", "queue" }, 1),
|
||||
},
|
||||
autoloot = {
|
||||
enabled = shared.GetOrDefault(CykaPersistentData.config, { "autoloot", "enabled" }, true),
|
||||
filter = {
|
||||
gold = {
|
||||
enabled = shared.GetOrDefault(
|
||||
CykaPersistentData.config,
|
||||
{ "autoloot", "filter", "gold", "enabled" },
|
||||
true
|
||||
),
|
||||
},
|
||||
orderResource = {
|
||||
enabled = shared.GetOrDefault(
|
||||
CykaPersistentData.config,
|
||||
{ "autoloot", "filter", "orderResource", "enabled" },
|
||||
true
|
||||
),
|
||||
},
|
||||
mount = {
|
||||
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
|
||||
),
|
||||
},
|
||||
profession = {
|
||||
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
|
||||
),
|
||||
},
|
||||
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
|
||||
),
|
||||
},
|
||||
questItem = {
|
||||
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
|
||||
),
|
||||
},
|
||||
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
|
||||
),
|
||||
},
|
||||
ap = {
|
||||
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" },
|
||||
""
|
||||
),
|
||||
},
|
||||
everything = {
|
||||
enabled = shared.GetOrDefault(
|
||||
CykaPersistentData.config,
|
||||
{ "autoloot", "filter", "everything", "enabled" },
|
||||
true
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
shared.Autoloot.Init()
|
||||
shared.CameraSettings.Init()
|
||||
shared.SpellQSettings.Init()
|
||||
shared.Autoloot.Init()
|
||||
shared.CameraSettings.Init()
|
||||
shared.SpellQSettings.Init()
|
||||
|
||||
print("Cyka loaded!")
|
||||
print("Cyka loaded!")
|
||||
end
|
||||
local loaded = 0
|
||||
|
||||
local loadedFrame = CreateFrame("Frame")
|
||||
loadedFrame:RegisterEvent("ADDON_LOADED")
|
||||
loadedFrame:SetScript("OnEvent", function(self, event, addonName)
|
||||
if addonName == addonname then
|
||||
init()
|
||||
end
|
||||
if addonName == addonname then
|
||||
init()
|
||||
end
|
||||
end)
|
||||
|
||||
local ticker
|
||||
ticker = C_Timer.NewTicker(1, function()
|
||||
-- IT JUST WONT FUCKING RUN JUST FUCKING RUN THE FUCKING FUNCTION GOD DAMN IT
|
||||
loaded = loaded + 1
|
||||
init()
|
||||
if loaded > 100 then
|
||||
ticker:Cancel()
|
||||
end
|
||||
end)
|
||||
|
||||
local logoutFrame = CreateFrame("Frame")
|
||||
logoutFrame:RegisterEvent("PLAYER_LOGOUT")
|
||||
logoutFrame:SetScript("OnEvent", function(self, event, ...)
|
||||
CykaPersistentData.config = shared.config
|
||||
CykaPersistentData.config = shared.config
|
||||
end)
|
||||
|
@@ -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"
|
||||
|
@@ -9,4 +9,4 @@ aura_env.QualityColors = {
|
||||
"E6CC80",
|
||||
"00CCFF",
|
||||
}
|
||||
aura_env.ttl = 3
|
||||
aura_env.ttl = 3
|
||||
|
@@ -1,2 +1,2 @@
|
||||
local foo = {1, 2, 3, 4}
|
||||
print(table.contains(foo, 3))
|
||||
local foo = { 1, 2, 3, 4 }
|
||||
print(table.contains(foo, 3))
|
||||
|
Reference in New Issue
Block a user