コード例 #1
0
        public void PlaceBet(Players player, int BetAmount)
        {
            if (BetAmount > PlayerInformation.SaltAmount)
            {
                BetAmount = PlayerInformation.SaltAmount;
            }

            var playerId = "player1";

            if (player == Players.BluePlayer)
            {
                playerId = "player2";
            }

            bool successflag1, successflag2;

            JavaScriptService.ExecuteJS($"document.getElementById(\"wager\").value = \"{BetAmount}\"", SaltyConsole.frontPageBrowser, out successflag1);
            JavaScriptService.ExecuteJS($"document.getElementById(\"{playerId}\").click()", SaltyConsole.frontPageBrowser, out successflag2);

            if (!successflag1 || !successflag2)
            {
                MatchInformation.HasPlacedBet = false;
                return;
            }

            MatchInformation.SaltBettedOnMatch = BetAmount;
            MatchInformation.SaltBeforeMatch   = PlayerInformation.SaltAmount;
            SessionStatistics.MatchesPlayed++;
            MatchInformation.currentBettedPlayer = player == Players.RedPlayer ? MatchInformation.currentRedPlayer : MatchInformation.currentBluePlayer;
            MatchInformation.HasPlacedBet        = true;
        }
コード例 #2
0
        public static int GetBracketCount()
        {
            var countText = JavaScriptService.EvaluateJS("$(\"#footer-alert\").text()", frontPageBrowser);

            if (string.IsNullOrWhiteSpace(countText))
            {
                return(0);
            }

            var chars = countText.Substring(0, 2).Trim();

            return(int.TryParse(chars, out var count) ? count : 0);
        }
コード例 #3
0
        public static int GetSaltBalanceNum()
        {
            int x = 0;

            if (Int32.TryParse(JavaScriptService.EvaluateJS("balance", frontPageBrowser), out x))
            {
                return(x);
            }
            else
            {
                return(0);
            }
        }
コード例 #4
0
        public void Login()
        {
            if (browser.Address == "https://www.saltybet.com/authenticate?signin=1")
            {
                JavaScriptService.ExecuteJS($"document.getElementById(\"email\").value = \"{email}\"", browser);
                JavaScriptService.ExecuteJS($"document.getElementById(\"pword\").value = \"{password}\"", browser);
                JavaScriptService.ExecuteJS($"document.getElementById(\"signinform\").submit()", browser);

                IsLoggedIn = true;
            }
            else
            {
                browser.Load("https://www.saltybet.com/authenticate?signin=1");
            }
        }
コード例 #5
0
 public static string GetBetState()
 {
     return(JavaScriptService.EvaluateJS("betstate", frontPageBrowser));
 }
コード例 #6
0
        public static bool GetTournamentActive()
        {
            var result = JavaScriptService.EvaluateJS("$(\"html body div#wrapper.locked div#bottomcontent form#fightcard div#balancewrapper span#tournament-note\").text()", frontPageBrowser);

            return(result == "(Tournament Balance)");
        }
コード例 #7
0
        public static int GetPayout()
        {
            var payout = JavaScriptService.EvaluateJS("payout", frontPageBrowser);

            return(int.TryParse(payout, out var count) ? count : 0);
        }
コード例 #8
0
 public static string GetFooterText()
 {
     return(JavaScriptService.EvaluateJS("$(\"#footer-alert\").text()", frontPageBrowser));
 }
コード例 #9
0
 public static string GetPossibleWinningSalt()
 {
     return(JavaScriptService.EvaluateJS("lastWager", frontPageBrowser));
 }
コード例 #10
0
 public static string GetAccountName()
 {
     return(JavaScriptService.EvaluateJS("", frontPageBrowser));
 }
コード例 #11
0
 public static string GetSalt()
 {
     return(JavaScriptService.EvaluateJS("balance", frontPageBrowser));
 }
コード例 #12
0
 public static string GetBluePot()
 {
     return(JavaScriptService.EvaluateJS("p2te", frontPageBrowser));
 }
コード例 #13
0
 public static string GetRedName()
 {
     return(JavaScriptService.EvaluateJS("p1n", frontPageBrowser));
 }