Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
WoW
Talk
English
Views
Read
Edit
History
More
Search
Navigation
Home
Random page
Help using wiki
Editions
for WoW
for WildStar
for Solar2D
Documentation
for WoW
for WildStar
Reference
WoW
⦁ FrameXML
⦁ AddOns
⦁ API
⦁ WoW Lua
WildStar
⦁ AddOns
⦁ API
⦁ WildStar Lua
Engine
Tools
What links here
Related changes
Special pages
Page information
Site
Recent Changes
Editing
WoW:UI beginner's guide
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Scripts == ''Scripts'' are small computer programs that manipulate and combine a small number of objects that exist outside the script. Scripts are usually written in a ''scripting language'', which is designed so users can quickly express those small programs in a flexible way. (Scripting languages are a popular way to teach new programmers, so don't be afraid!) The World of Warcraft client embeds a powerful scripting language called [[Lua]] in its client software. This lets you create specialized commands, similar to the macros described above. However, scripts can be much more complex, making decisions on what to do based on what is going on in the world rather than the fixed sequence offered by a macro. Lua scripts are used in the following places: * /script [command] : If you type the slash command "/script" in the chat box, you can follow it with one or more valid Lua language statements (i.e. a script), separated by semi-colons ( ; ). * Macros: you can enter scripts as part of macros, by putting one or more "/script" commands in your macro. * Addons: these extend the WoW client with new slash commands and often user interface elements. This additional functionality is provided through Lua scripts (containing the actual addon logic). User interface extensions are defined in XML files. (XML is, incidentally, not a programming language. It's a "mark-up" language which contains source code but can also contain media contents or structured references to external, possibly remote network media resources ... including other XML files. However, XML is stored as structured, syntactically complex text and is parsed and interpreted in ways that make it similar to a programming language). So what can a script do? There are many resources on Lua scripts. See our page on [[Lua]] to find out more about the language. Browse the rest of the [[Interface Customization]] page for additional resources. The most important point however is that scripts are able to perform many more game actions than slash commands. This is done via a set of functions (called API or Application Programming Interface) that WoW makes available for use in scripts. There is a quite extensive list of all the API functions available for use in scripts at [[World of Warcraft API]]. After all that explanation, here is an example of a script: if (IsPartyLeader()) then ChatFrame1:AddMessage("I am the leader of my party!") end This script is very simple. When you execute this script, if you are the party leader, then you get a message saying you are the party leader. To use this script, you would have to do so via the "/script" command. e.g.: /script if (IsPartyLeader()) then ChatFrame1:AddMessage("I am the leader of my party!"); end You can type this directly into the chat box, or make that line part of a macro, so that it's reusable. In summary: a script in WoW is a short program written in the Lua language, able to interact with the game and perform game actions. You use a script by including it as part of something else, e.g. by putting it in a macro via the /script command, or by putting it in an addon. Note that Blizzard has taken great efforts to limit the functionality of scripts and macros to prevent players from automating too much of the game play. If too much were automated by some players then they would have unfair advantages against others in PvP and they'd be able to farm far too quickly which would cause instabilities in a realm's virtual economy (as well as potentially ruining play for other players by having too many of the materials and world drop items rapidly consumed by automated "bot" players.
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)