Exemplo n.º 1
0
 private void ClickPlayer(ScoreUpdEventArgs marketArgs)
 {
     switch (toClickIndex)
     {
         case 0:
             if (radioButtonAdv1.Checked)
                 if ((Player.toIntScore(marketArgs.ChangetMarket.ScoreNewOne) == 0) && (prevPlayerOneScore != Player.toIntScore(marketArgs.ChangetMarket.ScoreNewOne)))
                 {
                     prevClickScore = 0;
                     SimulateMouseClick.DoMouseClick();
                 }
             if (radioButtonAdv2.Checked)
                 if ((Player.toIntScore(marketArgs.ChangetMarket.ScoreNewTwo) == 0) && (prevPlayerTwoScore != Player.toIntScore(marketArgs.ChangetMarket.ScoreNewTwo)))
                 {
                     prevClickScore = 0;
                     SimulateMouseClick.DoMouseClick();
                 }
             break;
         case 15:
             if (radioButtonAdv1.Checked)
                 if ((Player.toIntScore(marketArgs.ChangetMarket.ScoreNewOne) == 15) && (prevPlayerOneScore != Player.toIntScore(marketArgs.ChangetMarket.ScoreNewOne)))
                 {
                     prevClickScore = 15;
                     SimulateMouseClick.DoMouseClick();
                 }
             if (radioButtonAdv2.Checked)
                 if ((Player.toIntScore(marketArgs.ChangetMarket.ScoreNewTwo) == 15) && (prevPlayerTwoScore != Player.toIntScore(marketArgs.ChangetMarket.ScoreNewTwo)))
                 {
                     prevClickScore = 15;
                     SimulateMouseClick.DoMouseClick();
                 }
             break;
         case 30:
             if (radioButtonAdv1.Checked)
                 if ((Player.toIntScore(marketArgs.ChangetMarket.ScoreNewOne) == 30) && (prevPlayerOneScore != Player.toIntScore(marketArgs.ChangetMarket.ScoreNewOne)))
                 {
                     prevClickScore = 30;
                     SimulateMouseClick.DoMouseClick();
                 }
             if (radioButtonAdv2.Checked)
                 if ((Player.toIntScore(marketArgs.ChangetMarket.ScoreNewTwo) == 30) && (prevPlayerTwoScore != Player.toIntScore(marketArgs.ChangetMarket.ScoreNewTwo)))
                 {
                     prevClickScore = 30;
                     SimulateMouseClick.DoMouseClick();
                 }
             break;
         case 40:
             if (radioButtonAdv1.Checked)
                 if ((Player.toIntScore(marketArgs.ChangetMarket.ScoreNewOne) == 40) && (prevPlayerOneScore != Player.toIntScore(marketArgs.ChangetMarket.ScoreNewOne)))
                 {
                     prevClickScore = 40;
                     SimulateMouseClick.DoMouseClick();
                 }
             if (radioButtonAdv2.Checked)
                 if ((Player.toIntScore(marketArgs.ChangetMarket.ScoreNewTwo) == 40) && (prevPlayerTwoScore != Player.toIntScore(marketArgs.ChangetMarket.ScoreNewTwo)))
                 {
                     prevClickScore = 40;
                     SimulateMouseClick.DoMouseClick();
                 }
             break;
         case 50:
             if (radioButtonAdv1.Checked)
                 if ((Player.toIntScore(marketArgs.ChangetMarket.ScoreNewOne) == 50) && (prevPlayerOneScore != Player.toIntScore(marketArgs.ChangetMarket.ScoreNewOne)))
                 {
                     prevClickScore = 50;
                     SimulateMouseClick.DoMouseClick();
                 }
             if (radioButtonAdv2.Checked)
                 if ((Player.toIntScore(marketArgs.ChangetMarket.ScoreNewTwo) == 50) && (prevPlayerTwoScore != Player.toIntScore(marketArgs.ChangetMarket.ScoreNewTwo)))
                 {
                     prevClickScore = 50;
                     SimulateMouseClick.DoMouseClick();
                 }
             break;
     }
 }
Exemplo n.º 2
0
        private void OnPlayerChanged(ScoreUpdEventArgs marketArgs)
        {
            textBoxScoreBetfair.Invoke(new Action(() =>
            {
                radioButtonAdv1.Text = marketArgs.ChangetMarket.Player1.Name;
                radioButtonAdv2.Text = marketArgs.ChangetMarket.Player2.Name;

                textBoxExt7.Text = marketArgs.ChangetMarket.Player1.Name;
                textBoxExt8.Text = marketArgs.ChangetMarket.Player2.Name;

                var betFairScore = marketArgs.ChangetMarket.GetBetfairS();
                var bet365Score = marketArgs.ChangetMarket.Get365S();
                var skybetScore = marketArgs.ChangetMarket.GetSkyBetS();

                digitalGauge1.Value = marketArgs.ChangetMarket.GetNewS();

                betFairScore = CheckForNullScore(betFairScore, labelBetfairInfo, TypeDBO.BetFair);
                bet365Score = CheckForNullScore(bet365Score, labelBet365Info, TypeDBO.Bet365);
                skybetScore = CheckForNullScore(skybetScore, labelSkyInfo, TypeDBO.SkyBet);

                if (marketArgs.ChangetMarket.IsClose)
                {
                    betFairScore = "END";
                    bet365Score = "END";
                    skybetScore = "END";
                    digitalGauge1.Value = "Finished";
                    textBoxStatus.Text = "Finished";
                    textBoxStatus.BackColor = Color.Tomato;
                }
                else
                {
                    textBoxStatus.Text = "In-Play";
                    textBoxStatus.BackColor = Color.SpringGreen;
                }
                textBoxScoreBetfair.Text = betFairScore;
                textBoxScoreBet365.Text = bet365Score;
                textBoxScoreSky.Text = skybetScore;

                ClickPlayer(marketArgs);

                prevPlayerOneScore = Player.toIntScore(marketArgs.ChangetMarket.ScoreNewOne);
                prevPlayerTwoScore = Player.toIntScore(marketArgs.ChangetMarket.ScoreNewTwo);
            }));
        }