7/21/08

I: Basics

Introduction


World of Warcraft is built with a programming language called LUA.
Calling a function is done by /run <FunctionName()>. Every function is case sensitive and won't work if not cased properly. Most ( but not all ) functions ends with () like LeaveParty() .
/run also works like /script, obviously, /run is shorter, so you must use it.

Note: Many functions are removed like casting spells on /run commands this also includes movement functions, targeting functions and many more that can be used for bots.These restricted functions are only accessible by Blizzard User Interface.

Note: Always remember that WoW scripts are typed in one line unlike other programming languages. Any incorrect line breaks ( pressed enter) will cause the script to break and may not work right.

Calling a Basic Function

To call a basic function like leaving a group, just type or make a macro with this code:
/run LeaveParty()

Adding Function Arguments


To call a function with parameter aka arguments, just put them inside the parenthesis:
/run SendChatMessage("hello")
Note: Strings(non number characters are always wrap in quotes or double quote or else they will work as variable(next chapter)
Note: Double quotes(") must be closed with double quote(") and single quote( ' ) must be closed with single quote( ' )


Calling Multiple Functions


To call two or more function, just add space or semi colon and add the function on the same line
/run SendChatMessage("hello") DoEmote("hi")
Note: each functions are called one by one, one after the other in a very microscopic time difference.


Adding Multiple Arguments


To call a function with more than one argument aka parameter, add comma between each parameters. Note that you will still wrap them in quotes

/run SendChatMessage("hello","yell")

No comments: