1. hey everyone need a little advice. Just bought the second edition of the book and need a little bit of advice already. I am brand new to programming. I've seen it but i've never typed or written any code. I've been playing wow for a few months after it came out. I use alot of addons and picked up the book because i was interested in how they were developed and written and such.

    Anyhow on to the question. In the first addon the text talks about writing is the HeyThere one. Now in the book its in like paragraph form, however, i downloaded the addon off the site and its all smashed together. Are you supposed to type it this way? Also i have tried typing it exactly like the one off the website and it still does not work. Its word for word, space for space, capital letters and all. Still nothing. When i copy the addon files off the site and just use those it works as depicted. So, how do you determine the spaces and such when reading code? They look like its just tabbed between strings but i counted it and its 4 spaces then 8 spaces for the If then else statements.

    Like i said i have zero knowledge about coding but am trying to learn. I will post better examples if need be.

    hey everyone need a little advice. Just bought the second edition of the book and need a little bit of advice already. I am brand new to programming. I've seen it but i've never typed or written any code. I've been playing wow for a few months after it came out. I use alot of addons and picked up the book because i was interested in how they were developed and written and such.

    Anyhow on to the question. In the first addon the text talks about writing is the HeyThere one. Now in the book its in like paragraph form, however, i downloaded the addon off the site and its all smashed together. Are you supposed to type it this way? Also i have tried typing it exactly like the one off the website and it still does not work. Its word for word, space for space, capital letters and all. Still nothing. When i copy the addon files off the site and just use those it works as depicted. So, how do you determine the spaces and such when reading code? They look like its just tabbed between strings but i counted it and its 4 spaces then 8 spaces for the If then else statements.

    I suspect that you're using Windows, and that is actually the primary problem. All development I do is on Mac/Unix and the files are formatted thus. Windows 'Notepad' application doesn't know how to properly read non-windows linefeeds and so things come up all smashed together. If you open it with Wordpad instead of Notepad you'll see the difference. When actually writing code on Windows, I tend to use SCiTe, which is a text editor that takes care of all of this for you.

    Whitespace in addons normally doesn't make a difference because Lua (the programming language) doesn't necessarily require any spaces or line feeds in order to function properly (in most cases). I'd suggest downloading SCiTE or another 'real' editor and trying to type the code in as it's listed in the book. Then we can work out any issues you might run into.

    Like i said i have zero knowledge about coding but am trying to learn. I will post better examples if need be.

    We're all learning to some degree or another!

    Excellent! I never even thought that windows would be the problem lol. Thanks so much now time to go on to the next chapter and so on. I was thinking about getting a mac anyhow, but thanks to that suggested program i won't have to now! Thanks again.

    I have run into this problem too. I've downloaded SCiTe and used it, but I get his same problem for HeyThere!: When I try /hey or /heythere, it won't allow the chatbox to accept it. Any other slash command works except the /hey and /heythere. I disabled the addon and /hey now does "Locknëss (my toon) greets everyone with a hearty hello."

    Help me. Please.

    You need to go through the same steps that we've already done with the original poster. I can't help you unless you provide more information.

    1. Is the addon listed in the addon selection screen?
    2. Are Lua errors enabled?
    3. Are you getting an error?

    Failing that, post the code on http://pastebin.ca or http://pastey.net so I can look at them.. but I can't do much on my own here.

    nope no lua errors or anything. when the addon is enabled, doing /hey and /heythere, hitting enter or return will not close the chatbox, not accepting the slash command. Thats all there is. I guess It's just because i'm using windows. MAKE A BOOK FOR THE 90% OF US WHO USE PC!!!

    nope no lua errors or anything. when the addon is enabled, doing /hey and /heythere, hitting enter or return will not close the chatbox, not accepting the slash command.

    This indicates that an error is occurring, quite clearly. Why the error is not being display is not something I can help you with without the code, which I've asked you to post.

    Thats all there is. I guess It's just because i'm using windows. MAKE A BOOK FOR THE 90% OF US WHO USE PC!!!

    I really don't like your tone. There is no need to get snatchy or bitchy in an online forum. I have over 10,000 readers, and many or most of them use Windows machines quite successfully to write addons. There is nothing that is non-windows specific in the book, so please calm yourself down.

    If you'd like to answer the questions I've asked and provide me with the information I've requested I will do my best to help you. But you need to check your attitude first. I am not here to be, and I will not be abused.

    You're also missing the point of my response to the original post. The issue was not that he was writing code using windows.. there's no issue with that at all. The issue was he was downloading the files from the website and then using an incapable text editor to open them. In particular he was using Notepad which is incapable of handling sane newline characters. This caused all of the code to run together and be completely unreadable. If you read that post again, you'll see I suggested he use 'WordPad' which is included on all Windows machines by default, and is capable of handling newline characters properly.

    That's it. There's nothing else that even remotely has anything to do with Microsoft Windows.

    Please answer my questions, and post the code as I have already requested.

    my bad. no harm intended. I just hope the problem isn't something i can't change.

     SLASH_HEYTHERE1 = "/hey"
    
     SLASH_HEYTHERE2 = "/heythere"
     SlashCmdList["HEYTHERE"] = function(self, txt)
        if UntitExists("target") then
            SendChatMessage("Hello " ..UnitName("target"), "SAY")
        else
            SendChatMessage("Hey there everybody!")
        end
     end
    

    Also, i'm not sure why I cannot access the files on the website like the book is asking. It says "Sorry, you are not allowed to do this."

    my bad. no harm intended. I just hope the problem isn't something i can't change.

     SLASH_HEYTHERE1 = "/hey"
     
     SLASH_HEYTHERE2 = "/heythere"
     SlashCmdList["HEYTHERE"] = function(self, txt)
      if UntitExists("target") then
          SendChatMessage("Hello " ..UnitName("target"), "SAY")
      else
          SendChatMessage("Hey there everybody!")
      end
     end
    

    You've misspelled UnitExists as UntitExists. That is likely the case of the issue.

    Also, i'm not sure why I cannot access the files on the website like the book is asking. It says "Sorry, you are not allowed to do this."

    What file are you trying to download and from where? Please post the link.

    wow...how did I miss that... It works now thanks =)

    and the link in the book is http://wowprogramming.com/chapters/01

    I was trying to get to the example files, thinking maybe if i compare them side by side I would find out.

    But the site map takes me to http://wowprogramming.com/profile/book_edition.edit&prototype= when I go to Chapter => Basics

    Just go here:

    http://wowprogramming.com/profile/book_edition

    Then select which edition of the book you own, and it'll direct you to the right chapter section.

    thank you very much =) once again sorry for the caps lock.

    No worries at all.