1. Very good, my name is adrian and I am interested in lua, but I have two questions about lua.

    I am creating a world of warcraft addon, and I have trouble following the code, you see, I have this written in XML:

     <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/">
    
       <Script file="prueba.lua"/>
    
        <Frame name="PruebaMainFrame">
    
          <Scripts>
    
            <OnLoad>
    
              Inicio_OnLoad();
    
            </OnLoad>
    
          </Scripts>
    
        </Frame>
    
      </Ui>
    

    For now I will not touch on XML, which means that it is the basics to operate an Addon and also other files that do not need to.

    Good, on to the Lua file, if somebody knows the typical games, such RPG, with health and mana, well, I want to do something basic since I am a beginner at this, I looked at a page where the commands are to be used to do different things "http://www.wowwiki.com/Addon_programming."

    My idea was that when I is low life as you send a chat message saying that your life is low, what to make out the message and know now what remains is to put a condition that if life hands you 500 points quarter to remove it to send the message asking you to heal, but now that I think I have no idea how to do this, the beginning of the code I have it done, now need to complete.

      function Inicio_OnLoad
    
      if UnitHealth("<=50") then primera = primera + 1
    
      end
    

    I had thought of something, but it is clear that this will not work, because this is where I need to help me.

    PS: Thanks for reading my post, by the way if there is spelling mistakes Tell me is that I am Spanish and I am using a concealer. Thank you.

    PS: This post was written in lua another forum about what happens that I have little time and I made the cut and paste xD.

  2. If you would like to write addons for World of Warcraft, I suggest you purchase a copy of my book: World of Warcraft Programming: a Guide and Reference for Creating WoW Addons. It's not entirely clear what your question is, and simple things like this are covered quite early in the book.