public BotGame LoadBot(BotInfo info) { BotGame game = new BotGame(Settings.Default.Hostname, Settings.Default.Port, info.Username, info.Password, Settings.Default.RealmID, 0); game.Start(); return(game); }
public BotGame CreateBot() { Log("Creating new bot"); Random random = new Random(); BotGame game = null; do { string username = "******" + random.Next(); string password = random.Next().ToString(); factoryGame.DoSayChat(".account create " + username + " " + password); Thread.Sleep(1000); for (int loginTries = 0; loginTries < 5; loginTries++) { game = new BotGame(Settings.Default.Hostname, Settings.Default.Port, username, password, Settings.Default.RealmID, 0); game.SettingUp = true; game.Start(); for (int tries = 0; !game.Connected && tries < 10; tries++) { Thread.Sleep(1000); } if (!game.Connected) { game.Dispose(); game = null; } else { botInfos.Add(new BotInfo(username, password)); break; } } } while (game == null); game.CreateCharacter(); Thread.Sleep(1000); game.SendPacket(new OutPacket(WorldCommand.ClientEnumerateCharacters)); Thread.Sleep(1000); game.SettingUp = false; return(game); }
public BotGame CreateBot(bool startBot) { Log("Creating new bot"); string username = "******" + randomGenerator.Next(); string password = randomGenerator.Next().ToString(); lock (factoryGame) factoryGame.DoSayChat(".account create " + username + " " + password); uint behaviorRandomIndex = (uint)randomGenerator.Next(100); uint behaviorCurrentIndex = 0; BotBehaviorSettings botBehavior = botBehaviors.Values.First(); foreach (var behavior in botBehaviors.Values) { if (behaviorRandomIndex < behaviorCurrentIndex + behavior.Probability) { botBehavior = behavior; break; } behaviorCurrentIndex += behavior.Probability; } BotGame game = new BotGame(Settings.Default.Hostname, Settings.Default.Port, username, password, Settings.Default.RealmID, 0, botBehavior); if (startBot) { game.Start(); } botInfos.Add(new BotInfo(username, password, botBehavior.Name)); return(game); }
public BotGame CreateBot() { Log("Creating new bot"); string username = "******" + randomGenerator.Next(); string password = randomGenerator.Next().ToString(); lock (factoryGame) factoryGame.DoSayChat(".account create " + username + " " + password); BotGame game = new BotGame(Settings.Default.Hostname, Settings.Default.Port, username, password, Settings.Default.RealmID, 0); game.SettingUp = true; game.Start(); botInfos.Add(new BotInfo(username, password)); return(game); }
public BotGame LoadBot(BotInfo info) { BotGame game = new BotGame(Settings.Default.Hostname, Settings.Default.Port, info.Username, info.Password, Settings.Default.RealmID, 0, botBehaviors[info.BehaviorName]); game.Start(); return game; }
public BotGame CreateBot() { Log("Creating new bot"); string username = "******" + randomGenerator.Next(); string password = randomGenerator.Next().ToString(); lock(factoryGame) factoryGame.DoSayChat(".account create " + username + " " + password); uint behaviorRandomIndex = (uint)randomGenerator.Next(100); uint behaviorCurrentIndex = 0; BotBehaviorSettings botBehavior = botBehaviors.Values.First(); foreach (var behavior in botBehaviors.Values) { if (behaviorRandomIndex < behaviorCurrentIndex + behavior.Probability) { botBehavior = behavior; break; } behaviorCurrentIndex += behavior.Probability; } BotGame game = new BotGame(Settings.Default.Hostname, Settings.Default.Port, username, password, Settings.Default.RealmID, 0, botBehavior); game.SettingUp = true; game.Start(); botInfos.Add(new BotInfo(username, password, botBehavior.Name)); return game; }
public BotGame CreateBot() { Log("Creating new bot"); string username = "******" + randomGenerator.Next(); string password = randomGenerator.Next().ToString(); lock(factoryGame) factoryGame.DoSayChat(".account create " + username + " " + password); BotGame game = new BotGame(Settings.Default.Hostname, Settings.Default.Port, username, password, Settings.Default.RealmID, 0); game.SettingUp = true; game.Start(); botInfos.Add(new BotInfo(username, password)); return game; }