## VASSAL Reference Manual

Home > Module > Action Button

### Action Button

An Action Button component places a button on the Toolbar of the main Module window which combines a number of different actions into a single button. When the button is clicked, or receives its Hotkey, it can display a message to the Chat Log Window, Play a sound, and/or send a list of Hotkeys or Named Key Commands to other components.

To add an Action Button to your Module, find the [Module] entry at the very top of the Editor’s configuration window, right-click it, and select Add Action Button. Once you have performed the initial configuration of your new Action Button and clicked the OK button, your new [Action Button] component will be found at the very bottom of the Module’s list of components.

Description:

  A short description of this button for your own reference.

Button text:

  The text of the button to be added to the Toolbar.

Tooltip text:

  The tooltip text of the button to be added to the Toolbar.

Button icon:

  Icon for the Toolbar button.

Hotkey:

  Keystroke or Named Command for the Toolbar button.

Toolbar button can be disabled by a property:

  If this box is checked, you will be able to enable/disable the Toolbar Button by changing the value of a Global Property. See also: Toolbar Configuration

Global Property to disable this button when "true"

  The name of a Global Property that will control when this Toolbar Button is enabled or disabled. If the property contains the string true, the button will be disabled; if it contains any other value the button will be enabled.

Button Icon when disabled:

  If you select an alternative icon here, then that icon will be used when the button is currently disabled. If you leave the icon empty, then the normal icon, if any, will stay in place. Any button text for the toolbar button will be greyed out when the button is disabled, regardless of your choice in this field.

Display message:

  Select to display a message to the chat log when the Action Button is clicked or its Hotkey received.

Report format:

  Message Format to report to the chat log.

Play a sound:

  Select to play a sound clip when the button is activated.

Sound Clip:

  The Sound clip file to be played.

Send hotkeys:

  Select to send a list of Hotkeys to other components when the button is activated.

Hot keys:

  The list of Keystrokes or Named Commands to be sent. Use the New button to add another key, or the Remove buttons to remove existing keys.

Note | Because these are Global Hotkeys rather than Global Key Commands, they are sent to Module and Map Toolbar components, not to individual Game Pieces. Of course a Hotkey could be used to activate a Global Key Command component which could then affect individual Game Pieces.

Repeat this set of actions (Loop):

  Allows you to perform the specified actions multiple times.

Type of loop:

  Select the type of loop from the drop-down menu:

  Repeat fixed number of times:

    This loop option allows you to repeat the set of actions a specified number of times.

  Repeat while condition is true:

    This loop option allows you to repeat the set of actions while a Property Expression remains true. If the expression begins the loop already false, the actions will not be performed at all (compare "until", below).

  Repeat until condition is true:

    This loop option allows you to repeat the set of actions until a Property Expression becomes true. The set of actions will be performed at least once.

Loop how many times:

  An Expression that defines how many times to generate the set of actions (for a fixed loop).

Loop while/until condition is true:

  Enter the Property Expression that controls how long to keep looping (for a while or until loop).

Perform this Hotkey once before looping starts:

  For all loop types, enter a Keystroke or Named Command that will be performed once before the looping process commences.

Perform this Hotkey once after looping complete:

  For all loop types, enter a Keystroke or Named Command that will be performed once after the looping process finishes.

Create a loop index property?:

  For all loop types, allows you to create a Property whose value will change as the looping process proceeds.

Index property name:

  The name of the property that will be created.

Index property start value:

  An Expression that sets the value of the index property prior to looping commencing. The expression must evaluate to a whole number.

Index property increment value:

  An Expression that defines how much will be added to the Index Property at the start of each loop. The expression must evaluate to a whole number.

A complex example that does the following:

1. Send the Hotkey *StartHitting*

2. Set up a property name Counter with a value of 10 and repeat the following steps, incrementing Counter by 2 each time until Counter exceeds the value of the property *MaxCount*

   1. Display the message 'Opponent Hit!!!' in the Chat area

   2. Play the sound clip 'tada.mp3'

   3. Send the KeyStroke Hotkey Command *F2*

3. Send the Hotkey *StopHitting*