/// <summary> /// Creates a BotData object given some parameters. /// </summary> /// <param name="globalSettings">The global RuriLib settings</param> /// <param name="configSettings">The settings for the current Config</param> /// <param name="data">The wrapped data line to check</param> /// <param name="proxy">The proxy to use (set to null if none)</param> /// <param name="useProxies">Whether to use the proxy for requests</param> /// <param name="botNumber">The number of the bot that is creating this object</param> /// <param name="isDebug">Whether this object is created from a Debugger or from a Runner</param> public BotData(RLSettingsViewModel globalSettings, ConfigSettings configSettings, CData data, CProxy proxy, bool useProxies, int botNumber = 0, bool isDebug = true) { Data = data; Proxy = proxy; UseProxies = useProxies; Status = BotStatus.NONE; BotNumber = BotNumber; GlobalSettings = globalSettings; ConfigSettings = configSettings; Balance = 0; Screenshots = new List <string>(); Variables = new VariableList(); // Populate the Variables list with hidden variables Address = ""; ResponseCode = "0"; ResponseSource = ""; Cookies = new Dictionary <string, string>(); ResponseHeaders = new Dictionary <string, string>(); try { foreach (var v in Data.GetVariables()) { Variables.Set(v); } } catch { } GlobalVariables = new VariableList(); GlobalCookies = new CookieDictionary(); LogBuffer = new List <LogEntry>(); Driver = null; BrowserOpen = false; IsDebug = isDebug; BotNumber = botNumber; }
/// <summary> /// Creates a BotData object given some parameters. /// </summary> /// <param name="globalSettings">The global RuriLib settings</param> /// <param name="configSettings">The settings for the current Config</param> /// <param name="data">The wrapped data line to check</param> /// <param name="proxy">The proxy to use (set to null if none)</param> /// <param name="useProxies">Whether to use the proxy for requests</param> /// <param name="random">A reference to the global random generator</param> /// <param name="botNumber">The number of the bot that is creating this object</param> /// <param name="id">Data id Runner</param> /// <param name="isDebug">Whether this object is created from a Debugger or from a Runner</param> public BotData(RLSettingsViewModel globalSettings, ConfigSettings configSettings, CData data, CProxy proxy, bool useProxies, Random random, int botNumber = 0, bool isDebug = true) { Data = data; Proxy = proxy; UseProxies = useProxies; this.random = new Random(random.Next(0, int.MaxValue)); // Create a new local RNG seeded with a random seed from the global RNG Status = BotStatus.NONE; BotNumber = BotNumber; GlobalSettings = globalSettings; ConfigSettings = configSettings; Balance = 0; Screenshots = new List <string>(); Variables = new VariableList(); // Populate the Variables list with hidden variables Address = ""; ResponseCode = "0"; ResponseSource = ""; ResponseStream = null; Cookies = new Dictionary <string, string>(); ResponseHeaders = new Dictionary <string, string>(); try { foreach (var v in Data.GetVariables(ConfigSettings.EncodeData)) { Variables.Set(v); } } catch { } GlobalVariables = new VariableList(); GlobalCookies = new CookieDictionary(); LogBuffer = new List <LogEntry>(); Driver = null; BrowserOpen = false; IsDebug = isDebug; BotNumber = botNumber; CustomObjects = new Dictionary <string, object>(); }