/// <summary> /// stolen bet /// </summary> /// <param name="obj">obj is MatchStatus</param> public async void OnBetStolen(object obj) { MatchStatus matchStatus = (MatchStatus)obj; try { while (true) { // get odds account var service = new Sbobet(); var resp = service.GetOdds(this.Acc, matchStatus); if (resp != null && resp.Data != null && resp.Data.Count > 0) { var matches = resp.Data; Log("bet stolen found: {0} matches", matches.Count); } // delay for next run await Task.Delay(100); } } catch (Exception ex) { Log("Bet stolen error: {0}", ex.Message); } }
public async void ViewMatchInfo(Account acc) { try { Program.SaveMatchSettings(); if (acc != null) { var result = new Sbobet().GetOdds(acc, Program.MatchFilter.MatchStyle); if (!result.HasError && result.Data != null) { Program._matchs = result.Data.Where(x => x.OddType == (int)Program.MatchFilter.OddStyle).ToList();//Keo tai xiu (tran, h1) Program._dtMatch.Clear(); acc.MatchOdds = Program._matchs; foreach (var item in Program._matchs) { addTable(item); } } } } catch (Exception ex) { lblMess.Invoke(new Action(() => lblMess.Text = "Get Acc Infomation Failed: " + ex.Message)); } }
public void TestLogin() { Init(); var result = new Sbobet().Login(acc); Assert.AreEqual(true, result.Data, "Login success!"); }
public void TestGetTodayOdds() { Init(); var result = new Sbobet().Login(acc); if (result.Data) { var oddResult = new Sbobet().GetTodayOdds(acc); Assert.AreEqual(false, oddResult.HasError, "Get today odds success!"); } }
public void TestBetToDay() { Init(); var result = new Sbobet().Login(acc); if (result.Data) { var oddResult = new Sbobet().GetTodayOdds(acc); if (!oddResult.HasError && oddResult.Data.Count > 0) { var odd = oddResult.Data[0]; SbobetTicket ticket = new SbobetTicket(); //Home:id=30292694&op=h&odds=-0.91&hdpType=1&isor=0&isLive=0&betpage=18&style=1 //Away:id=30292694&op=a&odds=0.85&hdpType=1&isor=0&isLive=0&betpage=18&style=1 //Over:id=30170989&op=h&odds=0.90&hdpType=1&isor=0&isLive=0&betpage=18&style=1 //Under:id=30170989&op=a&odds=-1.00&hdpType=1&isor=0&isLive=0&betpage=18&style=1 //Request ticket.MatchOddId = odd.OddId; ticket.Op = "h"; ticket.HdpType = 1; ticket.Odds = odd.h; ticket.IsLive = 0; ticket.IsOr = 0; ticket.BetPage = 18;//check ticket.Style = 1; //sameticket=0&betcount=0&stake=10&ostyle=1&stakeInAuto=10&betpage=18&acceptIfAny=1&autoProcess=0&autoRefresh=0&oid=30292694&timeDiff=6735 //Confirm ticket.SameTicket = 0; ticket.Betcount = 0; ticket.Stake = 10; ticket.StakeInAuto = 10; ticket.AcceptIfAny = 1; ticket.AutoProcess = 0; ticket.AutoRefresh = 0; //check ticket.TimeDiff = 6735; var betresult = new Sbobet().Bet(acc, ticket); Assert.AreEqual(true, betresult.Data, "Bet running success!"); } } }
private async void GetOdds() { try { var acc = Program.Accounts.SingleOrDefault(x => x.Key == Acc.Key); while (true) { // not click run button yet if (Program._isStartRunning != 0) { await Task.Delay(2000); continue; } // login success and have cookies in account if (acc != null && acc.Cookie.Count > 3 && !String.IsNullOrEmpty(acc.LoginName)) { if (acc.CurrentMatch.MatchId != Program._currentMatch.MatchId || acc.CurrentMatch.OddType != Program._currentMatch.OddType || acc.CurrentMatch.Goal != Program._currentMatch.Goal) { // get odd from service var result = new Sbobet().GetOdds(acc, Program.MatchFilter.MatchStyle); if (!result.HasError && result.Data != null) { acc.MatchOdds = result.Data.Where(x => x.OddType == (int)Program.MatchFilter.OddStyle).ToList(); var odd = acc.MatchOdds.SingleOrDefault(x => x.Match.MatchId == Program._betMatch.MatchId && x.OddType == Program._betMatch.OddType && x.Goal == Program._betMatch.Goal); acc.CurrentMatch = odd; lblBetCredit.Invoke(new Action(() => lblBetCredit.Text = odd.OddId.ToString())); _flag = true; // matched condition, start bet } } } // await Task.Delay(2000); } } catch (Exception ex) { Log("get odds error: {0}", ex.Message); } }