• 0

    posted a message on Table Help
    Sorry, I was trying to save reading time for the people helping me by only showing the parts of the code I thought were important, especially since I was using someone else's mod. Below is the full code.

    local buffHeader = CreateFrame("Frame", "bBuffs", UIParent, "SecureAuraHeaderTemplate")
    local f = CreateFrame("Frame","bBuff")
    local Dcolor = {r = 1.0, g = 1.0, b = 0.0}
    local barWidth = 190
    local barHeight = 18
    local barScale = 1
    local barAlpha = 1
    local buffAnchorPoint =  "TOP"
    local buffAnchorFrame = PlayerFrameHealthBar
    local buffAnchorFramePoint = "BOTTOM"
    local buffX = -5
    local buffY = -50
    local font = "Fonts\\FRIZQT__.TTF"
    local fontSize = 12
    local texture = "Interface\\TARGETINGFRAME\\barFill2"
    local currentTime, name, count, duration, endTime, spellId, exist
    local color, timeLeft
    local colors = {
     ["RED"] = {r = 0.8, g = 0.0, b = 0.0},
     ["BLUE"] = {r = 0.0, g = 0.0, b = 0.8},
     ["YELLOW"] = {r = 0.8, g = 0.8, b = 0.0},
     ["PURPLE"] = {r = 0.5, g = 0.0, b = 0.5},
     ["GREEN"] = {r = 0.0, g = 0.8, b = 0.0},
     ["ORANGE"] = {r = 1.0, g = 80/255, b = 0.0},
     ["PINK"] = {r = 1, g = 0.3, b = 0.6},
     ["GOLD"] = {r = 1, g = 0.7, b = 0.5},
    }
    local whitelist = {
     -- Rogue
     [1784] = "RED", -- Stealth
    }
    local updateFrequency = 0.1
    local timerFrequency = 1
    buffHeader:SetAttribute("unit", "player")
    buffHeader:SetAttribute("filter", "HELPFUL")
    buffHeader:SetAttribute("template", "BuffButtonTemplate")
    buffHeader:SetAttribute("minWidth", barWidth)
    buffHeader:SetAttribute("minHeight", barHeight)
    buffHeader:SetAttribute("point", "TOPRIGHT")
    buffHeader:SetAttribute("xOffset", 0)
    buffHeader:SetAttribute("yOffset", -barHeight)
    buffHeader:SetAttribute("separateOwn", 0)
    buffHeader:SetAttribute("sortMethod", "NAME")
    buffHeader:SetAttribute("sortDirection","+")
    buffHeader:SetAttribute("wrapAfter",100)
    buffHeader:SetAttribute("wrapXOffset", 0)
    buffHeader:SetAttribute("wrapYOffset", 0)
    buffHeader:SetAttribute("maxWraps", 100)
    buffHeader:SetPoint(buffAnchorPoint, buffAnchorFrame, buffAnchorFramePoint, buffX, buffY)
    buffHeader:SetScale(barScale)
    buffHeader:SetAlpha(barAlpha)
    buffHeader:Show()
    local UnitAura = _G.UnitAura
    local GetTime = _G.GetTime
    local string_format = string.format
    local math_floor = math.floor
    local math_mod = mod
    local string_gsub = string.gsub
    local string_match = string.match
    local function formatTime(timeLeft)
     local hours, minutes, seconds = 0, 0, 0
     if( timeLeft >= 3600 ) then
      hours = math_floor(timeLeft / 3600)
      timeLeft = math_mod(timeLeft, 3600)
     end
     if( timeLeft >= 60 ) then
      minutes = math_floor(timeLeft / 60)
      timeLeft = math_mod(timeLeft, 60)
     end
     seconds = timeLeft > 0 and timeLeft or 0
     if( hours > 0 ) then
      return string_format("%d:%02d:%02d", hours, minutes, seconds)
     elseif (minutes > 0 ) then
      return string_format("%02d:%02d", minutes, seconds)
     else
          return string_format("%02d",seconds)
     end
    end
    local function iter_active_children(self, i)
     i = i + 1
     local child = self:GetAttribute("child" .. i)
     if child and child:IsShown() then
      return i, child, child:GetAttribute("index")
     end
    end
    function buffHeader:ActiveChildren() return iter_active_children, self, 0 end
    local function updateBuffTimer(self, elapsed)
       if self.barUpdate < updateFrequency then
          self.barUpdate = self.barUpdate + elapsed
       else
          name,_,_,_,_,duration,endTime = UnitAura("player", self:GetID(), self.filter)
          if name and duration > 1 then
             currentTime = GetTime()
             self.bar:SetValue(endTime - currentTime)
             self.timer:SetText(formatTime(endTime - currentTime))
          end
          self.barUpdate = 0
       end
       if self.timerUpdate < timerFrequency then
          self.timerUpdate = self.timerUpdate + elapsed
       else
          name,_,_,_,_,duration,endTime = UnitAura("player", self:GetID(), self.filter)
          if name and duration > 1 then
             currentTime = GetTime()
             self.bar:SetValue(endTime - currentTime)
             self.timer:SetText(formatTime(endTime - currentTime))
          end
          self.timerUpdate = 0
       end      
    end
    local function createBar(button)
     button.timerUpdate = 0
     button.barUpdate = 0
     button.filter = ""
     button.bar = CreateFrame("StatusBar", nil, button)
     button.bar:SetHeight(barHeight)
     button.bar:SetWidth(barWidth-barHeight)
     button.bar:SetPoint("TOPRIGHT",button,"TOPRIGHT")
     button.bar:SetStatusBarTexture(texture)
     button.bg = CreateFrame("StatusBar", nil, button)
     button.bg:SetMinMaxValues(0, 1)
     button.bg:SetValue(1)
     button.bg:SetAllPoints(button.bar)
     button.bg:SetFrameLevel(0)
     button.bg:SetStatusBarTexture(texture)   
     button.timer = button.bar:CreateFontString(nil, "OVERLAY")
     button.timer:SetJustifyH("RIGHT")
     button.timer:SetJustifyV("CENTER")
     button.timer:SetPoint("TOPRIGHT", button.bar, "TOPRIGHT", -1, 0)
     button.timer:SetFont(font, fontSize)
     button.timer:SetShadowOffset(1, -1)
     button.timer:SetShadowColor(0, 0, 0, 1)
     button.timer:SetHeight(barHeight)
     button.text = button.bar:CreateFontString(nil, "OVERLAY")
     button.text:SetJustifyH("LEFT")
     button.text:SetJustifyV("CENTER")
     button.text:SetPoint("TOPLEFT", button.bar, "TOPLEFT", 2, 0)
     button.text:SetFont(font, fontSize)
     button.text:SetShadowOffset(1, -1)
     button.text:SetShadowColor(0, 0, 0, 1)
     button.text:SetHeight(barHeight) 
     button.text:SetWidth(barWidth - 40)
    end
    local function updateBar(button, currentTime, auraType)
     name,_, _, count, _, duration, endTime, _, _, _, spellId  = UnitAura("player", button:GetID(), auraType)
     if not button.bar then createBar(button) end
    -- exist = whitelist[spellId]
    -- if exist then
      if name then
       if duration > 0 then
        timeLeft = endTime-currentTime
         button.bar:SetMinMaxValues(0,duration)
         button.bar:SetValue(timeLeft)
         button.timer:SetText(formatTime(timeLeft))
         button:SetScript("OnUpdate",updateBuffTimer)
       else
        button.bar:SetMinMaxValues(0,1)
        button.bar:SetValue(1)
        button.timer:SetText("")
        button:SetScript("OnUpdate",nil)
       end
       if count > 0 then
        button.text:SetFormattedText("%s [%s]",name,count)
       else
        button.text:SetText(name)
       end
      color = colors["GOLD"]
      button.filter = auraType
      button.bar:SetStatusBarColor(color.r, color.g, color.b, 0.80)
      button.bg:SetStatusBarColor(color.r, color.g, color.b, 0.30)
      end
    -- end
    end
    local function updateStyle(self, event, unit)
     if unit == "player" then
      currentTime = GetTime()
      for _,button in buffHeader:ActiveChildren() do updateBar(button, currentTime, "HELPFUL") end
     end
    end
    f:RegisterEvent("UNIT_AURA")
    f:SetScript("OnEvent",updateStyle)


    This is the xml code for it:

    <Ui xmlns="[URL]http://www.blizzard.com/wow/ui/[/URL]" xmlns:xsi="[URL]http://www.w3.org/2001/XMLSchema-instance[/URL]" xsi:schemaLocation="[URL]http://www.blizzard.com/wow/ui/[/URL]
    ..\FrameXML\UI.xsd">
     <Button name="BuffButtonTemplate" inherits="SecureActionButtonTemplate" virtual="true">
      <Size x="190" y="18"/>
      <Attributes>
       <Attribute name="type" value="cancelaura"/>
      </Attributes>
      <Scripts>
       <OnLoad>
        self:RegisterForClicks("RightButtonUp");
       </OnLoad>
       <OnEnter>
        GameTooltip:SetOwner(self, "ANCHOR_BOTTOMLEFT");
        GameTooltip:SetFrameLevel(self:GetFrameLevel() + 2);
        if self:GetAttribute("target-slot") == 16 or self:GetAttribute("target-slot") == 17 or self:GetAttribute("target-slot") == 18 then
         GameTooltip:SetInventoryItem("player", self.slotID);
        else
         GameTooltip:SetUnitAura("player", self:GetID(), "HELPFUL");
        end
       </OnEnter>
       <OnLeave>
        GameTooltip:Hide();
       </OnLeave>
      </Scripts>
     </Button>
    </Ui>
    Posted in: AddOn HELP!
  • 0

    posted a message on Table Help
    The table parts helped, and worked but now I'm getting a filtering/whitelist problem.

    local colors = {
     ["RED"] = {r = 0.8, g = 0.0, b = 0.0},
    }
    local whitelist = {
     [1784] = "RED", -- Stealth
    }


     
    local function createBar(button)
     button.timerUpdate = 0
     button.barUpdate = 0
     button.filter = ""
     button.bar = CreateFrame("StatusBar", nil, button)
     button.bar:SetHeight(barHeight)
     button.bar:SetWidth(barWidth-barHeight)
     button.bar:SetPoint("TOPRIGHT",button,"TOPRIGHT")
     button.bar:SetStatusBarTexture(texture)
     button.bg = CreateFrame("StatusBar", nil, button)
     button.bg:SetMinMaxValues(0, 1)
     button.bg:SetValue(1)
     button.bg:SetAllPoints(button.bar)
     button.bg:SetFrameLevel(0)
     button.bg:SetStatusBarTexture(texture)   
     button.timer = button.bar:CreateFontString(nil, "OVERLAY")
     button.timer:SetJustifyH("RIGHT")
     button.timer:SetJustifyV("CENTER")
     button.timer:SetPoint("TOPRIGHT", button.bar, "TOPRIGHT", -1, 0)
     button.timer:SetFont(font, fontSize)
     button.timer:SetShadowOffset(1, -1)
     button.timer:SetShadowColor(0, 0, 0, 1)
     button.timer:SetHeight(barHeight)
     button.text = button.bar:CreateFontString(nil, "OVERLAY")
     button.text:SetJustifyH("LEFT")
     button.text:SetJustifyV("CENTER")
     button.text:SetPoint("TOPLEFT", button.bar, "TOPLEFT", 2, 0)
     button.text:SetFont(font, fontSize)
     button.text:SetShadowOffset(1, -1)
     button.text:SetShadowColor(0, 0, 0, 1)
     button.text:SetHeight(barHeight) 
     button.text:SetWidth(barWidth - 40)
    end
    local color, timeLeft
    local function updateBar(button, currentTime, auraType)
     name,_, _, count, _, duration, endTime, _, _, _, spellId  = UnitAura("player", button:GetID(), auraType)
     if not button.bar then createBar(button) end
    -- exist = whitelist[spellId]
    -- if exist then
      if name then
       if duration > 0 then
        timeLeft = endTime-currentTime
         button.bar:SetMinMaxValues(0,duration)
         button.bar:SetValue(timeLeft)
         button.timer:SetText(formatTime(timeLeft))
         button:SetScript("OnUpdate",updateBuffTimer)
       else
        button.bar:SetMinMaxValues(0,1)
        button.bar:SetValue(1)
        button.timer:SetText("")
        button:SetScript("OnUpdate",nil)
       end
       if count > 0 then
        button.text:SetFormattedText("%s [%s]",name,count)
       else
        button.text:SetText(name)
       end
      color = colors["GOLD"] --would be exist if the filter above worked
      button.filter = auraType
      button.bar:SetStatusBarColor(color.r, color.g, color.b, 0.80)
      button.bg:SetStatusBarColor(color.r, color.g, color.b, 0.30)
      end
    -- end
    end
     


    If I keep the commented out portions commented out, the mod works fine just not as I want it to function. If I enable the commented out portions, I get the same amount of buffs (Honor Among Theives, Guild Champion, Master of Subtlety, Stealth) but they all show as "stealth" with no accurate time shown. If I change the color line to color = colors[exist], the proper stealth bar is shown as red.

    And since the addon maker may use these forums, I am modifying the existing mod bBuffBars (without permission but only for personal use).
    Posted in: AddOn HELP!
  • 0

    posted a message on Table Help
    I'm trying to use a table to modify an existing addon to only show buffs that I want it to show, to create a whitelist in Lua. All my programming knowledge is from disecting other people's work so I'm terribly lost with this table stuff.

    I want a table like so:

    local cRed = {color stuff}
    whitelist = {}
    whitelist.33763= cRed -- Lifebloom
     
    ---- stuff ----
     
    if spellID == whitelist.spellID then
    **continue with addon**
    color = whitelist.spellID
     


    What I'm trying to get at is for the mod to check if the spell id of the buff its looking at matches one found in a table, and then to take the associated value from that table and since its a predefined variable, set the color of the mod output to that color.

    Am I even close with this? All help greatly appreciated.

    Desc
    Posted in: AddOn HELP!
  • 0

    posted a message on Archaeology x/200
     local Archaeologist = LibStub("AceAddon-3.0"):NewAddon("Archaeologist", "AceEvent-3.0", "AceHook-3.0")
     
    function Archaeologist:OnEnable()
     local Original_ChatFrame_MessageEventHandler = ChatFrame_MessageEventHandler;
     ChatFrame_MessageEventHandler = Archaeologist.ChatFrame_MessageEventHandler
     local ArchList = {
      "398",
      "384",
      "393",
      "400",
      "384",
      "397",
      "401",
      "385",
      "399",
     };
    end
     
    function Archaeologist.ChatFrame_MessageEventHandler(self, event, ...)
     if ((event == "CHAT_MSG_LOOT") then
     end
    end


    Effectively I was looking for something that would simply check if archaeology tokens were looted and then edit the loot string to state that you're currently at x/200 afterwards. I am a very amateur coder and ripped the above starting information from some other mods but I really am in way over my head here.

    The end result would be clean, crisp and report something to this effect:

    YourNameHere receives currency: Night Elf Archaeology Fragment x 6 (105/200)

    Any help in saving me a lot of headache trying to write this and then failing would be appriciated.

    Descartes
    Posted in: Addon Ideas
  • 0

    posted a message on Parrot and Soul of the Dead
    I can't figure out how to have Parrot report a proc of Soul of the Dead. I've tried most conditions for the triggering, but I can't get it to show it since there isn't any "buff" that is gained.

    Please help.
    Posted in: AddOn HELP!
  • 0

    posted a message on Achievement failed mod
    I am under the impression that a mod that tracks whether or not certain achievements have been failed would be a great idea. The only area these would be helpful in would be the heroic or raid aspects of the game. The ability to know I've failed an achievement before I kill a certain boss would be a blessing for those of us trying to get (heroic) Glory to the Raider with it disappearing in 3.1. I think it would be best if it only tracked if you failed if you were actively tracking that achievement.

    Specific fights that I think this would be helpful in would be the following:

    - Kel'Thuzad tracking for abominations
    - If anyone has been hit by a cross charge on Thaddius (though failboat helps with this)
    - Loatheb and spore kills
    - A ice block kill for the first boss in UK

    ... and so on.

    Hopefully others who have actual knowledge of computer code find utility in my idea and bring it to life.

    As always, you are all doing a fine job
    Descartes
    Posted in: Addon Ideas
  • 0

    posted a message on Chinchilla - Minimap addon of awesomeness.
    Quote from Tirdal
    Well, I've poked through the compass LUA code, and tried a few things, but still am having a really wierd problem.

    My map is set to rotate, with the compass points on. When I first start up WoW, the first character I log on with has the compass points fixed (i.e., the north indicator is always at the top, regardless of what direction I'm actually facing.) If I reload the ui, or log out and log in that char or another character, the compass points rotate correctly. This makes *no* sense to me as to why it would behave differently on the first character login vs. subsequent ones, but it's been happening since 3.0.2 was released, and I've seen it enough times to be confident that this is the case.

    Anyone have any ideas? Should I try out SexyMap to see if it does everything I want my minimap to do?


    I'm having the exact same problem, did you or anyone else find a solution? I am almost to the point where I am going to just not have a rotating mini map.
    Posted in: Map/Minimap AddOns
  • 0

    posted a message on FuBar Buff Plugin
    I'm looking to see if anyone would be interested in writing a buff mod for FuBar. In my head, I see it as a cross between something like SkillsPlusFu and Elk's Buff Bar. The plugin would show the amount of buffs I have on the bar itself, and, upon mouseover, would spawn a window that would show the icon, name and duration of all the buffs I had on me. I'd think putting them in categories. Off the top of my head, I'd think you could do consumables, persistant buffs (i.e. tree form or retribution aura) and durational buffs.

    I posted something similar to this in the Elk Buff Bar thread, asking if there would be a way to minimize the bar into FuBar. As a healer, I find enough of my screen's real estate is taken up by everything else I need to watch without having to worry about where my buffs go. I use timer bars to watch my procs and smaller buffs (like barkskin). With the onset of raid wide buffing and how easy that has made ensuring everyone has a buff, I don't need to be hawkish about harping on the horrid mages in my guild for arcane intellect. All I want is a quick mouseover of the plugin at the ready check to ensure I have what I need.

    As for debuffs, I would not use it for this purpose but if other people saw the need, I do not think that the wonderful programers that enrich my gaming experience would have too much difficulty doing that.

    Thank you so much for you consideration,
    Desc
    Posted in: Addon Ideas
  • 0

    posted a message on PitBull 2.0
    Quote from Wintrow2
    I HAVE been thinking of adding an option to PitBull_Aura that fades buffs/debuffs that don't originate from me and then offering that as a ticket. I COULD also add in to actually not show those buffs (which might actually be easier to implement than fading the unwanted).

    I'm just a bit worried I'll lose other valuable information if I HIDE all the other buffs/debuffs...


    Could you make it "per unit type"? That way, you could enable it for the raid frame but have it disabled on your player frame?
    Posted in: Unit Frames
  • 0

    posted a message on PitBull 2.0
    Is there a way to have Pitbull only show buffs that originate from me? I have it filtered to show the types of buff I need but I want it to only show those buffs if they originally come from me. Any ideas?
    Posted in: Unit Frames
  • 0

    posted a message on PitBull 2.0
    Has anyone got an issue where they could not adjust the pitbull settings in rock? It just freezes for me on whatever screen I open into for it. It works with everything but Pitbull.

    Nevermind, problem went away.
    Posted in: Unit Frames
  • 0

    posted a message on ElkBuffBars v2 (finally Ace3 version)
    Is there any way I can minimize this to the fubar plugin? I wish I could use this mod for my buffs but it would be minimized and only appear when I mouse over the fubar plugin as opposed to taking up valuable screen real estate. I don't need to have such an active viewing of my buffs when I have spellreminder keeping track of the short term ones.
    Posted in: General AddOns
  • 0

    posted a message on Healing UI supplement based on debuffs
    I'm looking for a small addon that would show a unitframe of a person if they have a specific, user-identified debuff. I heard grid can do this but I don't use grid, nor do I want to use grid. I use pitbull for raid healing. I'm looking for something that would be apart from that which would create a window that would show my raid members which would have a specific debuff that I would input into it. Life drain, noth's curse, ice block thingy from KT. It doesn't have to even do something if I click on them, I just want it to be seperate and distinct for faster reaction time.

    I guess smartdebuff is a good start for what I'm looking for, I just want to be able to set the debuff I'm looking for and have it hide the unitframes for everyone that doesn't have the debuff.
    Posted in: AddOn HELP!
  • 0

    posted a message on SpellReminder - Official Thread
    I noticed someone mentioning the 7 day limitation to show buffs, any way i can toggle this?
    Posted in: General AddOns
  • 0

    posted a message on IceHUD
    Is there a way to disable the breath bar? As a druid, I find I have very little use for it and I already have it on my Quartz.

    Thanks,
    Desc
    Posted in: Unit Frames
  • To post a comment, please or register a new account.