CurseForge.com
Home
Addons
Authors
Forums
Knowledge base
Paste
Site issues
Sign in
Register new account
LibUserScript
Overview
Files
Tickets
Pages
Repository
Subscriptions
Curse
Script API
r2
Source
Markup:
*
Scripts are essentially segments of Lua code that get run when a registered event fires. Scripts are provided with a state variable, access to settings (which can be manipulated using the blizzard addon panel), and a limited subset of the global environment. Using Lua comments, scripts can define properties (similar to the Outfitter script properties) to control events, display, and settings. '''Scripts run every time a requested event fires.''' == Script Context == Currently there are two types of scripts. Scripts that are used to take pictures (events are ignored for these scripts) and those that are run when events happen. == Lua Scripts == === Property definitions === Properties allow scripts to identify themselves and register for events and settings. Properties are defined using specially formated LUA comments. <code>-- $<property-name> <property-value></code> Where <code><property-name></code> is one of the following: ;EVENTS :Adds the space separated list of event names to the events to register for this script. Each EVENTS property is additive. See [http://www.wowwiki.com/Events/Names Event Names] for a list of possible names. ;DESCRIPTION :Sets the description for the script. This is a non-unique name used when listing the script. ;SETTING :This defines a variable accessible to the script. :<code><property-value></code> may consist of one of two forms: :* <code><setting-name> = <setting-type></code><br />Declares a setting with the given name and specified type. The label for the setting will be the setting itself. The default value will be a value appropriate for the given type. :* <code><setting-name> = { ... }</code> === Variables === Scripts may use the '''<code>self</code>''' variable to store transient information or the '''<code>setting</code>''' variable to access declared settings. Attempting to declare a global variable will result in an error. === Environment === To limit the extent to which scripts can cause trouble, only those functions which can query state are provided or carry out needed actions are provided. See [http://wow.curseforge.com/projects/lib-user-script/pages/script-api-environment/ Script API/Environment] for a list of default global variables.
Markup Type:
*
The type of markup for this entry.
Click here for details
.
WikiCreole
BBCode
Safe HTML
Plain Text
Markdown
Textile
Curse Wiki (Deprecated)