Auto Actions Library

Changes in v3.8.4

  • Added Server.GetChannelUser() action.
  • Added more user info to Utils.GetIdentPart().

Changes in v3.7.0

  • Added new Utils actions. (Distinct, GetIdentParts, Join)
  • Added new Server actions. (GetServerSettings, GetSettingsGuid, GetSettingsGuids)
  • Added new Control action. (DelayRun)
  • Added new System actions. (GetSecureProperty, SetSecureProperty, ClearSecureProperties)

Changes in v3.6.0

  • Added new Utils actions. (GetJsonValue, SetJsonValue, ToJson, FromJson, GetXmlValue, SetXmlValue, HttpRequest)
  • Added new System actions. (GetRawSettingSections, GetRawSetting, GetRawSettingProperties, SetRawSetting, HasRawSetting, HasRawSettingSection)

Changes in v3.5.1

  • Added new Utils actions. (AddFirst, AddLast, GetIndices, Insert, RemoveFirst, RemoveLast, ToArray)
  • Fixes for some built-in actions not working with arrays.

Changes in v3.2

  • Added the ability to get and set variables that can be used in Rules.
  • Added the ability to create custom context menus for the server list, channel user list, and channel list.

Changes in v3.0.5

  • Added new Utils actions. (GetAsEpochTime, GetAsFormattedTime)
  • Added new Server actions. (GetServerName, GetServerHostname, TimestampedInMessage, TimestampedNextInMessage)
  • Added extra arguments to some Server actions. (ChannelViewMessage, ServerViewMessage)

Changes in v3.0.4

  • Added new Server action. (NextInMessage)

Changes in v3.0

  • Added new action for detecting when Foo IRC is running in the background.
  • Added the ability to create custom settings and persist them even after the client is closed.
  • Added new action for determining if a server or channel is currently in view of the user.

Changes in v2.8

  • Added the ability to respond to DCC Chat in and out action messages.
  • A registered action can now return the string "ABORT" to stop actions from running immediately after it.
  • Added the ability to set and get DCC Settings.
  • Fix for registered actions not following the proper priority order when priorities are changed.
  • More messages sent to the server by Foo IRC now pass through the OUT stream.

Changes in v2.5

  • Added new built-in Server actions. (Open/CloseUrlList, GetActiveChannels, GetChannelUsers, InMessage, SwitchToChannel, SwitchToNextServer, SwitchToNextView, SwitchToPreviousServer, SwitchToPreviousView, SwitchToServer)
  • Added ability to respond to keyboard input. (KEY stream)

Changes in v2.2.1:

  • Added new actions to the Math and Utils action groups.

Changes in v2.2:

  • Added a System action group.
  • Moved Utils.ConsoleMessage() to the System group.
  • The parameters of Server.OutMessage() and Server.Direct() have changed.
  • Added new actions to the Server action group.

Actions.

Disable(stream, target, eventCode)

Disables auto action triggering for an event. See Keywords for all of the valid values that can be used as parameters for this action.

Parameters:

String stream: The stream to disable the auto action triggering.

String target: The auto actions to target.

String eventCode: The command to disable triggering on.


Enable(stream, target, eventCode)

Enables auto action triggering for an event. See Keywords for all of the valid values that can be used as parameters for this action.

Parameters:

String stream: The stream to enable the auto action triggering.

String target: The auto actions to target.

String eventCode: The command to enable triggering on.


Register(stream, eventCode, actionName)

Registers an action to be automatically triggered when an event occurs. See Keywords for all of the valid stream and event code values that can be used as parameters for this action.

Parameters:

String stream: The stream to register the action to trigger on.

String eventCode: The command that will trigger the action.

String actionName: The name of the action in the currently running action group to trigger.


RegisterContextOption(target, path, actionName, isAvailableActionName)

Registers an action to be automatically triggered when a user right clicks on a supported context menu target. See Keywords for all of the valid context targets that can be used.

Parameters:

String target: The context target to register the action to trigger on.

String Array path: The hierarchy of the context menu option. Each string in the array represents a label of a sub option in the context menu to get the the option that performs the action.

String actionName: The name of the action in the currently running action group that will be triggered when the context option is selected.

optional String isAvailableActionName: The name of the action in the currently running action group that returns a boolean which determines if the context option should be available.


StartAction(groupName, actionName)

Permits an action in the given group to run.

Parameters:

String groupName: The name of the group that contains the action.

String actionName: The name of the action to permit.


StartAction(actionName)

Permits an action to be run.

Parameters:

String actionName: The name of the action to permit.


StartAll()

Permits all actions of a group to run.


StartGroup(groupName)

Permits all actions of a group to be run.

Parameters:

String groupName: The name of the group whose actions to permit.


StartGroup()

Permits all actions of the current group to run.


SetPriority(stream, eventCode, actionName, priority)

Set the priority of the action which determines the order actions are triggered when an event occurs. The default priority for triggered actions is 100. See Keywords for all of the valid stream and event code values that can be used as parameters for this Action.

Parameters:

String stream: The stream the action is triggered on.

String eventCode: The command that triggers this action.

String actionName: The name of the action in the currently running action group to unregister from being triggered.

Integer priority: The priority of the triggered action with lower numbers being a higher priority.


StopAction(groupName, actionName)

Restricts an action of the given group from being run and stops the action if it is currently running.

Parameters:

String groupName: The name of the group that contains the action.

String actionName: The name of the action to restrict.


StopAction(actionName)

Restricts an action from being run and stops the action if it is currently being run.

Parameters:

String actionName: The name of the action to restrict.


StopAll()

Restricts all actions from being run and stops the actions if they are currently being run.


StopGroup(groupName)

Restricts all actions of the given group from being run and stops the actions if they are currently being run.

Parameters:

String groupName: The name of the group whose actions to restrict.


StopGroup()

Restricts all actions of the current group from being run and stops the actions if they are currently being run.


Unregister(stream, eventCode, actionName)

