Guest User

Untitled

a guest
Jul 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.41 KB | None | 0 0
  1. --Config: ReloadUI for any changes to take effect.--
  2. local INTERRUPTOUTPUT = 'Self' --Auto, Say, Self
  3. local SSOUTPUT = 'Self' --Auto, Say, Self
  4. local SELLITEMS = 'On' --On or Off.
  5. local REPAIR = 'On' --No gbank support.
  6. local SSLINK = 'On'
  7. local INTLINK = 'On'
  8. local trash_items = {
  9. "ff9d9d9d" = true,
  10. "Honeymint Tea" = true,
  11. "Sparkling Frostcap" = true,
  12. "Salted Venison" = true,
  13. }
  14.  
  15. --Messages on Login--
  16. if SSLINK=='On' then
  17. DEFAULT_CHAT_FRAME:AddMessage("|cff267EFF Interrupt Link-er: |r"..SSLINK.."|cff267EFF and printing to: |r" .. SSOUTPUT);
  18. end
  19. end
  20. if INTLINK=='On' then
  21. DEFAULT_CHAT_FRAME:AddMessage("|cff267EFF Interrupt Link-er: |r"..INTLINK.."|cff267EFF and printing to: |r" .. INTERRUPTOUTPUT);
  22. else DEFAULT_CHAT_FRAME:AddMessage("|cff267EFF Interrupt Link-er: |r"..INTLINK);
  23. end
  24. DEFAULT_CHAT_FRAME:AddMessage("|cff267EFF Repairing: |r" .. REPAIR.. "|cff267EFF, selling junk: |r" ..SELLITEMS);
  25.  
  26. --Creating Frames--
  27. local Stuff = CreateFrame("Frame")
  28. local MoreStuff = CreateFrame("Frame")
  29.  
  30. local function OnEvent(self, event, ...)
  31. local dispatch = self[event]
  32. if dispatch then
  33. dispatch(self, ...)
  34. end
  35. end
  36. --Register Events--
  37. Stuff:SetScript("OnEvent", OnEvent)
  38. MoreStuff:SetScript("OnEvent", function() MoreStuff_OnEvent(event); end);
  39. Stuff:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
  40. MoreStuff:RegisterEvent("MAIL_SHOW");
  41. MoreStuff:RegisterEvent("BANKFRAME_OPENED");
  42. MoreStuff:RegisterEvent("GUILDBANKFRAME_OPENED");
  43. MoreStuff:RegisterEvent("TRADE_SHOW");
  44. MoreStuff:RegisterEvent("MERCHANT_SHOW");
  45. MoreStuff:RegisterEvent("MERCHANT_CLOSED");
  46.  
  47. function Stuff:COMBAT_LOG_EVENT_UNFILTERED(...)
  48. local inParty = GetNumPartyMembers()
  49. local inRaid = GetNumRaidMembers()
  50. local aEvent = select(2, ...)
  51. local aUser = select(4, ...)
  52. local destName = select(7, ...)
  53. local spellID = select(12, ...)
  54. --Spellsteal Link--
  55. if SSLINK=='On' then
  56. if aUser == UnitName("player") and aEvent== 'SPELL_STOLEN' and SSOUTPUT=='Self' then
  57. print(" => You stole " .. GetSpellLink(spellID) .. " from " ..destName.. ".");
  58. else if aUser == UnitName("player") and aEvent== 'SPELL_STOLEN' and SSOUTPUT=='Say' then
  59. SendChatMessage(" => I stole " .. GetSpellLink(spellID) .. " from " ..destName.. ".", "SAY");
  60. else if aUser == UnitName("player") and aEvent== 'SPELL_STOLEN' and SSOUTPUT=='Auto' then
  61. if (inParty==0) and (inRaid==0) then
  62. print(" => You stole " .. GetSpellLink(spellID) .. " from " ..destName.. ".");
  63. else if (inParty > 0) and (inRaid < 5) then
  64. SendChatMessage(" => I stole " .. GetSpellLink(spellID) .. " from " ..destName.. ".", "PARTY");
  65. else if (inRaid > 5) then
  66. SendChatMessage(" => I stole " .. GetSpellLink(spellID) .. " from " ..destName.. ".", "RAID");
  67. end
  68. end
  69. end
  70. end
  71. end
  72. end end
  73. --Interrupt Link--
  74. if INTLINK=='On' then
  75. if aUser == UnitName("player") and aEvent== 'SPELL_INTERRUPT' and INTERRUPTOUTPUT=='Self' then
  76. print(" => You interrupted " ..destName.. " " ..GetSpellLink(spellID).. ". ");
  77. else if aUser == UnitName("player") and aEvent== 'SPELL_INTERRUPT' and INTERRUPTOUTPUT=='Say' then
  78. SendChatMessage(" => I interrupted " ..destName.. " " ..GetSpellLink(spellID).. ". ", "SAY");
  79. else if aUser == UnitName("player") and aEvent== 'SPELL_INTERRUPT' and INTERRUPTOUTPUT=='Auto' then
  80. if (inParty==0) and (inRaid==0) then
  81. print(" => You interrupted " ..destName.. " " ..GetSpellLink(spellID).. ". ");
  82. else if (inParty > 0) or (inRaid < 5) then
  83. SendChatMessage(" => I interrupted " ..destName.. " " ..GetSpellLink(spellID).. ". ", "PARTY");
  84. else if (inRaid > 5) then
  85. SendChatMessage(" => I interrupted " ..destName.. " " ..GetSpellLink(spellID).. ". ", "RAID");
  86. end
  87. end
  88. end
  89. end
  90. end
  91. end end
  92. end
  93.  
  94. function MoreStuff_OnEvent(event)
  95. --Open Bags--
  96. if (event == "MAIL_SHOW") or (event == "GUILDBANKFRAME_OPENED") or (event == "BANKFRAME_OPENED") or (event == "TRADE_SHOW") or (event == "MERCHANT_SHOW") then
  97. OpenAllBags(true)
  98. end
  99. --Close Bags--
  100. if (event == "MERCHANT_CLOSED") then
  101. CloseAllBags()
  102. end
  103. --Repair--
  104. if REPAIR=='On' then
  105. if (event == "MERCHANT_SHOW") then
  106. if (CanMerchantRepair()) then
  107. repairAllCost, canRepair = GetRepairAllCost()
  108. if (canRepair) then
  109. RepairAllItems();
  110. cost=string.format("%.2f" , repairAllCost / 10000);
  111. DEFAULT_CHAT_FRAME:AddMessage("|cff267EFF Elphie's OMGRepair : All items repaired.|r Cost "..cost.."g");
  112. end
  113. end
  114. end end
  115. --[[
  116. Sell Junk below: want to add more? Just copy this:
  117. (name and string.find(name,"ITEMNAMEHERE""))
  118. Place it before "then" and make sure there's an "or" in between each item. =] "ff9d9d9d" is a gray item.
  119. ]]--
  120. if SELLITEMS=='On' then
  121. if (event == "MERCHANT_SHOW") then
  122. for bag=0,4 do
  123. for slot=1, GetContainerNumSlots(bag) do
  124. local name = GetContainerItemLink(bag,slot)
  125. if (name) then
  126. for k,v in pairs(trash_items) do
  127. if v and name:find(k) then
  128. UseContainerItem(bag,slot)
  129. DEFAULT_CHAT_FRAME:AddMessage("|cff267EFF Selling |r"..name)
  130. end
  131. end
  132. end
  133. end
  134. end
  135. end
  136. end
Add Comment
Please, Sign In to add comment