1. Hi, i've pretty much just started creating addons today, read some background around it, did a little addon that just printed some text, nothing fancy.

    Creating my first addon, what i want it to do is add a specific player to my ignore list, the name is providied within the addon itself, lots of people are wanting this so they can't forget to add this player to their ignore list on alts.

    Current lua file:

     function Undeadbones()
        AddIgnore("undeadbones")
              print ("hi u")
     end
    

    Current xml file :

     <Ui xmlns="http://www.blizzard.com/wow/ui/" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xsi:schemaLocation="http://www.blizzard.com/wow/ui/ 
      ..\..\FrameXML\UI.xsd">
       <Frame name="AntiBonesFrame">
        <Scripts>
         <OnLoad>
        print ("hi u")
          Undeadbones();
         </OnLoad>
        </Scripts>
       </Frame>
     </Ui> 
    

    My toc file links up to both of these correctly, is there a simple mistake i have done here or a simple line i havn't added in, but looking for answers for a few hours and found squat, thanks for your help ;)

    Edit 1. Typo Edit 2. Function name change

    New News:

    Print Statements have been added to both the lua and the Onload Scripts and both produce the correct statement

    Nothing appears in the XMLFrameLog

    Well a few things, your <Script> tag has an attribute of File, which is not correct. It should be file, the case does matter. Beyond that, without an error message its a bit difficult to say.

    Just get rid of <Script> and load the .lua file using the .toc file.

    Getting rid of the line < Script File="Anti-Bones.lua"/>

    I then put the code into a XML Validator

    it outputted this

    Line 6: element Scripts: Schemas validity error : Element '{http://www.blizzard.com/wow/ui/}Scripts': This element is not expected. Expected is one of ( {http://www.blizzard.com/wow/ui/}Size, {http://www.blizzard.com/wow/ui/}Anchors, {http://www.blizzard.com/wow/ui/}Animations ).

    Yes, that doesn't mean there is an error. Ignore that.

    It's great if you want to do this to learn how to write addons or maybe there's some improvement you'd like to make, but do you know there already exists an addon to serve this purpose?

    Friend & Ignore Share

    Edit.

    The way you've posted it you say your code is in your toc file when it should be in your lua file... but you also say that your toc links them both so I'm guessing that's typo in the post rather than a problem with your code.

    Yes it's a typo, i meant to say that's what it's in the lua file, i'll edit it now, thanks

    Your XML calls a function called Anti-bones() but the function you've defined is Undeadbones()

    It's great if you want to do this to learn how to write addons or maybe there's some improvement you'd like to make, but do you know there already exists an addon to serve this purpose?

    Friend & Ignore Share

    It doesn't do what i want it to do, you have to login and them manually to make that work, where as my addon will ignore as soon as you login without any labour required

    Your XML calls a function called Anti-bones() but the function you've defined is Undeadbones()

    Thanks, changed this but still doesn't solve the problem =/

    Follow the troubleshooting steps I outline in the book:

    1. Check the Logs\FrameXML.log file and see if there are any recent entries that mention your addon.
    2. I suspect the name of the frame is invalid, you should not use '-' or any other non-alphanumeric characters in the name of a frame.
    3. Add a print statement to your OnLoad script and see if its being executed.
    4. Add a print statement to the function in your Lua file and see if its being executed.

    Some more information would be useful =)

    Actually Friend & Ignore Share just has a misleading description. What it does is whenever you log onto a character, it saves all your friends and ignores and adds them to the list of any other character you log onto. You only have to log onto all your characters if you want it to immediately friend/ignore anyone on any of the lists, and it provides some manual functions for dealing with uncommon situations like more total friends than can fit in a friends list.

    The relevant part is that adding someone once to an ignore list will add them automatically to all your ignore lists for any character you log onto without you having to do anything extra. However your addon adds people isn't likely to be less work than using the built in blizzard methods of ignoring someone.

    Sorry for that, Had to attend a raid and had to concentrate :)

    1. Nothing is appearing the XMLFrameLog which has a relation to the Addon

    2. there was a previous XMLFrameLog entry which stated this also, took the time to rename all my titles from "Anti-Bones" to "AntiBones"

    3. There is nothing being executed if i add a print statement

    Aha, got it to execute the print statement in my lua file

    1. Add a print statement to your OnLoad script and see if its being executed.

    How would i go about doing this, The lua file print statement i understood but not too sure how i would go about doing this

    The code in between <OnLoad> and </OnLoad> is just Lua code. You can add print("Inside the OnLoad Script") there and it will print that when that happens.

    The print statement is working for the onload and the lua file, so something wrong with the actual lua code itself as in the Addignore isn't doing what it's meant to be doing i guess

    Can anyone write down what the correct lua code for ignoring someone on login is? just want to check that the API listings were correct with the way that i am currently doing it

    Please do not edit/remove your posts. It's not constructive and its very bad behaviour. I have restored all of your previous posts. If you have something to add to the conversation, then add it.

    Download the look at the addon that Cayenne helpfully linked for you. It's almost certain that you're performing the AddIgnore too early. At the point your addon is loading, the game is not fully initialised yet. Specifically, if you want to do something on 'login', then you should register for the PLAYER_LOGIN event, which is normally used to indicate that most of the game/client data has been initialised and is available. I'm not entirely sure when the ignore list is sent down, you'd have to look at the addon linked to get more information.

    I suggest you work your way through the book in order to better understand how to develop an addon.

    Thank you very much, will do that now, will inform you when i have fixed it, thanks alot :)