The client-side Macro document which extends the common BaseMacro model.

Mixes

ClientDocumentMixin

See

  • Macros The world-level collection of Macro documents
  • MacroConfig The Macro configuration application

Hierarchy

  • any
    • Macro

Accessors

  • get isAuthor(): boolean
  • Is the current User the author of this macro?

    Returns boolean

  • get canExecute(): boolean
  • Test whether the current User is capable of executing this Macro.

    Returns boolean

  • get thumbnail(): string
  • Provide a thumbnail image path used to represent this document.

    Returns string

Methods

  • Test whether the given User is capable of executing this Macro.

    Parameters

    • user: User

      The User to test.

    Returns boolean

    Can this User execute this Macro?

  • Execute the Macro command.

    Parameters

    • Optional scope: {
          speaker: ChatSpeakerData;
          actor: Actor;
          token: Token;
          event: Event | RegionEvent;
      } = {}

      Macro execution scope which is passed to script macros

      • speaker: ChatSpeakerData

        The speaker data

      • actor: Actor

        An Actor who is the protagonist of the executed action

      • token: Token

        A Token which is the protagonist of the executed action

      • event: Event | RegionEvent

        An optional event passed to the executed macro

    Returns any

    A created ChatMessage from chat macros or returned value from script macros

  • Parameters

    • event: any

    Returns any

    Inherit Doc

  • Execute the command as a chat macro. Chat macros simulate the process of the command being entered into the Chat Log input textarea.

    Parameters

    • Optional speaker: ChatSpeakerData

      The speaker data

    Returns void

  • Execute the command as a script macro. Script Macros are wrapped in an async IIFE to allow the use of asynchronous commands and await statements.

    Parameters

    • Optional scope: {
          speaker: ChatSpeakerData;
          actor: Actor;
          token: Token;
      } = {}

      Macro execution scope which is passed to script macros

      • speaker: ChatSpeakerData

        The speaker data

      • actor: Actor

        An Actor who is the protagonist of the executed action

      • token: Token

        A Token which is the protagonist of the executed action

    Returns any