Unregisters an action from being automatically triggered when an event occurs. See Keywords for all of the valid stream and event code values that can be used as parameters for this Action.

Parameters:

String stream: The stream to unregister triggering the action on.

String eventCode: The command that triggers this action.

String actionName: The name of the action in the currently running action group to unregister from being triggered.


Unregister(actionName)

Unregisters an action from being automatically triggered by any event.

Parameters:

String actionName: The name of the action in the currently running action group to unregister from being triggered.


Unregister()

Unregisters all action in this action group from being automatically triggered by events.


UnregisterContextOption(target, path)

Removes a context menu option from being shown when a user right clicks on a supported context menu target. See Keywords for all of the valid context targets that can be used.

Parameters:

String target: The context target to register the action to trigger on.

String Array path: The hierarchy of the context menu option. Each string in the array represents a label of a sub option in the context menu to get the the option that performs the action.


Control.

Delay(timeSpan)

Execution of the current action is delayed for the given amount of time.

Parameters:

Integer timeSpan: The number of milliseconds to delay.


DelayRun(actionName, data, timeSpan)

Runs the specified action after the given delay. The current action continues running immediately.

Parameters:

String actionName: The name of the action in the current group to run after the delay.

Any data: The variable to send as a parameter to the action called after the delay.

Integer timeSpan: The number of milliseconds to delay.


Async(actionName, isAsync)

Specifies whether the specified action should run asynchronously when triggered by an event. If false, the action will have to complete before other actions are triggered on the stream.

Parameters:

String actionName: The name of the action to change.

Boolean isAsync: True for asynchronous, false for synchronous.


Math.

Abs(value)

Computes the absolute value of a number.

Parameters:

Double value: The number to perform the calculation on.

Returns:

The computed value.


Ceil(value)

Rounds the value up to the next nearest integer.

Parameters:

Double value: The number to perform the calculation on.

Returns:

The computed value.


Cos(value)

Computes the cosine of a number.

Parameters:

Double value: The number to perform the calculation on.

Returns:

The computed value.


Floor(value)

Rounds the value down to the next nearest integer.

Parameters:

Double value: The number to perform the calculation on.

Returns:

The computed value.


Max(value1, value2)

Returns the value of the two that is the highest.

Parameters:

Double value1: The first value.

Double value2: The second value.

Returns:

The maximum value.


Min(value1, value2)

Returns the value of the two that is the lowest.

Parameters:

Double value1: The first value.

Double value2: The second value.

Returns:

The minimum value.


PI()

Gives an approximation of PI.

Returns:

The value of PI.


Power(value, power)

Raises a value to a given power.

Parameters:

Double value: The number to perform the calculation on.

Double power: The exponent.

Returns:

The computed value.


RandomDouble()

Gives a pseudo-random number generated double.

Returns:

The random value.


RandomInt()

Gives a pseudo-random number generated integer.

Returns:

The random value.


Round(value)

Rounds the value to the nearest integer.

Parameters:

Double value: The number to perform the calculation on.

Returns:

The computed value.


Sin(value)

Compute the sine of a number.

Parameters:

Double value: The number to perform the calculation on.

Returns:

The computed value.


Sqrt(value)

Computes the square root of a number.

Parameters:

Double value: The number to perform the calculation on.

Returns:

The computed value.


Tan(value)

Computes the tangent of a number.

Parameters:

Double value: The number to perform the calculation on.

Returns:

The computed value.


Rules.

The Rules group allows you perform actions that interact with the with the Rules system of Foo IRC.


GetServerVariable(variableName, serverGuid)

Gets the value of the server specific Rules variable with the given name.

Parameters:

String variableName: The name of the variable.

optional String serverGuid: The GUID of the server the variable is specific to. If this parameter is not provided, the current server is used.


GetVariable(variableName)

Gets the value of Rules variable with the given name.

Parameters:

String variableName: The name of the variable.


SetServerVariable(variableName, value, serverGuid)

Set the value of the server specific Rules variable with the given name.

Parameters:

String variableName: The name of the variable.

String value: The value to set the variable to.

optional String serverGuid: The GUID of the server the variable is specific to. If this parameter is not provided, the current server is used.


SetVariable(variableName, value)

Sets the value of the Rules variable with the given name.

Parameters:

String variableName: The name of the variable.

String value: The value to set the variable to.


Server.

The Server group allows you perform actions in context of the IRC server that triggered the auto action being run. Calls to actions in this group will fail if no IRC server is the base source of this call.


ChannelViewMessage(channelName, message)

Sends a message to the message view of the specified channel . No message is transmitted to the server.

Parameters:

String channelName: The name of the channel.

String message: The message to send.


ChannelViewMessage(channelName, message, epochTime)

Sends a message to the message view of the specified channel with a specified timestamp. No message is transmitted to the server.

Parameters:

String channelName: The name of the channel.

String message: The message to send.

Double epochTime: A value representing Epoch (POSIX) time, the number of seconds between Jan 1, 1970 00:00:00 and the desired date.


CloseUrlList()

Closes the Url List in the UI for the server that triggered the Action.


CloseUrlList(serverGuid)

Closes the Url List in the UI for the server with the given server GUID.

Parameters:

String serverGuid: The GUID of the server to close the Url List for.


Direct(message)

Sends a raw message to the current server bypassing the OUT stream.

Parameters:

String message: The message to send to the server.


Direct(message, serverGuid)

Sends a raw message to a server bypassing the OUT stream.

Parameters:

String message: The message to send to the server.

String serverGuid: The GUID of the server to send the message to.


GetActiveChannels()

Gets a list of channels currently joined to on the server that triggered this action.


GetActiveChannels(serverGuid)

Gets a list of channels currently joined to on the server with the given server GUID.

Parameters:

String serverGuid: The GUID of the server to get the active channels of.


GetChannelUsers(channelName)

Gets a list of users in the given channel on the server that triggered this Action.

Parameters:

String channelName: The name of the channel.


