1. I had a question about the snippet provided on this site for adding a line to a tooltip (located here ). According to the description its only supposed to add one line to the tooltip, but it always ends up adding the line twice. i tried even just copy pasting that snippet into its own addon with no other code (and disabling all other addons) but it still seems to add the Hello World! text twice (in two separate lines) to all the item tooltips. I'm a total noob and am pretty sure i must just be missing something stupid. Does anyone have any ideas or suggestions of things to try regarding this? Any help you can provide would be very much appreciated. Snippet code provided below.

     local lineAdded = false
     local function OnTooltipSetItem(tooltip, ...)
        if not lineAdded then
           tooltip:AddLine("Hello World!")
           lineAdded = true
     local function OnTooltipCleared(tooltip, ...)
        lineAdded = false
     GameTooltip:HookScript("OnTooltipSetItem", OnTooltipSetItem)
     GameTooltip:HookScript("OnTooltipCleared", OnTooltipCleared)

    EDIT: Screenshot example included.

    I cannot reproduce this issue. You also don't need this code in an addon, you can run it in WowLua without any issues (like almost all snippets). Here's what I've done:

    1. Log into the game with no addons other than WowLua enabled
    2. Paste the code given into a page, run the page
    3. Mouse over an item in my containers
    4. Mouse over an item in my inventory

    In both cases it works properly.

    i figured out my mistake. I'm completely new to addon programming, but the code was getting called twice (once from the addon.toc file and once from the addon.xml file) so it was hooking the tooltip function both times. I will be driving down to the bookstore and buying your book today. I just want to say thank you for this wonderful resource/info you provide on your website and the quick response, it is very appreciated. I look forward to working through your book. Have a great day!

    Ah great ,glad you were able to figure it out!