mostly clarification
(→Arguments: updated info on perCharacter) |
(mostly clarification) |
||
| Line 2: | Line 2: | ||
Edit macro command/button. | Edit macro command/button. | ||
EditMacro(index, name, icon, body, local, perCharacter) | EditMacro(index or macroName, name, icon, body, local, perCharacter) | ||
This function may only be called when out of combat. | This function may only be called when out of combat. | ||
== Arguments == | == Arguments == | ||
:(index, name, icon, body, local, perCharacter) | :(index or macroName, name, icon, body, local, perCharacter) | ||
; index : | ; index or macroName : Number or string - the index or name of the macro to be edited. Index ranges from 1 to 36 for account wide macros and 37 to 54 for character specific. | ||
; 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. The name remains unchanged if nil. | ||
; icon : Numeric - A 1-based iconTextureId (index of icon textures as displayed in "Change Name/Icon" UI). Check the current number | ; icon : Numeric - A 1-based iconTextureId (index of icon textures as displayed in "Change Name/Icon" UI). Check the current number of icon textures available by calling [[API GetNumMacroIcons|GetNumMacroIcons()]]. The icon remains unchanged if nil. | ||
; 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. | ||
| Line 22: | Line 22: | ||
== Returns == | == Returns == | ||
; macroId : Numeric - The | ; macroId : Numeric - The new index of the macro, as displayed in the "Create Macros" UI. Same as argument "index" unless the macro name is changed, as they are sorted alphabetically. | ||
== Example == | == Example == | ||
| Line 29: | Line 29: | ||
== Notes == | == Notes == | ||
*If this function is called from within the macro that is edited, the rest of the macro (from the final character's position of the /run command onward) will run the new version. | |||