GetChannelUsers(channelName, serverGuid)

Gets a list of users in the given channel on the server with the given server Guid.

Parameters:

String channelName: The name of the channel.

String serverGuid: The GUID of the server to get the active channels of.


GetServerCount()

Gets the number of server the client is connected to.


GetServerGuid()

Get the server GUID for the server that triggered this Action.


GetServerGuids()

Get the server GUIDs for all of servers the client is currently connected to.


GetServerHostname()

Get the server hostname of the server that triggered this Action.


GetServerHostname(serverGuid)

Get the server hostname of the server with the given server Guid.

Parameters:

String serverGuid: The GUID of the server to get the name of.


GetServerName()

Get the server name of the server that triggered this Action.


GetServerName(serverGuid)

Get the server name of the server with the given server Guid.

Parameters:

String serverGuid: The GUID of the server to get the name of.


GetServerNum()

Get the 0-based index of the server that triggered this Action among the servers the client is connected to.


GetServerSettings(serverGuid)

Gets most server settings for a given server. If serverGuid is not specified, the current server that triggered this action is used.

Parameters:

(Optional) String serverGuid: The GUID of the server to get the settings of.

Return:

An array with the following keys.

{ "autoConnectOnStart", "autoJoinChannels", "autoJoinOnInvite", "enableAutoPing", "enableIdent", "enableOnConnectCommands", "encoding", "guid", "ignoreCertificateErrors", "ignoreList", "name", "nickname", "nickservPassword", "nickservUsername", "onConnectCommands", "partMessage", "port", "proxy", "quitMessage", "rejoinOnDisconnect", "rejoinOnKick", "savedChannels", "saslType", "serverHostname", "serverPassword", "username", "useSASL", "useSSL", "api", }


GetSettingsGuid(serverGuid)

Gets the settings guid for a given server. If serverGuid is not specified, the current server that triggered this action is used.

Parameters:

(Optional) String serverGuid: The GUID of the server to get the settings of.

Return:

The settings guid for the server.


GetSettingsGuids()

Gets all settings guids for all active servers.

Return:

The settings guids for all active servers.


InMessage(message)

Adds a raw message to be processed by the SERVER, USER, or IN_RAW streams as if the message came directly from the server.

Parameters:

String message: The message to send to the incomming message streams for the server.


InMessage(message, serverGuid)

Adds a raw message to be processed by the SERVER, USER, or IN_RAW streams as if the message came directly from the server.

Parameters:

String message: The message to send to the incomming message streams for the server.

String serverGuid: The GUID of the server to send the message to.


InMessage(message, epochTime)

Adds a raw message with the specified timestamp to be processed by the SERVER, USER, or IN_RAW streams as if the message came directly from the server.

Parameters:

String message: The message to send to the incomming message streams for the server.

Double epochTime: A value representing Epoch (POSIX) time, the number of seconds between Jan 1, 1970 00:00:00 and the desired date.


InMessage(message, epochTime, serverGuid)

Adds a raw message with the specified timestamp to be processed by the SERVER, USER, or IN_RAW streams as if the message came directly from the server.

Parameters:

String message: The message to send to the incomming message streams for the server.

String serverGuid: The GUID of the server to send the message to.

Double epochTime: A value representing Epoch (POSIX) time, the number of seconds between Jan 1, 1970 00:00:00 and the desired date.


IsServerViewVisible()

Determines if the server view of the server that triggered this action is currently visible to the user.

Returns:

True if the server view is in view of the user, false otherwise.


IsServerViewVisible(serverGuid)

Determines if the server view for the given server is currently visible to the user.

Parameters:

String serverGuid: The GUID of the server to check the visibility of it's server view.

Returns:

True if the server view is in view of the user, false otherwise.


IsViewVisible(entityName)

Determines if the channel view or private message view that corresponds to the given entity on the server that triggered this action is currently visible to the user.

Parameters:

String entityName: The channel name of the channel or the nickname of the user involved in the private message to check the visibility of it's view.

Returns:

True if the view is in view of the user, false otherwise.


IsViewVisible(entityName, serverGuid)

Determines if the channel view or private message view that corresponds to the given entity on the given server is currently visible to the user.

Parameters:

String entityName: The channel name of the channel or the nickname of the user involved in the private message to check the visibility of it's view.

String serverGuid: The GUID of the server to check the visibility of the view on.

Returns:

True if the server view is in view of the user, false otherwise.


NextInMessage(message)

Adds a raw message to be processed by the SERVER, USER, or IN_RAW streams as if the message came directly from the server. The message will be processed before other waiting messages.

Parameters:

String message: The message to send to the incomming message streams for the server.


NextInMessage(message, serverGuid)

Adds a raw message to be processed by the SERVER, USER, or IN_RAW streams as if the message came directly from the server. The message will be processed before other waiting messages.

Parameters:

String message: The message to send to the incomming message streams for the server.

String serverGuid: The GUID of the server to send the message to.


OpenUrlList()

Opens the Url List in the UI for the server that triggered to Action.


OpenUrlList(serverGuid)

Opens the Url List in the UI for the server with the given server GUID.

Parameters:

String serverGuid: The GUID of the server to open the Url List for.


OutMessage(message)

Sends a raw message to the current server via the OUT stream.

Parameters:

String message: The message to send to the servers OUT stream.


OutMessage(message, serverGuid)

Sends a raw message to a server via its OUT stream.

Parameters:

String message: The message to send to the server.

String serverGuid: The GUID of the server to send the message to.


ServerViewMessage(message)

Sends a message to the console view of the server running this action. No message is transmitted to the server.

Parameters:

String message: The message to send.


ServerViewMessage(message, epochTime)

Sends a message with a specified timestamp to the console view of the server running this action. No message is transmitted to the server.

Parameters:

String message: The message to send.

Double epochTime: A value representing Epoch (POSIX) time, the number of seconds between Jan 1, 1970 00:00:00 and the desired date.


SwitchToChannel(channelName)

