public static Hashtable GetHashTableIdMark(List <objMatch> Odd_SboList, List <objMatch> Odd_IbetList) { Hashtable Output = new Hashtable(); foreach (objMatch Odd_Sbo in Odd_SboList) { foreach (objMatch Odd_Ibet in Odd_IbetList) { if (Convert.ToDateTime(Odd_Sbo.TimeNonLive) < Convert.ToDateTime(Odd_Ibet.TimeNonLive)) { continue; } if (UtilSoccer.ChuanTenLeauge_Sbo(Odd_Sbo.LeaugeName) == UtilSoccer.ChuanTenLeauge_Ibet(Odd_Ibet.LeaugeName)) { if (UtilSoccer.ChuanTenTeam_Sbo(Odd_Sbo.HomeName) == UtilSoccer.ChuanTenTeam_Ibet(Odd_Ibet.HomeName) && UtilSoccer.ChuanTenTeam_Sbo(Odd_Sbo.AwayName) == UtilSoccer.ChuanTenTeam_Ibet(Odd_Ibet.AwayName)) { if (UtilSoccer.formatHdp(Odd_Sbo.hdp) == UtilSoccer.formatHdp(Odd_Ibet.hdp) && Odd_Sbo.BetType == Odd_Ibet.BetType) { Output.Add(Odd_Sbo.IdKeo, Odd_Ibet.IdKeo); break; } } } } } return(Output); }
public void playBetLive(ticket o, string money, string IsLive, string phieuchung, string group, bool AutoAccept = true) { o = GetKeoSbo(lstSboLiveBet, o); if (o != null) { int usdbet = int.Parse(money) / int.Parse(usd); double hdp = o.hdp; string keoid = o.keoid; double odd = o.odd; string bettype = o.bettype; string choose = o.choose; string hdpType = ""; if (bettype == "7" || bettype == "9") { hdpType = "2"; } string UrlTicketSbo = "http://" + Util.GetSubstringByString(welcomeLink, "http://", "&").Replace("default", "ticket/ticket") + "&id=" + keoid + "&op=" + choose + "&odds=" + odd + "&hdpType=" + hdpType + "&isor=0&isLive=" + IsLive + "&betpage=18&style=1"; string UrlBetSbo = "http://" + Util.GetSubstringByString(welcomeLink, "http://", "&").Replace("default", "ticket/confirm") + "&sameticket=0&betcount=" + betcount + "&stake=" + usdbet.ToString() + "&ostyle=1&stakeInAuto=10&betpage=18&acceptIfAny=0&autoProcess=0&autoRefresh=1&oid=" + keoid + "&timeDiff=2100"; string data1 = http.Fetch(UrlTicketSbo, HttpHelper.HttpMethod.Get, welcomeLink, null, ip, "ContentLength=0"); string oddbet = Util.GetSubstringByString(data1.Replace("'", "").Replace("Over", "h").Replace("Under", "a").Replace("Tài", "h").Replace("Xỉu", "a"), "," + choose + ",", ","); string infobet = (bettype + choose).Replace("1h", o.home.Substring(0, 5) + "(FT) ").Replace("1a", o.away + "(FT) ").Replace("7h", o.home + "(H1) ").Replace("7a", o.away + "(H1) ").Replace("3h", o.home + "(OFT) ").Replace("3a", o.home + "(UFT) ").Replace("9h", o.home + "(OH1) ").Replace("9a", o.home + "(UH1) ") + hdp + " " + oddbet + " [" + usdbet + "]"; int deviationOdd = UtilSoccer.getDeviationOdd(odd, double.Parse(oddbet)); if (deviationOdd < 0 && AutoAccept == false) { message = "Odd Down:" + deviationOdd; return; } string ProcessBet = http.Fetch(UrlBetSbo, HttpHelper.HttpMethod.Get, welcomeLink, null, ip); if (ProcessBet.IndexOf("onOrderSubmitted") == -1) { db.doInsertTicket("SBOBET", username, o.bettype, o.hdp.ToString(), "", "", choose, oddbet, money, usd, group, phieuchung); message = "BET FAILED" + infobet; db.doInsertTicket("SBO", "BET FAIL", o.bettype, o.hdp.ToString(), o.home, o.away, choose, odd.ToString(), money, usd, group, this.phieuchung); } else { db.doInsertTicket("SBOBET", username, o.bettype, o.hdp.ToString(), o.home, o.away, choose, oddbet, money, usd, group, phieuchung); message = "(OK)" + infobet; betcount++; } if (deviationOdd < 0) { message += "Odd Down:" + deviationOdd; } if (deviationOdd > 0) { message += "Odd Up:" + deviationOdd; } } }
public void playBetLive(ticket o, string money, string IsLive, string phieuchung, string groupinput = "", bool AutoAccept = true) { bool doBet = true; string group = ""; if (groupinput != "") { group = groupinput.Split(',')[1]; } this.phieuchung = phieuchung; int usdbet = int.Parse(money) / int.Parse(usd); double hdp = o.hdp; string keoid = o.keoid; double odd = o.odd; string bettype = o.bettype; string choose = o.choose; string homescore = o.score.Split('-')[0]; string awayscore = o.score.Split('-')[1]; string PostData = "ItemList[0][sportname]=Soccer&ItemList[0][Hscore]=" + homescore + "&ItemList[0][Ascore]=" + awayscore + "&ItemList[0][type]=OU&ItemList[0][bettype]=" + bettype + "&ItemList[0][oddsid]=" + keoid.Trim() + "&ItemList[0][betteam]=" + choose + "&ItemList[0][stake]=" + usdbet; string GetTicket = http.Fetch(mainHost + "/Betting/GetTickets", HttpHelper.HttpMethod.Post, sportLink, PostData, ip); if (GetTicket.Replace("\"", "").IndexOf("ErrorCode:0") == -1) { message = GetTicket; } else { double oddbet = double.Parse(Util.GetSubstringByString(GetTicket.Replace("\"", ""), "DisplayOdds:", ",")); int deviationOdd = UtilSoccer.getDeviationOdd(odd, oddbet); if (groupinput != "") { if (group == "d" && deviationOdd >= -2) { doBet = true; } else if (group == "c" && deviationOdd >= -1) { doBet = true; } else if (deviationOdd >= 0) { doBet = true; } else { doBet = false; message = "Odd Down:" + deviationOdd; db.doInsertTicket("IBET", "ODD DOWN", o.bettype, o.hdp.ToString(), o.home, o.away, choose, odd.ToString(), money, usd, group, this.phieuchung); } } else { message = "group empty"; return; } if (doBet) { string MinBet = Util.GetSubstringByString(GetTicket, "\"Minbet\":\"", "\","); string MaxBet = Util.GetSubstringByString(GetTicket, "Maxbet\":\"", "\","); PostData = PostData + "&ItemList[0][oddsStatus]=&ItemList[0][min]=" + MinBet + "&ItemList[0][max]=" + MaxBet; if (double.Parse(MaxBet) < usdbet) { PostData = PostData.Replace("ItemList[0][stake]=" + usdbet, "ItemList[0][stake]=" + MaxBet); money = (int.Parse(MaxBet.Replace(",", "")) * int.Parse(usd)).ToString(); } usdbet = int.Parse(money) / int.Parse(usd); string infobet = (bettype + choose).Replace("1h", o.home + "(FT) ").Replace("1a", o.away + "(FT) ").Replace("7h", o.home + "(H1) ").Replace("7a", o.away + "(H1) ").Replace("3h", o.home + "(OFT) ").Replace("3a", o.home + "(UFT) ").Replace("9h", o.home + "(OH1) ").Replace("9a", o.home + "(UH1) ") + hdp + " " + oddbet + " [" + usdbet + "]"; string ProcessBet = http.Fetch(mainHost + "/Betting/ProcessBet", HttpHelper.HttpMethod.Post, sportLink, PostData, ip); if (ProcessBet.IndexOf("Đơn cược đã được chấp nhận") < 0 && ProcessBet.IndexOf("Your bet has been accepted") < 0 && ProcessBet.IndexOf("đang được xử lý") < 0) { message = "BET FAILED" + infobet; } else { this.phieuchung = mylib.generateID("T"); this.realmoney = money; db.doInsertTicket("IBET", username, o.bettype, o.hdp.ToString(), o.home, o.away, choose, oddbet.ToString(), money, usd, group, this.phieuchung); message = "(OK)" + infobet; if (deviationOdd > 0) { message += "Odd Up:" + deviationOdd; } } } } }
private void UpdateStringLive() { lstSboLiveBet.Clear(); string DataOddSboLive = http.Fetch(mainLink + "/web-root/restricted/odds-display/today-data.aspx?od-param=2,1,1,1,2,2,2,2,3,1&fi=0&v=0&dl=3", HttpHelper.HttpMethod.Get, null, null); DataOddSboLive = DataOddSboLive.Replace("\\u200C", ""); string leagueDataLive = "[" + Util.GetSubstringByString(DataOddSboLive, "[[[", "]],[[") + "]"; leagueDataLive = leagueDataLive.Replace("],[", "]\n["); hsLeague.Clear(); foreach (string league in leagueDataLive.Split('\n')) { string leagueTemp = league.Replace("[", "").Replace("]", "").Replace("'", ""); string nameleagueTemp = UtilSoccer.ChuanTenLeauge_Sbo(leagueTemp.Split(',')[1]); if (nameleagueTemp.IndexOf("SPECIFIC") != -1 || nameleagueTemp.IndexOf("CORNERS") != -1 || nameleagueTemp.IndexOf("BOOKING") != -1 || nameleagueTemp.IndexOf("FANTASY MATCH") != -1 || nameleagueTemp.IndexOf("WHICH TEAM") != -1 || nameleagueTemp.IndexOf("TOTAL GOALS") != -1 || nameleagueTemp.IndexOf("INJURY") != -1 || nameleagueTemp.IndexOf("WINNER") != -1) { continue; } hsLeague.Add(leagueTemp.Split(',')[0], nameleagueTemp); } string matchDataLive = "[" + Util.GetSubstringByString(DataOddSboLive, "]],[[", "]],[[") + "]"; matchDataLive = matchDataLive.Replace("],[", "]\n["); hsMatch.Clear(); foreach (string matchLive in matchDataLive.Split('\n')) { string matchTempLive = matchLive.Replace("[", "").Replace("]", "").Replace("'", ""); string[] arr_matchTempLive = matchTempLive.Split(','); string idmatchLive = Util.GetSubstringByStringLast(DataOddSboLive, "[", "," + arr_matchTempLive[0]); try { hsMatch.Add(idmatchLive, hsLeague[arr_matchTempLive[2]].ToString() + "," + arr_matchTempLive[3] + "," + arr_matchTempLive[4] + "," + arr_matchTempLive[7]); } catch { continue; } } string oddDataLive = "[[" + Util.GetSubstringByString(DataOddSboLive, ",,[[", "]]],,") + "]]]"; foreach (string OddTempLive in oddDataLive.Split(new string[] { "]],[" }, StringSplitOptions.None)) { objMatch OddLive = new objMatch(); string OddTemp = OddTempLive.Replace("[", "").Replace("]", "").Replace("'", ""); string[] arr_OddTemp = OddTemp.Split(','); string infomatch = ""; try { infomatch = hsMatch[arr_OddTemp[1]].ToString(); } catch { continue; } OddLive.LeaugeName = UtilSoccer.ChuanTenLeauge_Sbo(infomatch.Split(',')[0]); OddLive.HomeName = UtilSoccer.ChuanTenTeam_Sbo(infomatch.Split(',')[1]); OddLive.AwayName = UtilSoccer.ChuanTenTeam_Sbo(infomatch.Split(',')[2]); OddLive.TimeLive = infomatch.Split(',')[3]; OddLive.IdKeo = arr_OddTemp[0]; OddLive.hdp = UtilSoccer.formatHdp(arr_OddTemp[5]); OddLive.BetType = arr_OddTemp[2]; OddLive.Odd1 = arr_OddTemp[6]; OddLive.Odd2 = arr_OddTemp[7]; lstSboLiveBet.Add(OddLive); } }
public bool CheckLai(string Filter) { double oddsspreada = UtilSoccer.profit_odd(Odd1, Odd2); switch (Filter) { case "First_a": switch (BetType) { case "1": if (oddsspreada < -0.05) { return(false); } break; case "3": if (oddsspreada < -0.08) { return(false); } break; case "7": if (oddsspreada < -0.1) { return(false); } break; case "9": if (oddsspreada < -0.1) { return(false); } break; } break; case "First_b": switch (BetType) { case "1": if (oddsspreada < -0.06) { return(false); } break; case "3": if (oddsspreada < -0.09) { return(false); } break; case "7": if (oddsspreada < -0.11) { return(false); } break; case "9": if (oddsspreada < -0.11) { return(false); } break; } break; case "First_c": switch (BetType) { case "1": if (oddsspreada < -0.07) { return(false); } break; case "3": if (oddsspreada < -0.1) { return(false); } break; case "7": if (oddsspreada < -0.12) { return(false); } break; case "9": if (oddsspreada < -0.12) { return(false); } break; } break; case "First_d": switch (BetType) { case "1": if (oddsspreada < -0.07) { return(false); } break; case "3": if (oddsspreada < -0.1) { return(false); } break; case "7": if (oddsspreada < -0.12) { return(false); } break; case "9": if (oddsspreada < -0.12) { return(false); } break; } break; case "Second_a": switch (BetType) { case "1": if (oddsspreada < -0.08) { return(false); } break; case "3": if (oddsspreada < -0.1) { return(false); } break; case "7": if (oddsspreada < -0.12) { return(false); } break; case "9": if (oddsspreada < -0.12) { return(false); } break; } break; case "Second_b": switch (BetType) { case "1": if (oddsspreada < -0.09) { return(false); } break; case "3": if (oddsspreada < -0.11) { return(false); } break; case "7": if (oddsspreada < -0.13) { return(false); } break; case "9": if (oddsspreada < -0.13) { return(false); } break; } break; case "Second_c": switch (BetType) { case "1": if (oddsspreada < -0.1) { return(false); } break; case "3": if (oddsspreada < -0.12) { return(false); } break; case "7": if (oddsspreada < -0.14) { return(false); } break; case "9": if (oddsspreada < -0.14) { return(false); } break; } break; case "Second_d": switch (BetType) { case "1": if (oddsspreada < -0.11) { return(false); } break; case "3": if (oddsspreada < -0.13) { return(false); } break; case "7": if (oddsspreada < -0.15) { return(false); } break; case "9": if (oddsspreada < -0.15) { return(false); } break; } break; } return(true); }
public void playBetLive(ticket o, string money, string IsLive, string phieuchung, string group) { bool doBet = true; string betGroup = group.Split(',')[1]; this.phieuchung = phieuchung; int usdbet = int.Parse(money) / int.Parse(usd); double hdp = o.hdp; string keoid = o.keoid; double odd = o.odd; string bettype = o.bettype; string choose = o.choose; string homescore = o.score.Split('-')[0]; string awayscore = o.score.Split('-')[1]; string PostData = "ItemList[0][sportname]=Soccer&ItemList[0][Hscore]=" + homescore + "&ItemList[0][Ascore]=" + awayscore + "&ItemList[0][type]=OU&ItemList[0][bettype]=" + bettype + "&ItemList[0][oddsid]=" + keoid.Trim() + "&ItemList[0][betteam]=" + choose + "&ItemList[0][stake]=" + usdbet; string GetTicket = http.Fetch(mainHost + "/Betting/GetTickets", HttpHelper.HttpMethod.Post, sportLink, PostData, ip); if (GetTicket.Replace("\"", "").IndexOf("ErrorCode:0") == -1) { message = "IBET: [" + username + "] LOG OUT"; } else { double oddBet = double.Parse(Util.GetSubstringByString(GetTicket.Replace("\"", ""), "DisplayOdds:", ",")); int deviationOdd = UtilSoccer.getDeviationOdd(odd, oddBet); if (betGroup == "d" && deviationOdd <= 2) { doBet = true; } else if (betGroup == "c" && deviationOdd <= 1) { doBet = true; } else if (UtilSoccer.CheckOddChange(odd, oddBet) == "Down") { doBet = false; message = "IBET: [" + username + "] Odd Down " + odd + "/" + oddBet; Thread.Sleep(2000); } if (doBet) { if (UtilSoccer.CheckOddChange(odd, oddBet) == "Up") { message = "IBET: [" + username + "] Odd Up " + odd + "/" + oddBet; } string MinBet = Util.GetSubstringByString(GetTicket, "\"Minbet\":\"", "\","); string MaxBet = Util.GetSubstringByString(GetTicket, "Maxbet\":\"", "\","); PostData = PostData + "&ItemList[0][oddsStatus]=&ItemList[0][min]=" + MinBet + "&ItemList[0][max]=" + MaxBet; if (double.Parse(MaxBet) < usdbet) { PostData = PostData.Replace("ItemList[0][stake]=" + usdbet, "ItemList[0][stake]=" + MaxBet); money = (int.Parse(MaxBet.Replace(",", "")) * int.Parse(usd)).ToString(); } string ProcessBet = http.Fetch(mainHost + "/Betting/ProcessBet", HttpHelper.HttpMethod.Post, sportLink, PostData, ip); if (ProcessBet.IndexOf("Đơn cược đã được chấp nhận") < 0 && ProcessBet.IndexOf("Your bet has been accepted") < 0 && ProcessBet.IndexOf("đang được xử lý") < 0) { message = "IBET: [" + username + "] BET FAILED - INFO: " + o.ToString(); } else { this.phieuchung = mylib.generateID("T"); this.realmoney = money; db.doInsertTicket("IBET", username, o.bettype, o.hdp.ToString(), o.home, o.away, choose, oddBet.ToString(), money, usd, "* " + group, this.phieuchung); message = "IBET: [" + username + "] BET SUCCESS - INFO: " + o.ToString(); } } } }