Auto Actions How-To

Intro

For more information on Auto Actions, see the Auto Actions Reference. Some basic understanding of Auto Actions is needed before the instructions in this section can be useful.

FAQs

How to load a new script?

Tap "Auto Action Manager" on the Dashboard pane. Tap the "+" (New) button at the bottom of the page in the AppBar. In the Name text box of the Auto Action Editor, type a name for the script. This name will be shown in the Bar File list once your new script is saved.

Tap the "Import" button and Select the text file which contains the text of the script you would like to load.

OR

In the large text box, type text of the script.

Once the script is in the large text area, tap the "Save" button, then tap the phone's back button. On the Auto Action Manager page, select the name of the new script on the Bar Files list box. Tap the "Load" button. The text next to "Status:" at the bottom of the page will notify you if the load was successful. If the script does not load, the script could have a syntax error.

How to edit a script?

Tap "Auto Action Manager" on the Dashboard pane. On the Auto Action Manager pane, tap the name of the script in the Bar Files list box that you would like to edit, then tap the "Edit" button. In the large text area which contains the text of the script, make any desired changes, then tap the "Save" button. Once your changes are saved, the previous script will be unloaded. To load the new version of the script, tap the "Load" button on the Auto Action Manager page. The text next to "Status:" at the bottom of the page will notify you if the load was successful.

How to delete a script?

Tap "Auto Action Manager" on the Dashboard pane. On the Auto Action Manager pane, tap the name of the script in the Bar Files list box that you would like to delete, then tap the "Delete" button.

How to manually disable all actions of an Action Group?

This prevents all Actions of an Action Group from being run and stops them if they are currently running.

Tap "Auto Action Manager" on the Dashboard pane. Then tap the "Console" button in the Appbar of the pane. On the Auto Actions Console pane, select the name of the Action Group in the Action Groups dropdown that you want to stop. Tap the "Stop" button.

How to run Auto Action commands manually in the Auto Action Console?

Tap "Auto Action Manager" on the Dashboard pane. Then tap the "Console" button in the appbar of the pane. On the Auto Actions Console pane, select the Action Group that you want to run commands for from the Action Groups dropdown. In the text box at the bottom of the pane, type the command that you want to run and press the ENTER key. If the commands causes anything to be printed, the message will be shown is the console area above the text box.

Since the command is being run manually, rather than being triggered by a server event, calls to Actions that require a server context may result in an error.

How to run Auto Action Commands manually in the IRC View or in Aliases?

the "/action" command can be used in the textbox of any messages section on the IRC View or in aliases. The parameter for the command can be a single Auto Action statement or a full block of code surrounded by braces (called a non-conditional block). Due to the nature of aliases and textbox entries, a block cannot have multiple lines, but must use spaces instead. For /action to display its result in the IRC View, "return" must be used in the Auto Action command. Since Auto Actions also support IRC commands, "/action" can also be followed by other IRC commands.

An example "/action" command:

/action /privmsg #mychannel :The 15th number of the Fibonacci Sequence is { set max = 15; set i = 0; set global.fibonacciSum = 0; while (i < max) { i = i + 1; set a = 0; set b = 1; set j = 0; while (j < i) { j = 1 + j; set temp = a; a = b; b = temp + b; } global.fibonacciSum = global.fibonacciSum + a; } return global.fibonacciSum; }

The command above calculates the 15th number of the Fibonacci Sequence and sends the message "The 15th number of the Fibonacci Sequence is 1596" to the channel #mychannel.

How to determine if your Auto Actions are erroring?

Tap the Auto Action Manager item on the dashboard section of the Hub page. Then tap the Tap "Auto Action Manager" on the Dashboard pane. Then tap the "Console" button in the appbar of the pane. On the Auto Actions Console pane, select the appropriate Action Group from the Action Groups dropdown. The console area will show messages printed by your Auto Actions, including errors.

Auto Action Manager Overview