Switches the UI to the channel of the server that triggered this Action.

Parameters:

String channelName: The name of the channel.


SwitchToChannel(channelName, serverGuid)

Switches the UI to the channel of the server with the given server GUID.

Parameters:

String serverGuid: The GUID of the server to switch to.

String channelName: The name of the channel.


SwitchToNextServer()

Switches the UI to the next opened Server


SwitchToNextView()

Switches the UI to the next channel or other IRC view.


SwitchToPreviousServer()

Switches the UI to the previous opened server


SwitchToPreviousView()

Switches the UI to the previous channel or other IRC view.


SwitchToServer()

Switches the UI to the server that triggered this Action.


SwitchToServer(serverGuid)

Switches the UI to the server with the given server GUID.

Parameters:

String serverGuid: The GUID of the server to switch to.


TimestampedNextInMessage(message, epochTime)

Adds a raw message with the specified timestamp to be processed by the SERVER, USER, or IN_RAW streams as if the message came directly from the server. The message will be processed before other waiting messages.

Parameters:

String message: The message to send to the incomming message streams for the server.

Double epochTime: A value representing Epoch (POSIX) time, the number of seconds between Jan 1, 1970 00:00:00 and the desired date.


TimestampedNextInMessage(message, epochTime, serverGuid)

Adds a raw message with the specified timestamp to be processed by the SERVER, USER, or IN_RAW streams as if the message came directly from the server. The message will be processed before other waiting messages.

Parameters:

String message: The message to send to the incomming message streams for the server.

String serverGuid: The GUID of the server to send the message to.

Double epochTime: A value representing Epoch (POSIX) time, the number of seconds between Jan 1, 1970 00:00:00 and the desired date.


Toast(message)

Displays a Windows toast notification to the user.

Parameters:

String message: The message to display in the toast notification.


System.

ClearSecureProperties()

Removes all secure properties stored by Auto Actions.


ClusterSectionExists(clusterName, sectionName)

Determines if the given cluster section within the given settings cluster exists.

Parameters:

String clusterName: The name of the settings cluster.

String sectionName: The name of the cluster section.

Returns:

True if the settings cluster and cluster section exists, false otherwise.


ConsoleMessage(message)

Sends the message to the Auto Action Status console in context of the group that contains the action that called this action.

Parameters:

String message: The message to send to console.


CreateClusterSection(clusterName, sectionName, dataSource)

Create a new cluster section within a settings clusters.

The settings cluster system provides a way to persist data even when the client is closed. There is a three level hierarchy that controls how stored data is organized and presented. The top level is the settings cluster which is equivalent to a settings page in Foo IRC. Below that level is the cluster section which is equivalent to a section on that settings page. Below that level is an individual setting. A setting is constructed by using an array in the global scope. In Foo IRC settings, an array key is equivalent to the label of a setting, while a value is the data that is stored.

Parameters:

String clusterName: The name to give the settings cluster.

String sectionName: The name to give the cluster section.

String dataSource: The name of the global array variable which is currently holding the data. For example, if the name of the variable is global.limits, then this parameter should take in the string value "global.limits".


CreateClusterSection(clusterName, sectionName, dataSource, changeCallback)

Create a new cluster section within a settings clusters.

The settings cluster system provides a way to persist data even when the client is closed. There is a three level hierarchy that controls how stored data is organized and presented. The top level is the settings cluster which is equivalent to a settings page in Foo IRC.. Below that level is the cluster section which is equivalent to a section on that settings page. A settings cluster can have multiple cluster sections Below that level is an individual setting. A setting is constructed by using an array (data source) in the global scope. In Foo IRC settings, an array key is equivalent to the label of a setting, while a value is the data that is stored. Only one array can be chosen as the data source.

Parameters:

String clusterName: The name to give the settings cluster.

String sectionName: The name to give the cluster section.

String dataSource: The name of the global array variable which is currently holding the data. For example, if the name of the variable is global.limits, then this parameter should take in the string value "global.limits".

String changeCallback: The name of an action to call when data in this cluster section has potentially been changed outside of Auto Actions. For example, if the action to call is named "HasUpdates" inside an action group named "Storage", then the value of the string for the name should be "Storage.HasUpdates".


GetDccSetting(name)

Gets the value of the specified DCC setting. See Keywords for all of the valid setting names.

Parameters:

String name: The name of the setting.


GetGeneralServerSetting(name)

Gets the value of the specified general server setting, including default server settings. See Keywords for all of the valid setting names.

Parameters:

String name: The name of the setting.


GetGeneralSetting(name)

Gets the value of the specified general setting. See Keywords for all of the valid setting names.

Parameters:

String name: The name of the setting.


GetRawSetting(storageDestination, section, property)

Gets the value from the raw settings store. The raw settings store is the storage system behind most Foo IRC settings.

Parameters:

String storageDestination: "local" for local storage or "roaming" for roaming storage.

String section: The settings section.

String property: The property containing the value.

Returns:

The settings value.


GetRawSettingProperties(storageDestination, section)

Gets the name of all properties in the specified section from the raw settings store. The raw settings store is the storage system behind most Foo IRC settings.

Parameters:

String storageDestination: "local" for local storage or "roaming" for roaming storage.

String section: The settings section.

Returns:

List of properties.


GetRawSettingSections(storageDestination)

Gets the name of all sections in the raw settings store. The raw settings store is the storage system behind most Foo IRC settings.

Parameters:

String storageDestination: "local" for local storage or "roaming" for roaming storage.

Returns:

List of all sections.


GetSavedServerSetting(settingsGuid, name)

Gets the value of the specified saved server setting for the specified server. See Keywords for all of the valid setting names.

Parameters:

String settingsGuid: The GUID of the saved server settings.

String name: The name of the setting.


GetVersion()

Gets the current version of Foo IRC.

Returns:

The version as a double.


HasRawSetting(storageDestination, section, property)

Determines if the specified section and property from the raw settings store exists. The raw settings store is the storage system behind most Foo IRC settings.

