• 0

    posted a message on Problem with config mode
    Quote from Pakze
    Don't know wich browsers you use, but on Firefox and Chrome it doesn't look good.
    Copied the code and edited it in browser just to make it more readable.
    Edited it, so now it's with tabs instead of spaces.
    Looks fine for me in Firefox.
    Quote from Pakze
    There is one difference in the code however, added brackets in the two AND OR statements.

    "a AND b OR c" to "a AND ( b OR c)"
    Except, you changed the meaning of the statements.

    "a AND b OR c" => Returns b if a is not nil and not false. Returns c if a is nil or false.
    "a AND ( b OR c)" => Returns b if a is not nil and not false and b is not nil and not false. Returns c if a is not nil and not false and b is nil or false.
    Posted in: Need Help?
  • 0

    posted a message on Can a table have a table as a key?
    Quote from Farmbuyer


    The # operator only works on the part of a table with integral keys:

    local foo = { "x", "y", "z", thing="stuff" }


    #foo is 3, because the 'thing' key doesn't count.

    They also must to be consecutive starting with 1. E.g:
    local foo = { "x", "y", "z", [5]="stuff" }
    local bar = { [2]="x", [3]="y", [4]="z", [5]="stuff" }


    #foo is still 3.
    #bar is 0.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Shift toggle??
    Windows' Accessibility Options or Ease of Access depending on which version of Windows you're using. Look for "Sticky Keys".
    Posted in: Need Help?
  • 0

    posted a message on Auctioneer
    Auctioneer has its own forums.

    http://norganna.org/discuss/

    There are also beta releases up on its download page.

    http://auctioneeraddon.com/dl/
    Posted in: Need Help?
  • 0

    posted a message on LibResComm-1.0
    Ahem... every one of those has a syntax error. Just saying. :p
    Posted in: Libraries
  • 0

    posted a message on Paid: Looking to Hire
    http://www.curse.com/addons/wow/yorsahj

    Just saying.
    Posted in: Addon Ideas
  • 0

    posted a message on Paid: Looking to Hire
    You're not going to get much reception with this method. You're better off just posting what you want in the forums. Whether it's private (I assume you mean that it'll just be for you) or not is irrelevant, and if you mean proprietary (which is moot), there are no secrets among addon developers and once your addon is made public everybody will be able to see the code anyway.
    Posted in: Addon Ideas
  • 0

    posted a message on Addon problem {help}
    /facepalm

    Your post is severely lacking. If you expect help, you need to provide more information than that. Error messages, the name of the addon, etc.
    Posted in: AddOn HELP!
  • 0

    posted a message on Problems with Options
    "Table index is nil" means there's nothing in the slot you're trying to access not that the table is nil or empty (necessarily), there's no line 296 in your paste code, so I can't be of much help in that department.
    Posted in: AddOn HELP!
  • 0

    posted a message on Guild_roster_update
    Quote from Felpalidan
    How would you make Guild_Roster_Update run when somebody joins your guild? I'd assume it would be
    Guild_Roster_Update(Join)
    but that doesn't work. Any and all help would be appreciated. Thanks in advance

    If you're talking about the event, GUILD_ROSTER_UPDATE, you don't. It fires when something in the guild changes. If you're talking about a function that refreshes the guild roster, GuildRoster() is the one.

    Side note: If you're going to assume a function's name, Blizzard's convention is <window>_<action> (e.g. GuildRoster_Update()).
    Posted in: Need Help?
  • 0

    posted a message on UNIT_AURA help
    Make a variable that tells it not to fire the second time and unset it on the second pass.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Ultraxion button (heroic will), how to move it?
    :SetUserPlaced() was part of my pseudo code which does not include :SetMovable(). :SetPoint() doesn't call it.

    At any rate, when a frame (the action buttons) with mouse enabled is on top of another frame (the action bar frame) with mouse enabled, the top frame receives the mouse.

    And, yes, I have tried similar code when trying to make my TradesBar frame movable. You either have to make the buttons click through (:EnableMouse(false)) or use the buttons' OnDragStart/Stop to call their parent's *Move* functions.

    Edit: Also, even if it's not parented to UIParent, :StartMoving() unparents it.
    Posted in: Lua Code Discussion
  • 0

    posted a message on UNIT_AURA help
    Quote from Priam_
    Like egingell mentioned, try with the "COMBAT_LOG_EVENT" event

    local MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon", "AceConsole-3.0");
    
    function MyAddon:OnEnable()
    	self:RegisterEvent("COMBAT_LOG_EVENT", "doCombatLogCheck")
    end
    
    
    function MyAddon:doCombatLogCheck(...)
    	local param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14, param15, param16 = ...
    	if param3 == "SPELL_AURA_APPLIED" and param6 == UnitName("player") then
    		self:Print("You placed "..param14.." On "..param10)
    	elseif param3 == "SPELL_AURA_REFRESH" and param6 == UnitName("player") then
    		self:Print("You refreshed "..param14.." On "..param10)
    	end
    end


    The variables I used aren't very descriptive, but you can check http://www.wowwiki.com/API_COMBAT_LOG_EVENT for more info


    Just so you're aware, COMBAT_LOG_EVENT is an event like any other. When you register and call it in that fashion, you have to account for all of the proper arguments (param1 == "COMBAT_LOG_EVENT", param2 in the context above is param1 of the base parameters on WowPedia. Edit: Disclaimer: This reply is not directed to Priam_, he has the correct variables where they go. I'm just speaking in general.

    So, to disambiguate it from the website, I would write it like this (or use words for the variable names):
    local MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon", "AceConsole-3.0");
    
    function MyAddon:OnEnable()
    	self:RegisterEvent("COMBAT_LOG_EVENT", "doCombatLogCheck")
    end
    
    
    function MyAddon:doCombatLogCheck(...)
    	local _, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14, param15, param16 = ...
    	if param2 == "SPELL_AURA_APPLIED" and param5 == UnitName("player") then
    		self:Print("You placed "..param13.." On "..param9)
    	elseif param2 == "SPELL_AURA_REFRESH" and param5 == UnitName("player") then
    		self:Print("You refreshed "..param13.." On "..param9)
    	end
    end
    Posted in: Lua Code Discussion
  • 0

    posted a message on Ultraxion button (heroic will), how to move it?
    Your macro won't work, unfortunately. Since it's an action bar, when you drag the "bar", you're actually dragging the buttons.

    'Tis better to get an addon like MoveAnything or use :ClearAllPoints() + :SetPoint() + :SetUserPlaced(true).
    Posted in: Lua Code Discussion
  • 0

    posted a message on UNIT_AURA help
    Quote from moselekm
    I am trying to trigger a soundfile to play when targetting a unit and they pop a certain aura(s). Here is basically what it will look like:

    [PHP] if ("UNIT_AURA") then
    if (UnitAura("target", "Hand of Protection")) then
    PlaySoundFile(directory.."soundfile.mp3");
    end
    end[/PHP]

    The problem is that it will spam during any aura changes I have or they have. Which makes sense, since the event handler hooks anytime Auras change and the requirements are met. I was wondering if I can limit it to only doing it on the initial change of the specified aura and for it not to trigger after.

    For example, let's say I am healing someone and HoP them, soundfile initializes. Then someone comes in and gives them another buff, the soundfile will initialize again. I don't want it to.

    Anyone have any ideas? Thanks!
    /facepalm

        if ([B]event == [/B]"UNIT_AURA") then
            if (UnitAura("target", "Hand of Protection")) then
               PlaySoundFile(directory.."soundfile.mp3");
            end
        end


    Edit: Also, If you want to stop it from spamming, you need to use some sort of caching. E.g. Put target names into a table with timers per each one.

    Edit: Or use COMBAT_LOG_EVENT instead.
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.