Auto Action Manager
1. **Bar Files:** List of Auto Action script files currently added to the client. 2. **Status:** Shows if the selected script file is loaded or unloaded. 3. **Unload/Load:** Gives the option to load or unload the selected script. Loading the script will initialize the script and make it accessible for execution. Unloading will do the opposite. The text of the button changes depending on the status of the selected script. 4. **Debug:** Launches the debugger for the selected script file. Desktop only. 5. **Delete:** Unloads and deletes the selected script file. 6. **Edit:** Edit the selected script file in the [Auto Action Editor](../../howto/autoactionshowto#Auto_Action_Editor_Overview). 7. **Auto Action Console:** Opens the [Auto Action Console](../../howto/autoactionshowto#Auto_Action_Console_Overview). 6. **New:** Opens the [Auto Action Editor](../../howto/autoactionshowto#Auto_Action_Editor_Overview) to create a new script.


Auto Action Console Overview

Auto Action Console
1. **Action Groups:** Drop down containing the list of action groups currently loaded in the client. The selected action group will be targeted by other operations in the pane. 2. **Stop/Start:** Prevents any actions in the [selected action group](../../howto/autoactionshowto#Action_Groups) from running and halts all actions that are currently running, or removes the restriction if it is already stopped. 3. **Console:** Displays errors that occurs while running Auto Actions and messages written to the console by Auto Action scripts. 4. **Send:** Allows you to send a command within the context of the [selected action group](../../howto/autoactionshowto#Action_Groups).


Auto Action Editor Overview

Auto Action Editor

  1. Name: The display name of the Auto Action script.

  2. Import: Allows you to select a file from the filesystem to load into the client.

  3. Code: The text of the script. See Auto Actions Reference.

  4. Status: Shows if the selected script file is loaded or unloaded. If the script failed to load, a reason will be given.

  5. Debug On Load: If enabled, the debugger for the script will automatically open and breakpoint if the script is loaded successfully. Desktop only. Default: Off

  6. Save: The new version of the script file will be saved in the client, but will not be loaded.

  7. Unload/Load: Gives the option to load or unload the selected script. Loading the script will initialize the script and make it accessible for execution. Unloading will do the opposite. The text of the button changes depending on the status of the selected script.


Action Debugger Overview

Action Debugger

  1. Script Execution IDs: A drop down containing the list of script executions currently at a breakpoint in the debugger. Switching the selection will change the debugger view to show the current state of the script execution that is selected.

  2. Script: The full text of the script.

  3. Breakpoint Bar: Adds or removes a breakpoint by clicking on the location of the breakpoint bar that corresponds to the line of the script.

  4. Breakpoint: The way a breakpoint is displayed when it is successfully added. The breakpoint will activate immediately before the corresponding line of the script is allowed to execute.

  5. Line of Execution: The line of the script which will be executed next when the debugger steps.

  6. Continue: Allows the script to continue execution until the next breakpoint is hit.

  7. Step Next in File: The debugger will pause script execution immediately before the next line in the script is executed.

  8. Step Out: The debugger will continue script execution and pause script execution immediately before executing the next line of the action that called the current action being executed if applicable.

  9. Step Over: The debugger will continue script execution and pause script execution immediately before executing the next line in the current or calling action.

  10. Step Next: The debugger will continue script execution and pause script execution immediately before executing the next line to be executed.

  11. Console Log: All error and console messages from the script being debugged.

  12. Execute New Command: When script execution is paused, this allows you to enter a command to executed in the same context of the line waiting to be executed. For commands that return a value, the "return" keyword can be used before the command to automatically print the returned value to the console. For example: return "hello world"

  13. Local Variable: When execution is paused, this displays the names of all variables in the local scope. The value of the selected variable in the list will be displayed in Variable Value.

  14. Group Variable: When execution is paused, this displays the names of all variables in the group scope. The value of the selected variable in the list will be displayed in Variable Value.

  15. Global Variable: When execution is paused, this displays the names of all variables in the global scope. The value of the selected variable in the list will be displayed in Variable Value.

  16. Server Variable: When execution is paused, this displays the names of all variables in the server scope. The value of the selected variable in the list will be displayed in Variable Value.

  17. Selected Variable: When execution is paused, this displays the name of the currently selected variable.

  18. Selected Variable Value: When execution is paused, this displays the value held by the currently selected variable.