Example #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;
        }
Example #2
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");
            }
        }