Parameters:

String storageDestination: "local" for local storage or "roaming" for roaming storage.

String section: The settings section.

String property: The settings property.

Returns:

True if the section exist, false otherwise.


HasRawSettingSection(storageDestination, section)

Determines if the specified section from the raw settings store exists. The raw settings store is the storage system behind most Foo IRC settings.

Parameters:

String storageDestination: "local" for local storage or "roaming" for roaming storage.

String section: The settings section.

Returns:

True if the section exist, false otherwise.


IsInBackground()

Determines if the client is currently running in the background.


RemoveClusterSection(clusterName, sectionName)

Removes the given cluster section within the given settings cluster from persistent storage.

Parameters:

String clusterName: The name of the settings cluster that contains the cluster section.

String sectionName: The name of the cluster section to remove.


SaveSettingsClusterChanges()

Ensures that the persistent storage is in sync with array used as the data source.


SetDccSetting(name, value)

Sets the value of the specified DCC setting. See Keywords for all of the valid setting names.

Warning, please use this action with caution. Improper use can result in the data lost and app instability.

Parameters:

String name: The name of the setting.

String value: The value to set the setting to.


SetGeneralServerSetting(name, value)

Sets the value of the specified general server setting, including default server settings. See Keywords for all of the valid setting names.

Warning, please use this action with caution. Improper use can result in the data lost and app instability.

Parameters:

String name: The name of the setting.

String value: The value to set the setting to.


SetGeneralSetting(name, value)

Sets the value of the specified general setting. See Keywords for all of the valid setting names.

Warning, please use this action with caution. Improper use can result in the data lost and app instability.

Parameters:

String name: The name of the setting.

String value: The value to set the setting to.


SetRawSetting(storageDestination, section, property, value)

Sets a value in the raw settings store. The raw settings store is the storage system behind most Foo IRC settings.

Parameters:

String storageDestination: "local" for local storage or "roaming" for roaming storage.

String section: The settings section.

String property: The property to contain the value.

String value: The value.


SettingsClusterExists(clusterName)

Determines if the given settings cluster exists.

Parameters:

String clusterName: The name of the settings cluster.

Returns:

True if the settings cluster exists, false otherwise.


SetSavedServerSetting(settingsGuid, name, value)

Sets the value of the specified saved server setting for the specified server. See Keywords for all of the valid setting names.

Warning, please use this action with caution. Improper use can result in the data lost and app instability.

Parameters:

String settingsGuid: The GUID of the saved server settings.

String name: The name of the setting.


SetSavedServerSetting(settingsGuid, name, value)

Sets the value of the specified saved server setting for the specified server. See Keywords for all of the valid setting names.

Warning, please use this action with caution. Improper use can result in the data lost and app instability.

Parameters:

String settingsGuid: The GUID of the saved server settings.

String name: The name of the setting.


SetSecureProperty(name, value)

Sets a persistent property in secure storage. Useful for password and private key storage. If the value is null, the property will be removed.

Parameters:

String name: The name of the secure property.

String value: The value of the property.


GetSecureProperty(name, value)

Gets a property from secure storage.

Parameters:

String name: The name of the secure property.

Returns:

The value of the property.

Utils.

AddFirst(array, value)

Converts an array to a sequential array, and adds a value to the beginning of the array.

Parameters:

String array: The array to operate on.

String value: The value to add.

Returns:

The new array.


AddLast(array, value)

Converts an array to a sequential array, and adds a value to the end of the array.

Parameters:

String array: The array to operate on.

String value: The value to add.

Returns:

The new array.


AsChar(characterCode)

Converts the given character code (integer) to the equivalent Unicode character in a string.

Parameters:

Integer characterCode: The character code of the character.

Returns:

Single character string that is the unicode character.


BeginsWith(text, subString)

Returns whether the string began with the substring.

Parameters:

String text: The full string.

String subString: The substring.

Returns:

Boolean True if the string starts with the substring. False otherwise.


CharAt(text, index)

Returns the character at the given position of the string.

Parameters:

String text: The string.

Integer index: The position of the character in the string.

Returns:

String The character at the given position.


Contains(text, subString)

Returns whether the string contains the substring.

Parameters:

String text: The full string.

String subString: The substring.

Returns:

Boolean True if the string contains the substring. False otherwise.


Contains(array, item)

Returns whether the array contains the item.

Parameters:

Array array: The array

Variable item: The item.

Returns:

Boolean True if the array contains the item. False otherwise.


Count(item)

Gives the length of a string or array.

Parameters:

Any item: The item to get the size of.

Returns:

The length of the string or array.

Distinct(array)

Returns a new array with duplicate values removed.

Parameters:

Array array: The source array.

Returns:

Array with no duplicated values.


EndsWith(text, subString)

Returns whether the string ends with the substring.

Parameters:

String text: The full string.

String subString: The substring.

Returns:

Boolean True if the string ends with the substring. False otherwise.


FromJson(json)

Converts JSON to a variable.

Parameters:

String json: The JSON string.

Returns:

Variable with the full JSON mapping.


Format(format, params...)

Replaces the format items in the format string with the corresponding parameter. This action supports an unlimited number of parameters.

Parameters:

String format: String with formats.

String... params: Zero or more parameters used to be used in the string format.

Returns:

The formatted string


GetAsEpochTime()

Converts the current time as a Epoch (POSIX) time value, the number of seconds between Jan 1, 1970 00:00:00 and the current time.

Returns:

The current date/time converted Epoch (POSIX) time.


GetAsEpochTime(time)

Converts the given date/time text (e.g. 9/10/2013 5:00) as a Epoch (POSIX) time value, the number of seconds between Jan 1, 1970 00:00:00 and the desired date/time.

Parameters:

String time: The date/time text to convert.

Returns:

The date/time converted Epoch (POSIX) time.


GetAsFormattedTime(format)

Converts the current time to text using the given date format.

Parameters:

