no edit summary
No edit summary |
|||
| Line 2: | Line 2: | ||
Creates a new macro command/button. | Creates a new macro command/button. | ||
CreateMacro(name, iconFileName, body, perCharacter) | |||
== Arguments == | == Arguments == | ||
:(name, | :(name, iconFileName, body, perCharacter) | ||
; name : String - The name of the macro to be displayed in the UI. The current UI imposes a 16-character limit. | ; name : String - The name of the macro to be displayed in the UI. The current UI imposes a 16-character limit. | ||
; | ; iconFileName : String , The icon name. | ||
; body : String - The macro commands to be executed. If this string is longer than 255 characters, only the first 255 will be saved. | ; body : String - The macro commands to be executed. If this string is longer than 255 characters, only the first 255 will be saved. | ||
; perCharcter : Numeric - nil will create a "General" saved macro, 1 will save it as "Per Character" | ; perCharcter : Numeric - nil will create a "General" saved macro, 1 will save it as "Per Character" | ||
== Returns == | == Returns == | ||
| Line 23: | Line 21: | ||
== Example == | == Example == | ||
; General (All Character) Macros : | ; General (All Character) Macros : | ||
local macroId = CreateMacro("MyMacro", | local macroId = CreateMacro("MyMacro", "INV_MISC_QUESTIONMARK", "/script CastSpellById(1);", nil); | ||
; perChar (Per Character) Macros : | ; perChar (Per Character) Macros : | ||
local macroId = CreateMacro("MyMacro" | local macroId = CreateMacro("MyMacro", "INV_MISC_QUESTIONMARK", "/script CastSpellById(1);", 1); | ||
== Notes == | == Notes == | ||
* As of 3 | * As of 4.3 this is working as shown - the unused parameter has been removed | ||
* This function will generate an error if the maximum macros of the specified kind already exist (36 for per acount and 18 for per character). | * This function will generate an error if the maximum macros of the specified kind already exist (36 for per acount and 18 for per character). | ||