• 0

    posted a message on Monitor the focus' target
    Did you include the conditional like Xinhuan said?
    if (arg1 == "focus") then
    	-- check and report here
    end


    arg1 is always the unit id which changed its target.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Can't UnregisterEvent in event handler?
    You could get away with:
    local OldCollapseSkillHeader = CollapseSkillHeader
    function CollapseSkillHeader(index, ...)
    	local ret = {OldCollapseSkillHeader(index, ...)}
    	self:UpdateSkills()
    	return unpack(ret)
    end

    Though I have no clue if it's overly expensive.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Actionbar buttons
    Quote from Joex000
    What if you did something like this

    to avoid OnUpdate having to run constantly?


    If you check the FrameXML file, you can see how Blizzard does it for their actionbars. Just do a find for "ActionButton_UpdateCooldown", which is the function that calls the cooldown update. They did register it to ACTIONBAR_UPDATE_COOLDOWN like you did, but it is also called in ActionButton_Update, which itself is called on ACTIONBAR_SLOT_CHANGED and PLAYER_ENTERING_WORLD.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Getting current difficulty
    Quote from Nevcairiel
    The "25 Heroic" mode is only used for TotC Heroic, as the whole instance can be set to heroic. ICC uses the new "dynamic heroic" mode, as mangeg describes in his code snippet. You'll have to use that, for more reference look up the code that actually creates the flag on the minimap, it uses the same data too.

    That's pretty much what I was looking for. Thanks for the clarification.

    Here's my new snippet to turn the current instance into the 1-4 difficulty number no matter the instance.

    local _, _, diff, _, _, dynHeroic, dynFlag = GetInstanceInfo(); 
    diff = (dynFlag and (2-(diff%2)+2*dynHeroic)) or diff; 


    As far as I can tell, it works fine. Thanks for all the input along the way too.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Getting current difficulty
    It actually didn't in my case. In the same instance when I tried the three functions I reported, GetInstanceInfo() returned

    "Icecrown Citadel", "raid", 2, "25 Player", 25, 1

    when I was in heroic. The only thing that was consistent across the other members of the raid was the minimap difficulty flag thing, which I believe uses the second last parameter of GetInstanceInfo() like I used in my code. The only other place the default UI tells you the difficulty is in the drop down player menu, which was correct for me as the leader, obviously, and is why my GetRaidDifficulty() returned 2, 4. Everyone else's GetRaidDifficulty() was 1, 2, but it really didn't matter since they can't see that part of the drop down.

    However, looking at the return values that you posted Silmano, if that is in fact whether that variable is a flag for heroic, or something that will only function in Icecrown, given that it is the only "dynamicDifficulty" instance. I will have to test it in another instance to be sure.

    Check out the beginning of MiniMapInstanceDifficulty_OnEvent on Minimap.lua, and I think that is how they figure out whether to display a "skull" on the flag or not.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Getting current difficulty
    Okay, after playing some more I noticed the difficulty parameter on GetInstanceInfo() is also functioning in the same way. My best guess is this is bugged, but here is what I'm currently using as a workaround. If it's wrong or if there's something simpler, let me know.

    local _, _, diff, _, _, hero = GetInstanceInfo();
    if (diff < 3) then
    	diff = diff + hero*2;
    end
    Posted in: Lua Code Discussion
  • 0

    posted a message on Getting current difficulty
    I am in ICC 25 right now, and I have no clue how to get the current difficulty. I remember reading how GetInstanceDifficulty used to be bugged, but here is the results of a few functions:

    Current mode: 25 (Heroic) via minimap and dropdown
    GetDungeonDifficulty() = 1, 1
    GetRaidDifficulty() = 2, 4
    GetInstanceDifficulty() = 2

    Everything I've read says 4 = Heroic 25, which is what I want. I thought it would be select(2, GetRaidDifficulty()), but I had the rest of my raid dump the value and they all got 2, 1 instead of my results.

    Edit: When flying back after releasing, GetRaidDifficulty() returned 4, 4 which sounds like the correct result. When I zoned back in, it returned to 2, 4. Note that this is ICC and I changed the difficulty to Heroic after we all zoned in originally.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Convenient method to handle Combat Log events?
    I'm building this addon which is basically like my own custom boss mods, since I often find myself writing little snippets mid-raid to handle things that other mods don't cover. I have this set up so creating a module and code is extremely easy and convenient.

    One problem I have not found an elegant solution to is the combat log event, which is 90% of what my modules are based around. Ideally, I will be able to access the different elements with named indexes that work no matter what event it is. For example, "amount" would refer to arg9 in SWING_DAMAGE and arg12 in SPELL_DAMAGE.

    My first take on it was to create and eventually return a table and use if statements to generate the relevant keys and their respective values based on what event it was. However, I was pretty worried that this would be very expensive based on the amount of combat log entries that can occur in a single second in a 25 player raid, considering a single event could be up to 17 string comparisons and 20 variable creations and assignments.

    Another method I thought of was to use metatables (__index?) so that upon access, it would branch and figure out which argument "amount" should return.

    I'm not too experienced with evaluating performance of addon code, but I figured I would throw this out to you guys and see if you had any suggestions on how to handle this matter. If there is no solution that will not compromise efficiency too much, then I will have to resort to doing the work in each module.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Combat Log Inconsistencies
    Thanks for the response. Looking at the data from Tuesday's PTR raid, the problem still exists. I'm not quite sure how to go about reporting it.

    SPELL_SUMMON is a good idea, I hadn't thought about it that way. The only problem I can foresee is if the guardian was summoned out of range or before a reloadui, in which case it wouldn't know. I had considered setting up a GUID table of guardians that had flags set as in-group and just referencing that first, but then if the first flag that a unit fires is a false one, this method won't work either. I had also considered making a running list of all npc ids to filter, but there may be a lot more than I can manage. I may have to do the latter anyway (to some extent) because of greater elementals, as I did not realize they were counted this way.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Combat Log Inconsistencies
    I'm writing an addon that scans combat log lines and disregards all sources that are player controlled, i.e., bit.band(srcFlags, 0x0200) must not be 0. However, during actual testing, I found some pets and totems sneaking in, and doing a thorough search of the combat log, found some weird stuff. I bolded and underlined the flags so you can see more easily.
    For your convenience: http://www.wowwiki.com/UnitFlag

    1. Ghoul attacks. Notice the first few all have a CAST_SUCCESS followed by a DAMAGE, but then it breaks into three consecutive DAMAGEs with a different srcFlag, though the GUID is the same.
    39:36.430  SPELL_CAST_SUCCESS,0xF1406521480000D4,"Ribslicer",[u][b]0x1114[/b][/u],0xF1300076F100140B,"Vesperon",0x10a48,47468,"Claw",0x1
    39:36.534  SPELL_DAMAGE,0xF1406521480000D4,"Ribslicer",[b][u]0x1114[/u][/b],0xF1300076F100140B,"Vesperon",0x10a48,47468,"Claw",0x1,979,0,1,0,0,0,1,nil,nil
    39:40.423  SPELL_CAST_SUCCESS,0xF1406521480000D4,"Ribslicer",[b][u]0x1114[/u][/b],0xF1300076F100140B,"Vesperon",0x10a48,47468,"Claw",0x1
    39:40.528  SPELL_DAMAGE,0xF1406521480000D4,"Ribslicer",[b][u]0x1114[/u][/b],0xF1300076F100140B,"Vesperon",0x10a48,47468,"Claw",0x1,557,0,1,0,0,0,nil,nil,nil
    40:16.716  SPELL_DAMAGE,0xF1406521480000D4,"Ribslicer",[b][u]0x1228[/u][/b],0xF1300077DA00142C,"Onyx Flight Captain",0x8000a48,47468,"Claw",0x1,361,0,1,0,0,0,nil,nil,nil
    40:17.796  SPELL_DAMAGE,0xF1406521480000D4,"Ribslicer",[b][u]0x1228[/u][/b],0xF1300077DA00142C,"Onyx Flight Captain",0x8000a48,47468,"Claw",0x1,374,0,1,0,0,0,nil,nil,nil
    40:21.837  SPELL_DAMAGE,0xF1406521480000D4,"Ribslicer",[b][u]0x1228[/u][/b],0xF1300077DA00142C,"Onyx Flight Captain",0x8000a48,47468,"Claw",0x1,379,0,1,0,0,0,nil,nil,nil


    2. Mana Spring Totem, this is directly after a new one was summoned, so I don't know if it is because of that fact, but it starts out with the incorrect flags.
    40:17.788  SPELL_PERIODIC_ENERGIZE,0xF1300079D60016DA,"Mana Spring Totem VIII",[b][u]0xa28[/u][/b],0x0000000002074A6B,"Xavaire",0x512,52032,"Mana Spring Totem",0x20,43,0
    40:17.788  SPELL_PERIODIC_ENERGIZE,0xF1300079D60016DA,"Mana Spring Totem VIII",[b][u]0xa28[/u][/b],0x000000000144852F,"Sporq",0x512,52032,"Mana Spring Totem",0x20,43,0
    40:17.788  SPELL_PERIODIC_ENERGIZE,0xF1300079D60016DA,"Mana Spring Totem VIII",[b][u]0xa28[/u][/b],0x000000000131BAE9,"Triik",0x512,52032,"Mana Spring Totem",0x20,43,0
    40:19.746  SPELL_PERIODIC_ENERGIZE,0xF1300079D60016DA,"Mana Spring Totem VIII",[b][u]0x2112[/u][/b],0x0000000002074A6B,"Xavaire",0x512,52032,"Mana Spring Totem",0x20,42,0
    40:19.746  SPELL_PERIODIC_ENERGIZE,0xF1300079D60016DA,"Mana Spring Totem VIII",[b][u]0x2112[/u][/b],0x000000000144852F,"Sporq",0x512,52032,"Mana Spring Totem",0x20,43,0
    40:19.746  SPELL_PERIODIC_ENERGIZE,0xF1300079D60016DA,"Mana Spring Totem VIII",[b][u]0x2112[/u][/b],0x000000000131BAE9,"Triik",0x512,52032,"Mana Spring Totem",0x20,43,0


    Other units that have had this problem: Shadowfiend, Desecrated Ground, Cat, Healing Stream Totem, and a Warlock Pet.
    Thanks to anyone who took the time to look through this. I'm hoping that either I'm overlooking a workaround or I'm just plain stupid and there is an obvious solution.
    Posted in: Lua Code Discussion
  • 0

    posted a message on EavesDrop 2.0 (a SCT style combat log)
    Is there any current way that I can filter out Fireball ticks? Any plans to add a damage filter to match the healing and power gain filters? Or what about custom spell filtering by name? The second one actually wouldn't help me now that I think about it unless you were also able to specify the type (periodical, etc), but I can't think of too many other instances where this would be helpful.
    Posted in: General AddOns
  • 0

    posted a message on ItemValue
    A few bugs with their fixes:

    I downloaded this the other day and it was really buggy. I was getting all these errors and it made some tooltips not work and a bunch of other things. Today I sat down and looked at the code, and I finally realized why. Also, LOL.
    I have a pair of Ruby Slippers. Ever since I got them, I destroyed my hearthstone, so it has never been in my cache. Your GetItemInfo where you insert gems into the hearthstone returns nil every time. I opened up LootLink and forced it to fetch Hearthstone from the server, and now it works flawlessly...
    Is there anyway you can force it to fetch Hearthstone if it isn't in the user's cache? I presume this could also be an issue for shaman who do the same as I did because of Astral Recall. Otherwise I will have to use lootlink every time a patch comes out, which isn't a big deal, but still.

    --

    Also, I'm getting the same issue with the "Duplicate Sets" on startup as lymphatik, and I built my one set with the DrDamage addon. Didn't really look into this, as it doesn't seem to be too much of an error.

    --

    LAST thing to report. I was getting some errors saying "#BestJewelYellow is 0," while using the BestJewel feature, so I went to investigate. This is also the cause of lymphatik's bestjewel problem. And the fix! On line 1346, you start a series of if-elseifs; however, the else does not account for gems of multiple colors. This means that if it picks an orange gem in the loop, it will call it red and that's it, where it should be sticking it into TWO tables: the red and yellow. I changed them to 4 individual if statements and it works for me :)

    --

    Excellent mod, I will find a lot of use out of this.
    Posted in: General AddOns
  • 0

    posted a message on Grid
    One thing I wanted to throw out there and see if anyone else was experiencing such effects was that whenever I mouseover someone on Grid, one of two things happen. If I AM targeting something, anything, then the tooltip will display the same that would be displayed if I moused over my own unit frame or the targets, where it talks about right clicking for more options. If I have no target, however, the tooltips work just fine. I'm using a ton of addons, and I was wondering if this was an external problem or a Grid problem. Thanks.
    Posted in: Grid & Grid2
  • 0

    posted a message on Grid
    Quote from Pastamancer »
    I use Clique to do that.

    As do I now, thanks a lot! My compliments to you and your partner(s) on Grid, it works as perfectly as I ever wanted something of its nature to.
    Posted in: Grid & Grid2
  • 0

    posted a message on Grid
    I was going to request a feature, but I had to be sure that it was possible first. I was wondering if the frames were able to be clicked (with any given mouse button) and could have your character cast a specific spell on that player depending on what mouse button was clicked. Ex: Left - Renew, Right - Flash Heal, Side1 - Dispel Magic, Side2 - Remove Disease, etc.

    I know SmartDebuff does this, but they appear to use SecureActionButtons and I wasn't sure if this is why they were able to make this. I havn't read up on the new limitations and whatnot of the secure frame templates yet.
    Posted in: Grid & Grid2
  • To post a comment, please or register a new account.