String format: The date format. (e.g. M/d/yyyy HH:mm:ss)

Returns:

The formatted date/time text.


GetAsFormattedTime(format, epochTime)

Converts the given Epoch (POSIX) time value to text using the given date format.

Parameters:

String format: The date format. (e.g. M/d/yyyy HH:mm:ss)

Double epochTime: The Epoch (POSIX) time value to convert.

Returns:

The formatted date/time text.


GetIdentParts(ident)

Parses an IRC nickname ident (For example: @[email protected]) into it's various parts.

Parameters:

String ident: The ident string to parse.

Return:

An array with the following keys.

{ "displayName", "fullIdent", "ident", "hostname", "isFullIdent", "mode", "nickname", "username" }


GetIndices(array)

Gets all of the indices of an array.

Parameters:

Array array: The array to get the indices of.

Returns:

An array of all the indices.


GetJsonValue(json, jsonPath)

Gets the value from the JSON string using the JSON path selector.

Parameters:

String json: Full Json string.

String jsonPath: JSON path selector.

Returns:

The value from the JSON string.


GetType(variable)

Returns the type of the given variable as a string.

Parameters:

Variable variable: The variable.

Returns:

String The type of the variable.


GetXmlValue(xml, xpath)

Gets the value from the XML string using the XPATH string.

Parameters:

String xml: Full XML string.

String xpath: XPATH string.

Returns:

The value from the XML string.


IndexOf(text, subString)

Returns the index of the first occurrence of the substring in the given text.

Parameters:

String text: The full string.

String subString: The substring.

Returns:

Integer The index of the first occurrence of the substring in the given text. -1 if the occurrence doesn't exist.


IndexOf(array, item)

Returns the index of the first occurrence of the item in the given array.

Parameters:

Array array: The array.

Variable item: The item.

Returns:

Integer The index of the first occurrence of the item in the given array. -1 if the occurrence doesn't exist.


IndexOf(text, subString, count)

Returns the index of the nth occurrence of the substring in the given text.

Parameters:

String text: The full string.

String subString: The substring.

Integer count: The occurrence to return

Returns:

Integer The index of the nth occurrence of the substring in the given text. -1 if the occurrence doesn't exist.


IndexOf(array, item, count)

Returns the index of the nth occurrence of the item in the given array.

Parameters:

Array array: The array.

Variable item: The item.

Integer count: The occurrence to return

Returns:

Integer The index of the nth occurrence of the item in the given array. -1 if the occurrence doesn't exist.


Insert(array, index, value)

Converts an array to a sequential array, and inserts a value at the specified index of the array.

Parameters:

String array: The array to operate on.

String index: The index to insert the value at.

String value: The value to insert.

Returns:

The new array.


IsMatch(text, regex)

Parameters:

String text: The string to find a match in.

String regex: The regular expression pattern.

Returns:

Boolean True if the regular expression matches the input. False otherwise.


IsSet(variable)

Returns whether the variable is set.

Parameters:

Variable variable: The variable to check.

Returns:

Boolean True if the variable is set. False otherwise.


Join(array, separator)

Combines all of the values of the array into a string separated by the given separator.

Parameters:

Variable array: The array to join the values of.

Variable separator: The separator to use in the string between the array's values

Returns:

The string with all of the values of the array.


Matches(text, regex)

Returns matches in the string found by the regular expression. The matches are stored in an array with three dimensions. Each dimension corresponds to matches, group, and captures respectively. Consider:

set matches = Utils.Matches("38.43.54.5 54.75.35.32",
"\\b(1?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])(?:\\.(1?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])){3}\\b");

This will successfully match the two IP address as follows:

matches[0][0][0] = 38.43.54.5

matches[0][1][0] = 38

matches[0][2][0] = 43

matches[0][2][1] = 54

matches[0][2][2] = 5

matches[1][0][0] = 54.75.35.32

matches[1][1][0] = 54

matches[1][2][0] = 75

matches[1][2][1] = 35

matches[1][2][2] = 32

Parameters:

String text: The string to find matches in.

String regex: The regular expression pattern.

Returns:

Array Array holding the matches.


RemoveFirst(array)

Converts an array to a sequential array, and removes a value from the beginning of the array.

Parameters:

String array: The array to operate on.

Returns:

The new array.


RemoveLast(array)

Converts an array to a sequential array, and removes a value from the end of the array.

Parameters:

String array: The array to operate on.

Returns:

The new array.


SetJsonValue(json, jsonPath, value)

Sets the value on the JSON string using the JSON path selector.

Parameters:

String json: Full Json string.

String jsonPath: JSON path selector.

String value: The value to add to the JSON.

Returns:

The modified JSON wih the value set.


SetXmlValue(xml, xpath, value)

Sets the value on the XML string using the XPATH.

Parameters:

String xml: Full XML string.

String xpath: XPATH selector.

String value: The value to add to the XML.

Returns:

The modified XML wih the value set.


Split(text, separator)

Splits a string into an array of substrings separated by the separator in the string.

Parameters:

String text: The full string.

Integer separator: The separator text used to split the string

Returns:

The array of strings.


Substring(text, startIndex)

Extract a substring from the given string. The substring will include everything in the full string after the start index.

Parameters:

String text: The full string.

Integer startIndex: The location in the string that begins the substring.

Returns:

String The extracted substring.


Substring(text, startIndex, length)

Extract a substring from the given string. The substring will be the specified length and will be extracted from the full string beginning at the start index.

Parameters:

String text: The full string.

Integer startIndex: The location in the string that begins the substring.

Integer length: The length of the substring.

Returns:

String The extracted substring.


Subvalue(text, startIndex)

Extract a value from the given string. The value will be extracted from everything in the full string after the start index. The resulting value may be Boolean, numeric, or a string.

Parameters:

String text: The full string.

Integer startIndex: The location in the string that begins the subvalue.

Returns:

The extracted subvalue.


Subvalue(text, startIndex, length)

