Create your own macros on player creating

Format: XML
Path: gameserver/data/macros_reg.xml

Example XML File macros.xml
XML:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE list SYSTEM "macros_reg.dtd">
<list enabled="false">
    <!-- Defining macros -->
    <macro id="1001" type="0" name="Menu" desc="Open player settings panel" acronym="MENU">
        <command order="1" type="3" d1="0" d2="0" cmd=".menu"/>
    </macro>
    <macro id="1002" type="0" name="Premium" desc="Check Premium status of PA" acronym="PA">
        <command order="1" type="3" d1="0" d2="0" cmd=".pa"/>
    </macro>
    <!-- Additional macros go here... -->

    <!-- Registering shortcuts to the player's panel -->
    <shortcuts>
        <shortcut slot="0" page="2" type="4" id="1001" level="0" class="1"/>
        <shortcut slot="1" page="2" type="4" id="1002" level="0" class="1"/>
        <!-- Additional shortcuts go here... -->
    </shortcuts>
</list>

1) Enabling/Disabling the System
enabled="false": This attribute controls the enabling and disabling of the macro system. If set to true, the macro system is enabled. If set to false, the system is disabled, and macros are not loaded.

2) <macro> Elements
XML:
<macro id="1001" type="0" name="Menu" desc="Open player settings panel" acronym="MENU">
    <command order="1" type="3" d1="0" d2="0" cmd=".menu"/>
</macro>
  • <macro>: This element defines a macro that will be registered in the system.
    • id="1001": A unique identifier for the macro. This ID is used to reference the macro, for example, in shortcuts.
    • icon="0": Macros icons.
    • name="Menu": The name of the macro, which will be displayed in the interface.
    • desc="Open player settings panel": A description of the macro, which can also be displayed to the user.
    • acronym="MENU": A short name or acronym for the macro, which will be used for button or label display.
  • <command>: A nested element inside <macro> that defines the command executed by the macro.
    • order="1": The order number of the command within the macro.
    • type="3": The type of command, which can define the action performed.
    • d1="0" and d2="0": Additional parameters for the command. These are used to pass data to the command.
    • cmd=".menu": The actual command that will be executed. In this example, it's .menu.

3) <shortcuts> Elements
XML:
<shortcuts>
    <shortcut slot="0" page="2" type="4" id="1001" level="0" class="1"/>
    <shortcut slot="1" page="2" type="4" id="1002" level="0" class="1"/>
    <!-- Additional shortcuts go here... -->
</shortcuts>

  • <shortcuts>: A container for all shortcuts. Shortcuts allow players to quickly use macros from the quick access panel.
  • <shortcut>: This element defines an individual shortcut.
    • slot="0": The slot number on the quick access panel where the shortcut will be placed.
    • page="2": The page number of the quick access panel.
    • type="4": The type of element on the quick access panel. In this case, 4 might denote a macro.
    • id="1001": The ID of the macro that this shortcut is linked to.
    • level="0": The level required to use the shortcut. 0 means there are no restrictions.
    • class="1": The class ID of the character that can use this shortcut. In this case, 1 might correspond to a specific character class.

How to Edit the XML File​

  1. Enabling/Disabling the Macro System: Change the enabled attribute in the root <list> element. Set enabled="true" to enable the macro system, and enabled="false" to disable it.
  2. Adding a New Macro: Copy a <macro> block and modify its attributes:
    • Assign a unique id for the new macro.
    • Change name, desc, and acronym according to the functionality of the new macro.
    • Add or modify commands inside the <command> element.
  3. Adding a New Shortcut: Copy a <shortcut> block and modify its attributes:
    • Assign a unique slot to avoid conflicts on the quick access panel.
    • Specify the id of the macro that the shortcut is linked to.
    • If necessary, adjust page, level, and class to match your requirements.
  4. Removing Macros or Shortcuts: Simply delete the corresponding <macro> or <shortcut> blocks.
 
Last edited:
Back
Top