wow-addons/z-AutoCoin/AutoCoin.lua

45 lines
1.1 KiB
Lua
Raw Permalink Normal View History

2020-05-11 18:08:45 +02:00
AutoCoin = {}
AutoCoin.title = GetAddOnMetadata("AutoCoin", "Title")
AutoCoin.version = GetAddOnMetadata("AutoCoin", "Version")
AutoCoin.author = GetAddOnMetadata("AutoCoin", "Author")
print(("Loaded %s v%s by %s."):format(AutoCoin.title, AutoCoin.version, AutoCoin.author))
local coinAndBijouRolls = {
[19698] = 1, -- 0=Pass, 1=Need, 2=Greed
[19699] = 1,
[19700] = 1,
[19701] = 1,
[19702] = 1,
[19703] = 1,
[19704] = 1,
[19705] = 1,
[19706] = 1,
[19707] = 1,
[19708] = 1,
[19709] = 1,
[19710] = 1,
[19711] = 1,
[19712] = 1,
[19713] = 1,
[19714] = 1,
[19715] = 1
}
local rolls = {
[0] = "Pass",
[1] = "Need",
[2] = "Greed"
}
local frame = CreateFrame("FRAME");
frame:RegisterEvent("START_LOOT_ROLL");
frame:SetScript("OnEvent", function(self, event, rollID, rollTime)
local link = GetLootRollItemLink(rollID)
local _, itemID = strsplit(":", link)
local roll = coinAndBijouRolls[tonumber(itemID)]
if roll ~= nil then
print(("|cff00ffffAutoCoin|r: %s %s."):format(rolls[roll], link))
RollOnLoot(rollID, roll)
end
end);