Extract a substring from the given string. The subvalue will be extracted using the specified segment length from the full string beginning at the start index.

Parameters:

String text: The full string.

Integer startIndex: The location in the string that begins the subvalue.

Integer length: The length of the string segment this value is extracted from.


ToArray(variable)

Converts a variable to a sequential array.

Parameters:

Variable variable: The variable to convert.

Returns:

The new array.


ToJson(variable)

Converts a variable to JSON.

Parameters:

Variable variable: The variable to convert to JSON.

Returns:

JSON with fully mapped from the variable.


ToLowerCase(text)

Makes a copy of a string but with all letters lower-cased.

Parameters:

String text: The string.

Returns:

String A string with all letters lower-cased.


ToUpperCase(text)

Makes a copy of a string but with all letters upper-cased.

Parameters:

String text: The string.

Returns:

String A string with all letters upper-cased.


Trim(text)

Returns the text with beginning and ending spaces removed.

Parameters:

String text: The string.

Returns:

The text without beginning or ending spaces.


ValueOf(text, index)

Returns the UTF-8 integer value of the character at the given position of the string.

Parameters:

String text: The string.

Integer index: The position of the character in the string.

Returns:

String The UTF-8 integer value of the character at the given position.

Registering Auto Actions

The primary feature of Auto Actions is the ability to register actions to be triggered by events in the application. See Actions.Register(). Actions can be registered to run in response to server events which are differentiated by the message channel (stream) on which an event has occurred. Each stream provides access to certain reserved variables which are accessible from the local scope that provides information about the event.

When an event occurs on a stream, by default, all Actions registered on a stream for an event are run sequentially based on the priority set on the Actions. Priorities are integer values in which lower values take precedence. An Action can prevent all Actions scheduled after it for an event from running by returning the string value "ABORT".

Stream Variables

SERVER Stream

Generally, the SERVER stream receives events that would typically be shown on a servers console. Event codes for these events usually are numeric.

The following are reserved variables used by the SERVER stream:

r_stream: The name of the stream.

r_raw: The full text of the event.

r_eventCode: The event code this action is registered to.

r_serverName: The server hostname used to connect to this server.

r_0 - r_2: Data specific to this event.

USER Stream

Generally, the USER stream receives events that would typically be shown on a channel view.

The following are reserved variables used by the USER stream:

r_stream: The name of the stream.

r_raw: The full text of the event.

r_eventCode: The event code this action is registered to.

r_serverName: The server hostname used to connect to this server.

r_0 - r_4: Data specific to this event.

RAW_IN Stream

The RAW_IN stream receives all messages already processed by the SERVER and USER streams, messages not processed by those streams, and server connection events.

The following are reserved variables used by the RAW_IN stream:

r_stream: The name of the stream.

r_raw: The full text of the event.

r_eventCode: The event code this action is registered to.

r_serverName: The server hostname used to connect to this server.

DCC_IN

The DCC_IN stream receives all messages and connection events received by the client during a DCC Chat session.

The following are reserved variables used by the DCC_IN stream:

r_stream: The name of the stream.

r_raw: The full text of the event.

r_eventCode: The event code this action is registered to.

r_sourceServer: The IRC Server that was used to establish the DCC session.

r_remoteIp: The IP or hostname of the DCC partner.

r_remoteNickname: The nickname of the DCC partner which is used on the IRC Server that was used to establish the DCC session.

r_port: The port used on the host of the DCC session.

OUT Stream

The OUT stream receives user input and directed messages from a servers console, private message views, channel views, and some backend calls. The OUT stream is geared toward output that will be sent to the server.

The following are reserved variables used by the USER stream:

r_stream: The name of the stream.

r_text: The full text of the event.

r_eventCode: The event code this action is registered to.

r_serverName: The server hostname used to connect to this server.

r_channelName: If this event was triggered by user input from a channel view, this will be the name of the channel.

r_userName: If this event was triggered by user input from a private message view, this will be the name of the user view is dedicated to.

DCC_OUT Stream

The DCC_OUT stream receives user input and directed messages from DCC Chat. The DCC_OUT stream is geared toward output that will be sent to the DCC partner.

The following are reserved variables used by the USER stream:

r_stream: The name of the stream.

r_text: The full text of the event.

r_eventCode: The event code this action is registered to.

r_sourceServer: The IRC Server that was used to establish the DCC session.

r_remoteIp: The IP or hostname of the DCC partner.

r_remoteNickname: The nickname of the DCC partner which is used on the IRC Server that was used to establish the DCC session.

r_port: The port used on the host of the DCC session.

KEY Stream

The KEY stream receives keyboard hot-keys inserted by the user of client.

The following are reserved variables used by the KEY stream:

r_stream: The name of the stream.

r_eventCode: The hot-key code this action is registered to.

r_serverName: The server hostname used to connect to this server.

r_channelName: If this event was triggered by hot-keys entered on a channel view, this will be the name of the channel.

r_userName: If this event was triggered by hot-keys entered on a private message view, this will be the name of the user view is dedicated to.

Keywords

Stream

FooIRC has four streams where actions can be triggered in response to events.

SERVER: Receives numeric replies, server ping requests, server pong responses, and server errors.

USER: Receives join, quits, channel messages, topic changes, kicks, etc.

RAW_IN: Receives server messages not caught by the SERVER or USER streams, and status events.

DCC_IN: Receives messages from DCC Chat connections.

OUT: Receives all messages entered in message boxes for IRC Servers by the user and OUT targeted messages.

DCC_OUT: Receives all messages entered in message boxes for DCC Chat by the user and OUT targeted messages.

KEY: Receives keyboard input on the UI.

Target

Specifies what type of auto actions will be affected on a stream.

NATIVE: Auto actions that are already built into Foo IRC.

CUSTOM: Auto actions written by the user.

ALIAS: Auto actions written created by aliases.

ALL: Both native and custom auto actions.

THIS: The action that is currently running.

Context Target

Specifies the context menu target.

