Template:Call: Difference between revisions

From OpenKore Wiki
Jump to navigation Jump to search
(Created page with " <noinclude>This template describes the '''call''' parameter of the automacro eventMacros.</noinclude> ; call :* '''call''' is the only required para...")
 
No edit summary
 
Line 1: Line 1:
  <noinclude>This template describes the '''call''' [[EventMacro#Parameters|parameter]] of the automacro eventMacros.</noinclude>
  <noinclude>This template describes the '''call''' [[EventMacro#Parameters|parameter]] of the automacro eventMacros.</noinclude>
; call
; call [<macro_name> | [[EventMacro#Macro_Syntax|macro_block]] ]
:* '''call''' is the only required parameter in every automacro.
:* '''call''' is the only required parameter in every automacro.
:* '''call''' defines which macro the automacro will execute.
:* '''call''' defines which macro the automacro will execute.

Latest revision as of 20:48, 3 July 2019

This template describes the call parameter of the automacro eventMacros.
call [<macro_name> | macro_block ]
  • call is the only required parameter in every automacro.
  • call defines which macro the automacro will execute.
  • call can be a macro name or a macro block.

Example when using a macro name:

automacro <automacro name> {
    <automacro conditions and parameters (and only them)>
    call myMacro
}
macro myMacro {
    <macro instructions (and only them, as this is regular macro)>
    # for example:
    do move prontera
    do move payon
}

Example when using a macro block:

automacro <automacro name> {
    <automacro conditions and parameters (and only them)>
    call {
        <macro instructions (and only them, as this is regular macro)>
        # for example:
        do move prontera
        do move payon
    }
}


  • Two examples above do the same thing.
  • Note that the macro block used in the call parameter has the same rules as a normal macro block.


The first syntax is useful if you want more than one automacro to call one simple macro:

automacro First {
    <conditions> 
    call print
}
automacro Second {
    <conditions> 
    call print
}
macro print {
    log $.caller triggered
}