Pretty sure this belong to the Programming -> misc section. Misc - MMOwned - World of Warcraft Exploits, Hacks, Bots and Guides
This guide is going to teach you how to make a note to yourself inside your LUA script.
What do I want to have for this guide? (I say want because they're not required but LUA is way easier with them).
- First you will need a LUA engine. I recommend Notepad++ which you can get here.
Now lets get started. Before we start I am going to tell you that if you go down to the end of this post and copy/paste the script into your scripts folder you will learn noting!
Allright so first I am going to teach you how to write notes for yourself inside the script.
1. If your note can be inserted within one line then you simply would do this.
-- "Your note here"
Except without the quotes ofcourse.
2. If your note cannot be inserted within 1 line then you will do this.
"Your text here"
And, once again don't forget to remove the qoutes.
There you go; you have created your note you may not think it now but these can be very useful when you go to script. If you can't remember what the script does then what is the point of it right?
Vinland is right, because its really not about emulation. Lua is used as a programming language a lot more places than in WoW Emu, and learning how to write a comment really is only related to the language.
I live in a shoe
err you missed one that although it's the same as -- it's useful to use to show the output of something, that is
i = 1224
print(i) --> 1224
As you can see that clearly shows what the output will be
Edit: Just in case you don't see the use in this, this could be helpful in helping people who don't know Lua understand your script or when in writing a guide for example it is helpful when explaining how you can assign a value to any variable with the '=' sign.
Code:print(MyVariable) --> nil (this variable doesn't exist yet, hehehe) MyVariable = 5 -- we add a value to it here print(MyVariable) --> 5 (because we gave it that value above...) MyVariable = "Hello MMOwned!" print(MyVariable) --> Hello MMOwned! (Variable's values can change ;)
Last edited by Confucius; 01-12-2010 at 09:05 PM.
"Above all, don't lie to yourself. The man who lies to himself and listens to his own lie comes to a point that he cannot distinguish the truth within him, or around him, and so loses all respect for himself and for others. And having no respect he ceases to love." - Dostoevsky
To be honost it doesnt matter if you delete the quotes or not, everything after the -- is ignored in the script. So when you read the LUA file afterwards, it really doesnt matter if you have quotes in the text or not.