SERVERS: Context menu that shows when right-clicking a server name in the server list.

CHANNELS: Context menu that shows when right-clicking a channel name or other view in the channel list.

USERS: Context menu that shows when right-clicking a nickname in the user list of a channel.

Event Codes

SERVER Stream

001-999: Numeric codes. This page outlines what each numeric code means.

AUTHENTICATE, PING, PONG, ERROR

USER Stream Events

JOIN, PART, PRIVMSG, etc. See List of Events for more event codes.

DCC_IN Stream Events

CONNECTIONATTEMPTSTARTED: The client has attempted to open a connection to the DCC partner.

CONNECTIONESTABLISHED: A socket connection with the DCC partner is open.

CONNECTIONREADY: The connection is ready to receive messages.

FORCEDDISCONNECTION: The user has requested to disconnect from the DCC partner.

MESSAGE: A message from the DCC partner.

RECONNECTIONPROCESSSTARTED: The client has began the process to reconnect to the DCC partner after an unexpected disconnection.

SSLCERTIFICATEERROR: The DCC connection was aborted due to a certificate error.

UNEXPECTEDCONNECTIONLOST: The client has been disconnected from the DCC partner unexpectedly.

HOSTSERVERABORTED: The client has closed the server for hosting a DCC connection.

HOSTATTEMPTABORTED: The client could not open a server for hosting a DCC connection.

LISTENINGSTARTED: The client is listening for DCC connections.

RAW_IN Stream Events

CONNECTIONATTEMPTSTARTED: The client has attempted to open a connection to the IRC server.

CONNECTIONESTABLISHED: A socket connection with the IRC server is open.

CONNECTIONREADY: The server is ready to receive commands.

FORCEDDISCONNECTION: The user has requested to disconnect from the server.

LEFTOVERMESSAGE: A message from the server that is not recognized as a SERVER or USER stream event.

CAPTUREDMESSAGE: A message from the server that is recognized as a SERVER or USER stream event.

RECONNECTIONPROCESSSTARTED: The client has began the process to reconnect to the server after an unexpected disconnection.

SSLCERTIFICATEERROR: The server connection was aborted due to a certificate error.

UNEXPECTEDCONNECTIONLOST: The client has been disconnected from the server unexpectedly.

OUT Stream Events

If the OUT streams receives a message beginning with a '/', (e.g. "/post hello sir"), the word directly next to the '/' will be used as the event code (e.g. "POST" in the previous example). If the message does not begin with a '/', then NONE will be the event code.

DCC_OUT Stream Events

If the DCC_OUT streams receives a message beginning with a '/', (e.g. "/post hello sir"), the word directly next to the '/' will be used as the event code (e.g. "POST" in the previous example). If the message does not begin with a '/', then NONE will be the event code.

KEY Stream Events

The KEY streams captures keyboard combinations the UI receives with modifiers keys held at the same time other keys are held. Supported modifiers keys are CONTROL, MENU (alt), and SHIFT. For example, to capture a user pressing CTRL, A, and B keys down, CONTROL+A+B would be the event code.

Supported Keys: LeftButton, RightButton, Cancel, MiddleButton, XButton1, XButton2, Back, Tab, Clear, Enter, Shift, Control, Menu, Pause, CapitalLock, Kana, Hangul, Junja, Final, Hanja, Kanji, Escape, Convert, NonConvert, Accept, ModeChange, Space, PageUp, PageDown, End, Home, Left, Up, Right, Down, Select, Print, Execute, Snapshot, Insert, Delete, Help, Number0, Number1, Number2, Number3, Number4, Number5, Number6, Number7, Number8, Number9, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, LeftWindows, RightWindows, Application, Sleep, NumberPad0, NumberPad1, NumberPad2, NumberPad3, NumberPad4, NumberPad5, NumberPad6, NumberPad7, NumberPad8, NumberPad9, Multiply, Add, Separator, Subtract, Decimal, Divide, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, NumberKeyLock, Scroll, LeftShift, RightShift, LeftControl, RightControl, LeftMenu, RightMenu, GoBack, GoForward, Refresh, Stop, Search, Favorites, GoHome

Settings

Certain settings can be accessed and modified using the System action group.

General Server Settings

Servers, ServerName, Default_Nickname, Default_Port, Default_Username, Default_EnableIdent, Default_EnableAutoPing, Default_UseSSL, Default_UseSASL, Default_RejoinOnDisconnect, Default_QuitMessage, Default_PartMessage, Default_EnableOnConnectCommands, Default_OnConnectCommands, Default_Encoding, Default_AutoConnectOnStart, Default_IgnoreCertificateErrors

General Settings

TimestampFormat, ConnectionRetryAttempts, ConnectionRetryIntervals, EnableServerLogging, LoggingFolder, EnableDebugLogging, LogChannels, LogConsoles, LogQueries, EnableVersionReply, EnablePingReply, savedServerReuseViews, SeparateLogsByDate, UseIdentInDisplayName

Server Settings

Guid, Nickname, Name, NickservUsername, ServerHostname, ServerPassword, NickservPassword, Port, Username, EnableIdent, UseSSL, UseSASL, EnableAutoPing, RejoinOnDisconnect, SavedChannels, AutoJoinChannels, IgnoreList, QuitMessage, PartMessage, EnableOnConnectCommands, OnConnectCommands, Encoding, AutoConnectOnStart, IgnoreCertificateErrors

DCC Settings

SendBlockSize, MaxReceiveFileSize, ReceiveFileNameCollisionAction, HostConnectionTimeout, DefaultHostAddress, RandomizePorts, UseSendAhead, IgnoreDccChatRequests, UseDefaultAddress, IgnoreDccSendRequests, AutoAcceptChatRequests, AutoAcceptSendRequests, UseOldTurboDccHandshake, DefaultSaveLocation, UseDefaultSaveLocation, UseHostAddressFromIrcServer, MinHostPort, MaxHostPort, MaxDccSessions, MaxDccTransfers