Beispiel #1
0
        private void button2_Click(object sender, EventArgs e) // Send fake
        {
            var coords = new Coordinates()
            {
                x = (int)X.Value, y = (int)Y.Value
            };
            var numOfWaves = (int)WavesCount.Value;
            var perSec     = (int)wavesPerSec.Value;

            var firstWave = sendNow.Checked ? DateTime.Now.AddHours(-3) : GetArrival();

            var attacks = new List <SendWaveModel>();

            for (int i = 0; i < numOfWaves; i++)
            {
                var attk = new SendWaveModel();
                attk.Troops = new int[11];
                if (i == 0)
                {
                    attk.Arrival = firstWave;
                }
                else
                {
                    attk.DelayMs = (int)(1000 / perSec);
                }

                attk.FakeAttack   = true;
                attk.Coordinates  = coords;
                attk.MovementType = Classificator.MovementType.Attack;
                attk.Troops[7]    = 1;
                attacks.Add(attk);
            }
            sendWaves.Add(attacks);
            UpdateUc();
        }
Beispiel #2
0
        private void confirmNewVill_Click(object sender, EventArgs e)
        {
            var coords     = coordinatesUc1.Coords;
            var numOfWaves = (int)WavesCount.Value;
            var perSec     = (int)wavesPerSec.Value;
            var catas      = (int)catasPerWave.Value;

            var firstWave = sendNow.Checked ? DateTime.Now.AddHours(-3) : GetArrival();
            var attacks   = new List <SendWaveModel>();

            for (int i = 0; i < numOfWaves; i++)
            {
                var attk = new SendWaveModel();
                attk.Troops = new int[11];
                if (i == 0)
                {
                    attk.Troops     = SendAllTroops();
                    attk.Arrival    = firstWave;
                    attk.Troops[10] = hero.Checked ? 1 : 0;
                }
                else
                {
                    attk.DelayMs = (int)(1000 / perSec);
                }

                attk.TargetCoordinates = coords;
                attk.MovementType      = Classificator.MovementType.Attack;
                attk.Troops[7]         = catas;
                attacks.Add(attk);
            }
            sendWaves.Add(attacks);
            UpdateUc();
        }
Beispiel #3
0
 private string GetWaveType(SendWaveModel attk)
 {
     if (attk.FakeAttack)
     {
         return("Fake attack");
     }
     else if (attk.AllOff)
     {
         return("Real attack");
     }
     else
     {
         return("Catas");
     }
 }
Beispiel #4
0
 private string GetWaveType(SendWaveModel attk)
 {
     if (attk.FakeAttack)
     {
         return("Fake attack");
     }
     else if (attk.Troops.Any(x => x < 0))
     {
         return("Real attack");
     }
     else
     {
         return("Catas");
     }
 }
Beispiel #5
0
        private string GetWaveType(SendWaveModel attk)
        {
            string type = "";

            if (attk.FakeAttack)
            {
                type = "Fake attack";
            }
            else if (attk.AllOff)
            {
                type = "Real attack";
            }
            else
            {
                type = "Catas";
            }
            return(type);
        }
        private void button3_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Not yet implemented");
            return;

            var acc    = GetSelectedAcc();
            var coords = new Coordinates(-52, -59);

            var waves = new List <SendWaveModel>();

            for (int i = 0; i < 10; i++)
            {
                var attk = new SendWaveModel();
                attk.Troops = new int[11];
                if (i == 0)
                {
                    attk.Arrival = DateTime.Now.AddHours(-1).AddMinutes(2);
                    attk.Arrival = attk.Arrival.AddSeconds(60 - attk.Arrival.Second);
                    acc.Wb.Log($"Arrive at {attk.Arrival}");
                }
                else
                {
                    attk.DelayMs = 1000;
                }

                attk.TargetCoordinates = coords;
                attk.MovementType      = Classificator.MovementType.Reinforcement;
                attk.Troops[0]         = 5555;

                waves.Add(attk);
            }


            var waveTask = new SendWaves()
            {
                ExecuteAt      = DateTime.Now,
                Vill           = AccountHelper.GetMainVillage(acc),
                SendWaveModels = waves.ToList(),
                Priority       = Files.Tasks.BotTask.TaskPriority.High
            };

            TaskExecutor.AddTask(acc, waveTask);
        }