• 0

    posted a message on problem with GetBattlefiledscore function
    Quote from melchior5387
    there aren't names I use in the addon it's to be clear in the the forum


    He was suggesting that you do this:

    for i=1,GetNumBattlefieldScores() do
            local name,_,_,_,_,_,_,_,class = GetBattlefieldScore(i);  
            if name == CarrierName then
                table.class = class;                             
            end
    end


    strmatch isn't really designed to do what you're using it for. It could potentially give erronious results.....for example

    name = "Babubbu"
    CarrierName = "bubbu"

    strmatch would return something other than nil even though they aren't the same.

    Not saying that's your problem but it's going to be a source of bugs. It's it's very likely that somewhere in that loop or related code it's leading to the issue.

    It would also explain why it "used" to work, which is because you've been lucky with the names of the players in the battlefield!
    Posted in: Lua Code Discussion
  • 0

    posted a message on LibAuraInfo-1.0
    Nope, I wasn't suggested anything. Rather, I was expressing my understanding of your challenges and sharing how I managed them via comm.

    I just thought I'd share in case it generated ideas. For example, the very simple way I detect changes in auras in order to decide that I need to update values.
    Posted in: Libraries
  • 0

    posted a message on Bartender4 - Official Topic
    Quick post to thank you for Bartender. I switched from Macaroon (years of using Macaroon so hopefully this means something to you).

    I enjoy the simplicity and there are just enough options to meet my needs.

    Thank you very much for your efforts and time.
    Posted in: General AddOns
  • 0

    posted a message on Event on Disconnect
    I wasn't the one asking the question, however I did learn thanks to the replies that getting DC'd from the server (so long as the client is running properly) allows your variables to save. So thanks for that!
    Posted in: AddOn HELP!
  • 0

    posted a message on LibGuildBankComm-1.0 Official Thread
    Plus to be honest, it's simpler to handle. I'd rather have more bandwidth and an addon that works reliably than an addon trying to be super super efficient. I've got an addon that tries to be efficient about syncing up during initial logins and it's a pain in the rear.

    Maybe you can revisit this if it ends up becoming a real issue.
    Posted in: Libraries
  • 0

    posted a message on Event on Disconnect
    I'm not sure how you can be less sloppy :) I guess if you never update your db values until you try to catch an event suggesting the client is about to logout. But so far as I know no one does that......then again, you know what they say....:P
    Posted in: AddOn HELP!
  • 0

    posted a message on Event on Disconnect
    Sorry, terminolgy differences. I used the word "disconnect" to mean "crash, internet provider stops, hub stops, power goes out", etc.
    Posted in: AddOn HELP!
  • 0

    posted a message on LibAuraInfo-1.0
    Very interesting concept, I just ran into this lin while wasting some personal time :)

    I have an addon called Hermes where I had to solve this problem, unfortunately my approach won't work for you directly. But maybe it'll help your cause (because a library that handles this well would be very valuable)

    Hermes tracks cooldowns between players using the addon comm channel. I have senders (who send their cooldown information) and receivers (who elect to recieve the cooldown information).

    In the sender code, I setup a timer that fires every 1 second. When the timer is up, every spell the sender is "sending" is inspected via the spellbook and it's current cooldown value (if on cooldown) is gathered.

    The latest cooldown value is then compared to the prior cooldown value to determine if new cooldown messages need to be sent to the receivers:

    1. If the prior cooldown was nil and the new one isn't, then a message needs to be sent.
    2. If the prior cooldown is not nil, and the new one is nil, then nothing needs to be sent (it expired naturally).
    3. If the prior cooldown is not nil, and the new one is not nil, then some extra handling takes place:
    3a) If the new cooldown is greater than the old cooldown, then something caused the cooldown to increase in value, and a message is sent.
    3b) If the new cooldown is less than the old cooldown plus a threshold value (which is currently 5 times the timer duration, or 5 seconds in this case), then something caused the cooldown to decrease in value substantially, and a message is sent.

    So I basically loop through all spells every 1 second to update cooldown status and fire off messages when it looks like it's value changed.

    I'd think you would have to use similar (and it's very simple) logic in your lib while monitoring combatlog events.
    Posted in: Libraries
  • 0

    posted a message on Event on Disconnect
    There is no event raised during a disconnect. And the only time a saved variables db gets written to is when disconnecting properly (logging off, reloading UI, etc). So you're extremely limited in what you can do about it.

    It's just the way things are.
    Posted in: AddOn HELP!
  • 0

    posted a message on LibGuildBankComm-1.0 Official Thread
    I think small bug here, just happened to notice it...
    local k == 16 -- can withdraw gold from the guild bank


    I'm guessing it should be:
    local k = 16 -- can withdraw gold from the guild bank
    Posted in: Libraries
  • 0

    posted a message on NewModule() after addon is loaded
    The first time I delved into the whole module thing it was immediately clear that understand exactly how things load and when would have been very useful for a beginner. I ended up simply running some experiments and finding what I could on the forums to make sure I understood the behavior correctly.
    Posted in: Ace3
  • 0

    posted a message on ButtonFacade (was LibButtonSkin-1.0)
    Hi, just wanted to report back that I was able to achieve the behavior I wanted. I did a few things....

    1. I derived from ActionButtonTemplate (only because it gave all the handy textures names that skins use such as $parentIcon)
    2. I dropped ButtonData completely, not using that table.
    3. Instead of trying to specify what to use as a "disabled" texture (since like you said, skins don't typically use it, which I confirmed by looking at their Lua config) I instead just manually desaturate the texture when needed via button:SetDesaturate(true)

    Those three things solved all my problems with the additional benefit of GREATLY simplifying the code.

    Thanks for your help, it helped me to know my entire approach was faulty and sent me in the right direction.

    Cheers!
    Posted in: General AddOns
  • 0

    posted a message on ButtonFacade (was LibButtonSkin-1.0)
    Thanks StormFX, I'll review what you posted in a day or so and then upload the current state of my addon for possible inspection if I haven't veen able to get anywhere further. I'm pretty sure it'll be something on my end :)

    I probably won't have time again until tomorrow.

    Very much looking forward to solving this!
    Posted in: General AddOns
  • 0

    posted a message on AceConfig - tree groups inside tree groups?
    Here's a dumb idea that might prove useful...I'm not familiar with your options layout to know it it's sensible...

    In your current layout with two layers, on the pane to the right show a button that when clicked opens up a completely new options pane that only contains the level 3+ stuff.

    I realize the two windows aren't modal but maybe it opens up some more ideas for you.
    Posted in: Ace3
  • 0

    posted a message on Detecting if you are in a party
    Quote from wwwDot
    I went past that function so many times and never thought that would be what it was for lol, thanks.

    Also, i can't figure out how to tell if you have no target.... I could only find things that clear your target, but i need the AddOn to know if the target is clear or not.

    Thank in advance.



    I haven't had a need for it but the first thing that comes to mind is UnitName...

    name, realm = UnitName("target")

    I'm guessing it returns nil if no target, and that's how you'd know. Not sure if this works as expected for Mobs/NPC's.
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.