Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Config: ReloadUI for any changes to take effect.--
- local INTERRUPTOUTPUT = 'Self' --Auto, Say, Self
- local SSOUTPUT = 'Self' --Auto, Say, Self
- local SELLITEMS = 'On' --On or Off.
- local REPAIR = 'On' --No gbank support.
- local SSLINK = 'On'
- local INTLINK = 'On'
- local trash_items = {
- "ff9d9d9d" = true,
- "Honeymint Tea" = true,
- "Sparkling Frostcap" = true,
- "Salted Venison" = true,
- }
- --Messages on Login--
- if SSLINK=='On' then
- DEFAULT_CHAT_FRAME:AddMessage("|cff267EFF Interrupt Link-er: |r"..SSLINK.."|cff267EFF and printing to: |r" .. SSOUTPUT);
- end
- end
- if INTLINK=='On' then
- DEFAULT_CHAT_FRAME:AddMessage("|cff267EFF Interrupt Link-er: |r"..INTLINK.."|cff267EFF and printing to: |r" .. INTERRUPTOUTPUT);
- else DEFAULT_CHAT_FRAME:AddMessage("|cff267EFF Interrupt Link-er: |r"..INTLINK);
- end
- DEFAULT_CHAT_FRAME:AddMessage("|cff267EFF Repairing: |r" .. REPAIR.. "|cff267EFF, selling junk: |r" ..SELLITEMS);
- --Creating Frames--
- local Stuff = CreateFrame("Frame")
- local MoreStuff = CreateFrame("Frame")
- local function OnEvent(self, event, ...)
- local dispatch = self[event]
- if dispatch then
- dispatch(self, ...)
- end
- end
- --Register Events--
- Stuff:SetScript("OnEvent", OnEvent)
- MoreStuff:SetScript("OnEvent", function() MoreStuff_OnEvent(event); end);
- Stuff:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
- MoreStuff:RegisterEvent("MAIL_SHOW");
- MoreStuff:RegisterEvent("BANKFRAME_OPENED");
- MoreStuff:RegisterEvent("GUILDBANKFRAME_OPENED");
- MoreStuff:RegisterEvent("TRADE_SHOW");
- MoreStuff:RegisterEvent("MERCHANT_SHOW");
- MoreStuff:RegisterEvent("MERCHANT_CLOSED");
- function Stuff:COMBAT_LOG_EVENT_UNFILTERED(...)
- local inParty = GetNumPartyMembers()
- local inRaid = GetNumRaidMembers()
- local aEvent = select(2, ...)
- local aUser = select(4, ...)
- local destName = select(7, ...)
- local spellID = select(12, ...)
- --Spellsteal Link--
- if SSLINK=='On' then
- if aUser == UnitName("player") and aEvent== 'SPELL_STOLEN' and SSOUTPUT=='Self' then
- print(" => You stole " .. GetSpellLink(spellID) .. " from " ..destName.. ".");
- else if aUser == UnitName("player") and aEvent== 'SPELL_STOLEN' and SSOUTPUT=='Say' then
- SendChatMessage(" => I stole " .. GetSpellLink(spellID) .. " from " ..destName.. ".", "SAY");
- else if aUser == UnitName("player") and aEvent== 'SPELL_STOLEN' and SSOUTPUT=='Auto' then
- if (inParty==0) and (inRaid==0) then
- print(" => You stole " .. GetSpellLink(spellID) .. " from " ..destName.. ".");
- else if (inParty > 0) and (inRaid < 5) then
- SendChatMessage(" => I stole " .. GetSpellLink(spellID) .. " from " ..destName.. ".", "PARTY");
- else if (inRaid > 5) then
- SendChatMessage(" => I stole " .. GetSpellLink(spellID) .. " from " ..destName.. ".", "RAID");
- end
- end
- end
- end
- end
- end end
- --Interrupt Link--
- if INTLINK=='On' then
- if aUser == UnitName("player") and aEvent== 'SPELL_INTERRUPT' and INTERRUPTOUTPUT=='Self' then
- print(" => You interrupted " ..destName.. " " ..GetSpellLink(spellID).. ". ");
- else if aUser == UnitName("player") and aEvent== 'SPELL_INTERRUPT' and INTERRUPTOUTPUT=='Say' then
- SendChatMessage(" => I interrupted " ..destName.. " " ..GetSpellLink(spellID).. ". ", "SAY");
- else if aUser == UnitName("player") and aEvent== 'SPELL_INTERRUPT' and INTERRUPTOUTPUT=='Auto' then
- if (inParty==0) and (inRaid==0) then
- print(" => You interrupted " ..destName.. " " ..GetSpellLink(spellID).. ". ");
- else if (inParty > 0) or (inRaid < 5) then
- SendChatMessage(" => I interrupted " ..destName.. " " ..GetSpellLink(spellID).. ". ", "PARTY");
- else if (inRaid > 5) then
- SendChatMessage(" => I interrupted " ..destName.. " " ..GetSpellLink(spellID).. ". ", "RAID");
- end
- end
- end
- end
- end
- end end
- end
- function MoreStuff_OnEvent(event)
- --Open Bags--
- if (event == "MAIL_SHOW") or (event == "GUILDBANKFRAME_OPENED") or (event == "BANKFRAME_OPENED") or (event == "TRADE_SHOW") or (event == "MERCHANT_SHOW") then
- OpenAllBags(true)
- end
- --Close Bags--
- if (event == "MERCHANT_CLOSED") then
- CloseAllBags()
- end
- --Repair--
- if REPAIR=='On' then
- if (event == "MERCHANT_SHOW") then
- if (CanMerchantRepair()) then
- repairAllCost, canRepair = GetRepairAllCost()
- if (canRepair) then
- RepairAllItems();
- cost=string.format("%.2f" , repairAllCost / 10000);
- DEFAULT_CHAT_FRAME:AddMessage("|cff267EFF Elphie's OMGRepair : All items repaired.|r Cost "..cost.."g");
- end
- end
- end end
- --[[
- Sell Junk below: want to add more? Just copy this:
- (name and string.find(name,"ITEMNAMEHERE""))
- Place it before "then" and make sure there's an "or" in between each item. =] "ff9d9d9d" is a gray item.
- ]]--
- if SELLITEMS=='On' then
- if (event == "MERCHANT_SHOW") then
- for bag=0,4 do
- for slot=1, GetContainerNumSlots(bag) do
- local name = GetContainerItemLink(bag,slot)
- if (name) then
- for k,v in pairs(trash_items) do
- if v and name:find(k) then
- UseContainerItem(bag,slot)
- DEFAULT_CHAT_FRAME:AddMessage("|cff267EFF Selling |r"..name)
- end
- end
- end
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment