int Between(int min, int max);
double NextDouble(); // get a random value between 0f and 1f
void Wait(int milliseconds);
string UrlEncode(string text);
string EscapeString(string text);
Use these methods to get the __source and the eventType.
EventSource GetSource();
EventType GetEventType();
Examples:
if (CPH.GetEventType() == EventType.YouTubeFirstWords) { ... }
if (CPH.GetSource() == EventSource.Twitch) { ... }
To use this feature you need to add this to the top of the code.
using Streamer.bot.Common.Events;
bool RunAction(string actionName, bool runImmediately = true);
bool RunActionById(string actionId, bool runImmediately = true);
void DisableAction(string actionName);
void EnableAction(string actionName);
bool ActionExists(string actionName);
void PauseActionQueue(string name);
void PauseAllActionQueues();
void ResumeActionQueue(string name, bool clear = false);
void ResumeAllActionQueues(bool clear = false);
void PlaySound(string fileName, float volume = 1.0f, bool finishBeforeContinuing = false);
void PlaySoundFromFolder(string path, float volume = 1.0f, bool recursive = false, bool finishBeforeContinuing = false);
void KeyboardPress(string keyPress);
bool ExecuteMethod(string executeCode, string methodName);
void LogInfo(string logLine);
void LogWarn(string logLine);
void LogDebug(string logLine);
void LogVerbose(string logLine);
void AddToCredits(string section, string value, bool json = true)
void ResetCredits();
void ResetFirstWords();
void DisableTimer(string timerName);
void EnableTimer(string timerName);
set an argument to be used in subsequent sub-actions
void SetArgument(string variableName, object value);