Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Sub update_odds_one_market_unitab(ByVal market_time As String)
- Dim skip_race As Boolean = True
- Dim ok_to_proceed As Boolean = False
- Dim book_status As String
- Dim odds_to_suspend As Double
- Try
- Dim reader_races As New XmlTextReader("http://tatts.com/pagedata/racing/" + market_time + ".xml")
- While reader_races.Read()
- Dim test2 As String = "http://tatts.com/pagedata/racing/" + market_time + ".xml"
- If reader_races.Name = "FixedOdds" Then
- skip_race = False
- End If
- End While
- '''added 6th july 2014
- If skip_race = True Then
- skip_race = False
- End If
- Catch ex As System.Exception
- Print1("Internet issues , NOT marking skip race")
- skip_race = False
- ok_to_proceed = False
- End Try
- Try 'lol
- Dim reader_races3 As New XmlTextReader("http://tatts.com/pagedata/racing/" + market_time + ".xml")
- While reader_races3.Read()
- book_status = ("http://tatts.com/pagedata/racing/" + market_time + ".xml")
- If reader_races3.Name = "FixedPrice" Then
- reader_races3.MoveToAttribute("Status")
- book_status = reader_races3.Value
- End If
- End While
- Catch ex As System.Exception
- Print1("Internet issues , NOT marking skip race")
- skip_race = False
- ok_to_proceed = False
- End Try
- If book_status = "c" Then
- ok_to_proceed = False
- odds_to_suspend = 1.03
- 'Print1(m_id.ToString + " : " + sel_id.ToString + "OK to proceed")
- Else
- ok_to_proceed = True
- 'Print1(m_id.ToString + " : " + sel_id.ToString + "NOT OK to proceed")
- End If
- ' End Try 'lol
- If skip_race = False Then
- Dim str1, str2, str0, str, odds1, odds2, odds3, odds4, odds5, odds6, odds7, odds8, odds9, odds10, odds11, odds12 As String
- Dim sqlconnect As New SqlClient.SqlConnection
- sqlconnect.ConnectionString = betbot.connection_string_bot
- sqlconnect.Open()
- Try
- 'Dim str1, str2, str0, str, odds1, odds2, odds3, odds4, odds5, odds6, odds7, odds8, odds9, odds10, odds11, odds12 As String
- 'Dim sqlconnect As New SqlClient.SqlConnection
- 'sqlconnect.ConnectionString = betbot.connection_string_bot
- 'sqlconnect.Open()
- Try
- Print1("Starting tatts site reader one")
- Dim reader_races As New XmlTextReader("http://tatts.com/pagedata/racing/" + market_time + ".xml")
- While reader_races.Read()
- If reader_races.Name = "Meeting" And reader_races.AttributeCount <> 0 Then
- str0 = reader_races.GetAttribute("MeetingCode")
- If reader_races.GetAttribute("MtgAbandoned") = "Y" Then
- exit_market1 = True
- hold1 = 0
- End If
- End If
- If reader_races.Name = "Race" And reader_races.AttributeCount <> 0 Then
- If reader_races.GetAttribute("RaceDisplayStatus") <> "SELLING" Then
- exit_market1 = True
- hold1 = 0
- 'Else
- 'exit_market1 = False
- End If
- str1 = reader_races.GetAttribute("RaceNo")
- str2 = reader_races.GetAttribute("RaceTime").Replace("T", " ")
- start_time1 = str2.Substring(0, 19)
- End If
- If reader_races.Name = "Runner" And reader_races.AttributeCount <> 0 Then
- odds10 = "0"
- odds8 = reader_races.GetAttribute("RunnerNo")
- odds2 = Format(Date.Now, "yyyy-MM-dd HH:mm:ss")
- odds7 = reader_races.GetAttribute("RunnerName").ToString.Replace("'", "").ToString.Replace(".", "")
- 'reader_races.Read()
- 'If reader_races.Name = "WinOdds" Then
- ' odds4 = reader_races.GetAttribute("Odds")
- ' If odds4 < 2 Then
- ' odds4 = 1.01 'lll
- ' End If
- ' End If
- ' If odds_to_suspend = 1.03 Then
- ' odds4 = 1.03
- ' End If
- 'End If
- 'reader_races.Read()
- reader_races.Read()
- If reader_races.Name = "WinOdds" Then
- odds4 = reader_races.GetAttribute("Odds")
- End If
- reader_races.Read()
- If reader_races.Name = "PlaceOdds" Then
- odds3 = reader_races.GetAttribute("Odds")
- End If
- reader_races.Read()
- If reader_races.Name = "FixedOdds" Then
- odds6 = reader_races.GetAttribute("WinOdds")
- odds5 = reader_races.GetAttribute("PlaceOdds")
- odds9 = reader_races.GetAttribute("OfferId")
- odds11 = reader_races.GetAttribute("LateScratching")
- End If
- ' If Strings.Mid(race_code1, 2, 1) = "T" Then
- If odds6 <= myShortOddsPrice Then
- odds6 = odds6 * myShortOddsMultiplier 'lll
- End If
- ' End If
- If ok_to_proceed = False Then
- odds6 = 1.01
- End If
- 'If odds_to_suspend = 1.01 Then
- ' odds6 = 1.01
- 'End If
- Dim sqlcommand2 As New SqlClient.SqlCommand
- sqlcommand2 = sqlconnect.CreateCommand
- sqlcommand2.CommandText = "UPDATE odds_unitab SET dateTime='" + odds2 + "',totePlace='" + odds3 + "',toteWin='" + odds4 + "',fixedPlace='" + odds5 + "',fixedWin='" + odds6 + "',lscr='" + odds11 + odds12 + "',status='" + "' WHERE horseName= '" + odds7 + "'"
- str = sqlcommand2.CommandText
- sqlcommand2.ExecuteNonQuery()
- sqlcommand2.Dispose()
- ''Print1_unitab(str)
- 'If dont_write_backup = False Then
- ' Dim sqlcommand3 As New SqlClient.SqlCommand
- ' sqlcommand3 = sqlconnect.CreateCommand
- ' sqlcommand3.CommandText = "INSERT INTO odds_backup_unitab(oddsId,dateTime,totePlace,toteWin,fixedPlace,fixedWin,horseName,horseNumber,race_id,offer_Id,liability) VALUES('" + odds1 + "','" + odds2 + "','" + odds3 + "','" + odds4 + "','" + odds5 + "','" + odds6 + "','" + odds7 + "','" + odds8 + "','" + str0 + str1 + "','" + odds9 + "','" + odds10 + "')"
- ' sqlcommand3.ExecuteNonQuery()
- ' sqlcommand3.Dispose()
- 'End If
- End If
- End While
- 'sqlconnect.Close()
- Catch ex As SqlClient.SqlException
- ' MsgBox(ex.ToString)
- odds6 = 1.07
- Dim sqlcommand2 As New SqlClient.SqlCommand
- sqlcommand2 = sqlconnect.CreateCommand
- sqlcommand2.CommandText = "UPDATE odds_unitab SET dateTime='" + odds2 + "',totePlace='" + odds3 + "',toteWin='" + odds4 + "',fixedPlace='" + odds5 + "',fixedWin='" + odds6 + "',lscr='" + odds11 + odds12 + "',status='" + "' WHERE horseName= '" + odds7 + "'"
- str = sqlcommand2.CommandText
- sqlcommand2.ExecuteNonQuery()
- sqlcommand2.Dispose()
- Finally
- sqlconnect.Close()
- sqlconnect.Dispose()
- sqlconnect = Nothing
- End Try
- Catch ex1 As System.Exception
- '' MsgBox(ex1.ToString)
- 'Print1("exception in update one market unitab")
- 'odds6 = 1.08
- 'Dim sqlcommand2 As New SqlClient.SqlCommand
- 'sqlcommand2 = sqlconnect.CreateCommand
- 'sqlcommand2.CommandText = "UPDATE odds_unitab SET dateTime='" + odds2 + "',totePlace='" + odds3 + "',toteWin='" + odds4 + "',fixedPlace='" + odds5 + "',fixedWin='" + odds6 + "',lscr='" + odds11 + odds12 + "',status='" + "' WHERE horseName= '" + odds7 + "'"
- 'str = sqlcommand2.CommandText
- 'sqlcommand2.ExecuteNonQuery()
- 'sqlcommand2.Dispose()
- 'ok_to_proceed = False
- hardLimit = 4
- gross_limit = hardLimit
- cancel_all_bets_ng_all()
- Threading.Thread.Sleep(1500)
- cancel_all_bets_ng_all()
- Threading.Thread.Sleep(1500)
- cancel_all_bets_ng_all()
- End Try
- Else
- Print1("Market doenst support fixed odds , hence skipping")
- exit_market1 = True
- hold1 = 0
- End If
- Print1("primary update_one_market_unitab xml " + Date.Now)
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement