Actions and action queues¶
C# methods for a Run C# code step. See C# methods for how to use them.
ActionExists¶
Checks whether you have an action with this name. Big and small letters do not matter.
bool ActionExists(string actionName)
Gives back: true when the action exists, otherwise false.
Example
bool exists = CPH.ActionExists("Raid Alert");
CPH.LogInfo($"Raid Alert exists: {exists}");
GetActions¶
Gives you a list of all your actions, each with its id, name, group, whether it is on, how many sub-actions it has, and its queue.
List<ActionData> GetActions()
Gives back: A list of your actions.
Example
var actions = CPH.GetActions();
CPH.LogInfo($"You have {actions.Count} actions.");
EnableAction¶
Turns an action on, by its name. If no action has that name, Cuebot writes a warning in the log.
void EnableAction(string actionName)
Gives back: Nothing.
Example
CPH.EnableAction("Raid Alert");
DisableAction¶
Turns an action off, by its name, so its triggers no longer run it. If no action has that name, Cuebot writes a warning in the log.
void DisableAction(string actionName)
Gives back: Nothing.
Example
CPH.DisableAction("Raid Alert");
EnableActionById¶
Turns an action on, by its id. Stops your code with an error when no action has that id.
void EnableActionById(string actionId)
Gives back: Nothing.
Example
CPH.EnableActionById("5f2c1a7e-3b4d-4e8f-9a10-2b3c4d5e6f70");
DisableActionById¶
Turns an action off, by its id. Stops your code with an error when no action has that id.
void DisableActionById(string actionId)
Gives back: Nothing.
Example
CPH.DisableActionById("5f2c1a7e-3b4d-4e8f-9a10-2b3c4d5e6f70");
RunAction¶
Runs another action by its name, with this action's variables. By default it runs now and waits for it. Pass false to put it in its queue and go on at once.
bool RunAction(string actionName, bool runImmediately = true)
Gives back: true when it worked (or was queued). false when no action has that name.
Example
bool ok = CPH.RunAction("Shoutout");
CPH.LogInfo($"Shoutout worked: {ok}");
RunActionById¶
Runs another action by its id, with this action's variables. By default it runs now and waits. Pass false to queue it and go on at once.
bool RunActionById(string actionId, bool runImmediately = true)
Gives back: true when it worked (or was queued). false when no action has that id.
Example
bool ok = CPH.RunActionById("5f2c1a7e-3b4d-4e8f-9a10-2b3c4d5e6f70");
CPH.LogInfo($"Ran it: {ok}");
PauseActionQueue¶
Pauses an action queue by its name. Actions waiting in it stay there until you resume it.
void PauseActionQueue(string queueName)
Gives back: Nothing.
Example
CPH.PauseActionQueue("Alerts");
ResumeActionQueue¶
Starts a paused action queue again. Pass true as the second value to throw away the actions still waiting in it first.
void ResumeActionQueue(string queueName, bool clear = false)
Gives back: Nothing.
Example
CPH.ResumeActionQueue("Alerts", true);
PauseAllActionQueues¶
Pauses every action queue at once. Handy for a "be right back" break.
void PauseAllActionQueues()
Gives back: Nothing.
Example
CPH.PauseAllActionQueues();
ResumeAllActionQueues¶
Starts every action queue again. Pass true to throw away all waiting actions first.
void ResumeAllActionQueues(bool clear = false)
Gives back: Nothing.
Example
CPH.ResumeAllActionQueues();