Esempio n. 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;
        }
Esempio n. 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);
        }
Esempio n. 3
0
        public static int GetSaltBalanceNum()
        {
            int x = 0;

            if (Int32.TryParse(JavaScriptService.EvaluateJS("balance", frontPageBrowser), out x))
            {
                return(x);
            }
            else
            {
                return(0);
            }
        }
Esempio n. 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");
            }
        }
Esempio n. 5
0
 public static string GetBetState()
 {
     return(JavaScriptService.EvaluateJS("betstate", frontPageBrowser));
 }
Esempio n. 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)");
        }
Esempio n. 7
0
        public static int GetPayout()
        {
            var payout = JavaScriptService.EvaluateJS("payout", frontPageBrowser);

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