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; }
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); }
public static int GetSaltBalanceNum() { int x = 0; if (Int32.TryParse(JavaScriptService.EvaluateJS("balance", frontPageBrowser), out x)) { return(x); } else { return(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"); } }
public static string GetBetState() { return(JavaScriptService.EvaluateJS("betstate", frontPageBrowser)); }
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)"); }
public static int GetPayout() { var payout = JavaScriptService.EvaluateJS("payout", frontPageBrowser); return(int.TryParse(payout, out var count) ? count : 0); }
public static string GetFooterText() { return(JavaScriptService.EvaluateJS("$(\"#footer-alert\").text()", frontPageBrowser)); }
public static string GetPossibleWinningSalt() { return(JavaScriptService.EvaluateJS("lastWager", frontPageBrowser)); }
public static string GetAccountName() { return(JavaScriptService.EvaluateJS("", frontPageBrowser)); }
public static string GetSalt() { return(JavaScriptService.EvaluateJS("balance", frontPageBrowser)); }
public static string GetBluePot() { return(JavaScriptService.EvaluateJS("p2te", frontPageBrowser)); }
public static string GetRedName() { return(JavaScriptService.EvaluateJS("p1n", frontPageBrowser)); }