• 0

    posted a message on detecting spells cast with CLEU
    if you're hoping to find what enemies are casting at you/party members, then you're going to be disappointed. CLEU doesn't fill in these fields for enemies with SPELL_CAST_START. they ARE filled in for the SPELL_CAST_COMPLETE, tho. for friendlies, you get data for targets on all events i believe.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Skillet - the lilsparky branch
    fwiw, there is no more "lilsparky branch". yossa has taken over skillet and merged the lilsparky branch into the main branch. i've since moved on to gnomeworks (which, btw, works with runeforging).
    Posted in: General AddOns
  • 0

    posted a message on Read guild tradeskill links
    no. the guild trade skills are NOT implemented thru trade links. and the GetTradeSkillListLink() function does not return a valid link when viewing a guild trade skill via the new guild trade skill viewing function.

    very lame. i saw that mining was finally "linkable" via the guild profession system only to find it's not really. you can open and view the skills, but you do so with a new api call that requests the trade skill data (ie, it results in TRADE_SKILL_* events firing.

    edit: of course, you could *create* a valid trade link by iterating over the trade skill list once a trade skill was opened... it's something i intend to do when i get back to development on gyp. a guild "import" kind of function.
    Posted in: Lua Code Discussion
  • 0

    posted a message on GnomeWorks -- official thread
    yeah, the skill selection routine is not ideal. what's happening is that the selected skill is being reset when it's done scanning. since scanning might take a while to truly complete, you might be in the middle of something else when gw resets itself.

    i'm working on some of the selection code right now so i'll see if i can make that problem go away. it was a bit of hack when i moved to an asynchronous update system instead of just blocking until everything was ready.
    Posted in: General AddOns
  • 0

    posted a message on .lua working with numbers
    Quote from OrionShock
    prolly not..



            local gold = guild:match(goldLoot) or 0
            local silver =     guild:match(silverLoot) or 0
            local copper = guild:match(copperLoot) or 0
    
            local currentTotal = (gold*1000) + (silver*100) + copper
    oh yes, you can mix logic and math together like that :)


    it's not the logic i was concerned about, it was the use of strings in math operations. i guess lua does an implied "tonumber()" on math operands? i wasn't sure. i know i've gone absolutely crazy pulling "numbers" from strings and using them as things like table indices and couldn't for the life of me figure out why things weren't working right.
    Posted in: Lua Code Discussion
  • 0

    posted a message on .lua working with numbers
    fwiw, you probably need a few "tonumber()"s in there to convert your string selections to numbers.
    Posted in: Lua Code Discussion
  • 0

    posted a message on How to display the "Standard" tooltip?
    GameTooltip:SetHyperlink() is what you're likely after.

    the tooltip functions are generally hooked by other mods so that after one of the various special tooltip Set methods are called, these mods will be invoked.

    check out the GameTooltip widget type at wowpedia. http://www.wowpedia.org/Widget_API#GameTooltip
    Posted in: Lua Code Discussion
  • 0

    posted a message on superscript
    how cool would it be to have a generic in-game scripting language that would handle casting times, protected functions, if-then and loop constructs, events, etc.

    for example, you could script out a generic series of actions that takes place under a particular condition (for example, 2v2 arenas).

    cast healthstone
    trade party1 healthstone
    cast healthstone
    cast summon felhunter
    cast soul link
    pet set passive


    when needed, a "continue" popup would show up and clicking would do the next protected action.

    obviously, this wouldn't be used for combat but rather for the set up prior to combat.
    Posted in: Addon Ideas
  • 0

    posted a message on GnomeWorks -- official thread
    the sorting is currently a bit sketchy due to columns being enabled/disabled and confusing the sorting mechanics. try hard-disabling the skillup% column (from the plugins submenu) and reload to see if it helps.
    Posted in: General AddOns
  • 0

    posted a message on DrDamage - Official Thread
    Quote from Headhuntress
    I have to mention that when I tried to put the "PW:S" part after "all" it didn't work but in front of it made it work.


    because it's incorrect syntax. adding the comma and the "All" reference isn't being applied to the list of spells, it's a new field for the table with no reference to any drd key.
    Posted in: General AddOns
  • 0

    posted a message on Detect if my tradeskill window is opened
    under cata, you should also check "IsTradeSkillGuild()" to see if the trade frame is viewing the guild-wide trade skills.

    personally, i would assume viewing a link of your own trade skill would be considered as not viewing your trade skill since it's likely the only reason you'd do so is to spoof a tradelink bitmap.
    Posted in: Lua Code Discussion
  • 0

    posted a message on local x = x VS local x = _G.x
    the latter just assures that you get the global version of the function in cases where you might have strfind already defined as a local in a "parent" scope. can't think it'd make any difference in the first few lines of an addon...

    personally, i find all of that local = global stuff kind of gratuitous.
    Posted in: Lua Code Discussion
  • 0

    posted a message on [Ace3] Options GUI
    "self" is a special local variable inside of a function invoked via the "table:function()" paradigm. it is assigned to be equal to the "table" portion of the function call. in code:

    function myAddon:myFunction(arg1,arg2)
    ...
    end

    is the same as:
    function myAddon.myFunction(self, arg1, arg2)
    ...
    end


    and
    local x = myAddon:myFunction(a,b)


    is equivalent to:

    local x = myAddon.myFunction(myAddon, a,b)


    so basically, "self" is only valid inside of a function defined via the table:function method unless it's explicitly defined.

    you have two "self" references are outside of a function, so they're just normal variable references. since you don't define "self" as a local anywhere, it's looking for a global named self which doesn't exist.

    judging by your code, you should probably substitute the "Tql" table in place of the "self" reference in your final two lines.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Postponing BAG_UPDATE processing to the next frame
    you're probably better off with a larger delay than a single frame. i went with a generic timer system myself. when i get a bag update, i check to see if i have a timer running and if i do, i reset it to its full duration. otherwise, i create a new timer with something like a .1 or .25 second delay. the timer executes by processing function when it's expired.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Number format with commas
    Quote from Ketho
    b = string.match(string.format("%.1f",1/5),"([^0-9])")
    a = b=="." and "," or "."
    very offtopic: I'm confused by this programming logic/syntax
    This is what my logic thinking says it is:
    a = true and "something" or "somethingElse"
    I saw this kind of stuff before, but never understood it.
    Is this from Lua specifically and is there any doc/info about this "logic"?
    I mean, normally there is something like:
    if (a and b) or c then
       --doStuff
    end


    yeah, the boolean stuff in lua is a bit quirky, but pretty nice. i'm with you that it seems odd because i'm used to such logic operations as being either true of false. in lua, they actually retain their value/type.

    "a = 5 or 6" results in a = 5
    "a = 5 and 6" results in a = 6
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.