• 0

    posted a message on Pattern Matching (yet again?)
    [ ^.] is supposed to mean - if it existed - either a whitespace or no character at all, that is the end or beginning of a string. Your pattern perfectly matches the sample string provided, however " *" AFAIK means 0 or more whitespaces, so it does not work on something like: str = [[Kvaldir's Vessel, 'The Serpent's Maw']]. I started making a function that loops through the string finding the first occurrence of "'" but not "'s " and the same but starting from the end of the string, although a more elegant solution is still welcome!
    Posted in: Lua Code Discussion
  • 0

    posted a message on Pattern Matching (yet again?)
    The following pattern is giving me a headache lately: I would like to match single quotes preceded by whitespace or none (start of string) followed by a string of any characters and finishing with again a single quote followed by whitespace or none. So basically I am trying to capture the longest possible chain between quotes even if they are at the start or at the end of a string while skipping [['s ]]. Something like:

    local str = [[1st Kvaldir Vessel 'The Serpent's Maw']]
    str = str:match("[ ^.]'.+'[ ^.]")
    print(str)	--->	'The Serpent's Maw'


    Yet sets like [ ^.] don't work, anchoring with ^ and $ is no good obviously and frontier patterns did not help much either. Any suggestions are greatly appreciated!
    Posted in: Lua Code Discussion
  • 0

    posted a message on Grid module options handling
    I am struggling to make an options menu for a custom status module and can't figure out how I should tell Grid to put all the individual status options into grid/status/module/. Shouldn't the following work?
    GridStatusMyModule = GridStatus:NewModule("GridStatusMyModule")
    GridStatusMyModule.menuName = "My Module"
    
    GridStatusMyModule.defaultDB = {
    	debug = false,
            alert_myStatus1 = {
            text = "My Status 1",
            enable = true,
            color = { r = 1, g = 0, b = 0, a = 1 },
            priority = 99,
            range = true,
        },
    	alert_myStatus2 = {
            text = "My Status 2",
            enable = true,
            color = { r = 1, g = 0, b = 0, a = 1 },
            priority = 99,
            range = true,
        },
    }
    
    function GridStatusMyModule:OnInitialize()
    self.super.OnInitialize(self)
    self:RegisterStatus("alert_myStatus1", "My Status 1")
    self:RegisterStatus("alert_myStatus2", "My Status 2")
    end
    


    If instead I do self:RegisterStatus("alert_myStatus1", "My Status 1", nil, true), Grid does place the status options into the root options as expected but grouping them under status/module just does not work. Can someone please help me out here?
    Posted in: AddOn HELP!
  • 0

    posted a message on Auracle - Official Thread
    A small feature suggestion: To allow the user to set up a priority list in trackers based on the order in which auras are entered. This would involve checking against a boolean and if true ignore time based sorting and instead - since self.db.auras is iterated with ipairs - simply put "if auraname == self.update_name then break elseif (name == auraname) then 'do the usual stuff'... " under Tracker.prototype:UpdateAura.

    This would be a nice addition until you decide whether talent scanning is bloat. (Though as Phanx has pointed out making it optional pretty much negates the concern.)
    Posted in: General AddOns
  • 0

    posted a message on Buff tracking trouble!
    SPELL_AURA_REMOVED does fire for when you move Beacon of Light from one player to another. But why watch for such an event in the first place when clevent == "SPELL_AURA_APPLIED" and srcGUID == playerGUID means anyway that the old one is removed and you need to update the bar?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Auracle - Official Thread
    Yeah well that would still require coordinates inside raid instances and arenas, and the trouble of having all the shamans install an addon for such a purpose is beyond its worth I feel. However I wonder, maybe coordinates will be made available with the coming of instance maps in 3.1, don't have PTR char though so that's just wishful thinking.
    Posted in: General AddOns
  • 0

    posted a message on Auracle - Official Thread
    I am trying to put together a range indicator for totems with Auracle and came across a problem: Is there any way to expose whether I am in range of totems that grant no buff? Thought they were simply hidden by BuffFrame but it appears UNIT_AURA is not triggered by them at all. Listening to COMBAT_LOG_EVENT would work for some that do periodic energize or heal but not for Tremor for example.
    Posted in: General AddOns
  • 0

    posted a message on Grid
    Quote from voira
    quick question about bar colors.

    I have the unit health as class color, I can swap fore and background but were can I set the background color? It seems to be black by default but I like it be another colors since the black background blend in with the black background of GRID.

    I hope I make sense:)


    It is only doable by manually editing GridFrame.lua, specifically this line f:SetBackdropColor(0,0,0,1) under the CreateFrames() function. Though if you intend to use the frame alpha indicator the background showing through statusbars will cause problems, solving that took me more than changing a color table.
    Posted in: Grid & Grid2
  • 0

    posted a message on Detecting when a unit's mana pool is full
    Yes I'm doing exacty what you are suggesting, was just hoping I somehow missed an event. Thank you, going to stick with UNIT_MANA then, maybe cut down on features if it turns out to be unreasonably expensive.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Detecting when a unit's mana pool is full
    Hi! Is there a more efficient solution to detecting said condition than using UNIT_MANA or OnUpdate and calling UnitPower() each time? I am trying to put together an addon that collects data about mana regen sources and rates and need to use COMBAT_LOG_EVENT_UNFILTERED anyway but that plus an OnUpdate running at the same time seems overkill for such a small addon :(
    Posted in: Lua Code Discussion
  • 0

    posted a message on LF code review
    Quote from Pastamancer
    Since you have some specific questions, I can address those rather than general coding style which is what I thought you originally wanted (bad practices and such).


    As a beginner when writing the code questions arose every line and by the time I was finished and came here my head was so full of those questions the result was this "blah... so what's the answer to all of those in general?" :p Anyway thanks for the help of all of you, I made some modifications going by your guidelines and the code is becoming cleaner.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Problem with Grid displaying unit name?
    Check all the priorities of statuses assigned to the text indicator, in particular health deficit and its threshold (don't use a value of 100 there). Also make sure color alpha is fine and the status is enabled. If all that dose not help start turning off the assigned statuses except unit name one by one so you can pinpoint the problem.
    Posted in: AddOn HELP!
  • 0

    posted a message on LF code review
    Quote from Pastamancer
    For starters, your addon will only work with an english client. You're using GetSpellInfo to get the buff names, but then you assume that those names are going to be the english version later on when refering to "alert_Lifebloom". Someone using a french client would have "alert_Fleurdevie".


    That is deliberate as unless requested this is not expected to go public, there are already multiple Grid modules for tracking HOTs with more features, this one is tailor made. I used GetSpellInfo not because of easier localization but simply to facilitate adding buffs (by spellID) and being able to feed it to UnitAura() without having to worry about exact wording.
    I will definately read up on the ipairs iterator. A few specific questions that came to mind when writing the code: After a variable has served its purpose is it better to delete it by setting its value to nil or should i just leave it there? Another one: Since tracking Living Seeds value involves registering for COMBAT_LOG_EVENT_UNFILTERED I put in a sanity check to see if the talent is there at all yet the information does not seem to be available by the time the module receives OnStatusEnable. Is it fine to solve this with a scheduled event or are there better solutions to this? And lastly I was uncertain about this function called by COMBAT_LOG_EVENT_UNFILTERED:

    function GridStatusDruid:SeedValue(...)
    	
    	local _, eventtype, srcGUID = select(1, ...)
    	
    	if eventtype == "SPELL_HEAL" and srcGUID == UnitGUID("player") then
    	
    		local timestamp, eventtype, srcGUID, srcName, srcFlags, guid, dstName, dstFlags, spellID, spellName, spellschool, healAmount, overhealAmount, critical = select(1, ...)
    			
    		if critical and string.find("Regrowth Nourish Healing Touch Swiftmend", spellName) then ...do the rest
    


    As this function is called quite frequently in a raid, performance wise is it better to assign local variables to all the received parameters straight ahead or the current implementation is fine or it does not make any difference?
    Posted in: Lua Code Discussion
  • 0

    posted a message on LF code review
    Hi!

    I would like to ask for some help (surprise) concerning a piece of code I have written (well, copy pasted for the most part:) ). It is a Grid status module and is working as intended yet I have never learnt programming nor have I ever tried it before and would like to ask someone experienced enough to scan through the code and point out any huge mistakes, bad practices or things that may be unreasonably heavy on system resources. Niceties and minuscule improvements are irrelevant as at this level my priority was to get it working but I would appreciate greatly if someone could point out the obvious mistakes. It is basically a rewrite of GridStatusHOTs with all the stuff I don't use wiped out and with the scanning and updating methods borrowed from GridStatusLifebloom so all credits are due to the respective authors and of course Maia and Pastamancer :) Thank you for the help in advance!

    http://code.google.com/p/gridstatusdruid/source/browse/trunk/GridStatusDruid.lua
    Posted in: Lua Code Discussion
  • 0

    posted a message on GridStatusHots -> Shows your HoT(s) remaing time and total HoTs
    Is the present buff scanning method here to stay or are you planning on making it a tad more efficient in the near future? Asking this because I like to rid addons of code that is not relevant for me and if changes are soon to come I won't bother with it just now.
    Posted in: Grid & Grid2
  • To post a comment, please or register a new account.