Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.06 KB | None | 0 0
  1. Public Sub update_odds_one_market_unitab(ByVal market_time As String)
  2. Dim skip_race As Boolean = True
  3. Dim ok_to_proceed As Boolean = False
  4. Dim book_status As String
  5. Dim odds_to_suspend As Double
  6. Try
  7. Dim reader_races As New XmlTextReader("http://tatts.com/pagedata/racing/" + market_time + ".xml")
  8. While reader_races.Read()
  9. Dim test2 As String = "http://tatts.com/pagedata/racing/" + market_time + ".xml"
  10. If reader_races.Name = "FixedOdds" Then
  11. skip_race = False
  12. End If
  13.  
  14. End While
  15.  
  16. '''added 6th july 2014
  17. If skip_race = True Then
  18. skip_race = False
  19. End If
  20.  
  21. Catch ex As System.Exception
  22. Print1("Internet issues , NOT marking skip race")
  23. skip_race = False
  24. ok_to_proceed = False
  25. End Try
  26.  
  27. Try 'lol
  28. Dim reader_races3 As New XmlTextReader("http://tatts.com/pagedata/racing/" + market_time + ".xml")
  29. While reader_races3.Read()
  30. book_status = ("http://tatts.com/pagedata/racing/" + market_time + ".xml")
  31. If reader_races3.Name = "FixedPrice" Then
  32. reader_races3.MoveToAttribute("Status")
  33. book_status = reader_races3.Value
  34. End If
  35. End While
  36. Catch ex As System.Exception
  37. Print1("Internet issues , NOT marking skip race")
  38. skip_race = False
  39. ok_to_proceed = False
  40. End Try
  41.  
  42.  
  43. If book_status = "c" Then
  44. ok_to_proceed = False
  45. odds_to_suspend = 1.03
  46. 'Print1(m_id.ToString + " : " + sel_id.ToString + "OK to proceed")
  47. Else
  48. ok_to_proceed = True
  49. 'Print1(m_id.ToString + " : " + sel_id.ToString + "NOT OK to proceed")
  50. End If
  51.  
  52.  
  53. ' End Try 'lol
  54.  
  55.  
  56. If skip_race = False Then
  57.  
  58. Dim str1, str2, str0, str, odds1, odds2, odds3, odds4, odds5, odds6, odds7, odds8, odds9, odds10, odds11, odds12 As String
  59. Dim sqlconnect As New SqlClient.SqlConnection
  60. sqlconnect.ConnectionString = betbot.connection_string_bot
  61. sqlconnect.Open()
  62.  
  63.  
  64. Try
  65. 'Dim str1, str2, str0, str, odds1, odds2, odds3, odds4, odds5, odds6, odds7, odds8, odds9, odds10, odds11, odds12 As String
  66. 'Dim sqlconnect As New SqlClient.SqlConnection
  67. 'sqlconnect.ConnectionString = betbot.connection_string_bot
  68. 'sqlconnect.Open()
  69.  
  70. Try
  71. Print1("Starting tatts site reader one")
  72. Dim reader_races As New XmlTextReader("http://tatts.com/pagedata/racing/" + market_time + ".xml")
  73. While reader_races.Read()
  74.  
  75. If reader_races.Name = "Meeting" And reader_races.AttributeCount <> 0 Then
  76. str0 = reader_races.GetAttribute("MeetingCode")
  77.  
  78. If reader_races.GetAttribute("MtgAbandoned") = "Y" Then
  79. exit_market1 = True
  80. hold1 = 0
  81. End If
  82.  
  83. End If
  84.  
  85. If reader_races.Name = "Race" And reader_races.AttributeCount <> 0 Then
  86.  
  87.  
  88. If reader_races.GetAttribute("RaceDisplayStatus") <> "SELLING" Then
  89. exit_market1 = True
  90. hold1 = 0
  91. 'Else
  92. 'exit_market1 = False
  93. End If
  94.  
  95.  
  96. str1 = reader_races.GetAttribute("RaceNo")
  97. str2 = reader_races.GetAttribute("RaceTime").Replace("T", " ")
  98.  
  99. start_time1 = str2.Substring(0, 19)
  100. End If
  101.  
  102.  
  103.  
  104. If reader_races.Name = "Runner" And reader_races.AttributeCount <> 0 Then
  105. odds10 = "0"
  106.  
  107. odds8 = reader_races.GetAttribute("RunnerNo")
  108. odds2 = Format(Date.Now, "yyyy-MM-dd HH:mm:ss")
  109. odds7 = reader_races.GetAttribute("RunnerName").ToString.Replace("'", "").ToString.Replace(".", "")
  110. 'reader_races.Read()
  111. 'If reader_races.Name = "WinOdds" Then
  112. ' odds4 = reader_races.GetAttribute("Odds")
  113. ' If odds4 < 2 Then
  114. ' odds4 = 1.01 'lll
  115. ' End If
  116. ' End If
  117. ' If odds_to_suspend = 1.03 Then
  118. ' odds4 = 1.03
  119. ' End If
  120. 'End If
  121. 'reader_races.Read()
  122. reader_races.Read()
  123. If reader_races.Name = "WinOdds" Then
  124. odds4 = reader_races.GetAttribute("Odds")
  125.  
  126. End If
  127.  
  128. reader_races.Read()
  129. If reader_races.Name = "PlaceOdds" Then
  130. odds3 = reader_races.GetAttribute("Odds")
  131. End If
  132. reader_races.Read()
  133.  
  134. If reader_races.Name = "FixedOdds" Then
  135. odds6 = reader_races.GetAttribute("WinOdds")
  136. odds5 = reader_races.GetAttribute("PlaceOdds")
  137. odds9 = reader_races.GetAttribute("OfferId")
  138. odds11 = reader_races.GetAttribute("LateScratching")
  139. End If
  140.  
  141. ' If Strings.Mid(race_code1, 2, 1) = "T" Then
  142. If odds6 <= myShortOddsPrice Then
  143. odds6 = odds6 * myShortOddsMultiplier 'lll
  144. End If
  145. ' End If
  146.  
  147. If ok_to_proceed = False Then
  148. odds6 = 1.01
  149. End If
  150.  
  151. 'If odds_to_suspend = 1.01 Then
  152. ' odds6 = 1.01
  153. 'End If
  154.  
  155. Dim sqlcommand2 As New SqlClient.SqlCommand
  156. sqlcommand2 = sqlconnect.CreateCommand
  157. sqlcommand2.CommandText = "UPDATE odds_unitab SET dateTime='" + odds2 + "',totePlace='" + odds3 + "',toteWin='" + odds4 + "',fixedPlace='" + odds5 + "',fixedWin='" + odds6 + "',lscr='" + odds11 + odds12 + "',status='" + "' WHERE horseName= '" + odds7 + "'"
  158. str = sqlcommand2.CommandText
  159. sqlcommand2.ExecuteNonQuery()
  160. sqlcommand2.Dispose()
  161. ''Print1_unitab(str)
  162.  
  163.  
  164. 'If dont_write_backup = False Then
  165. ' Dim sqlcommand3 As New SqlClient.SqlCommand
  166. ' sqlcommand3 = sqlconnect.CreateCommand
  167. ' 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 + "')"
  168. ' sqlcommand3.ExecuteNonQuery()
  169. ' sqlcommand3.Dispose()
  170. 'End If
  171. End If
  172.  
  173.  
  174. End While
  175.  
  176. 'sqlconnect.Close()
  177.  
  178. Catch ex As SqlClient.SqlException
  179. ' MsgBox(ex.ToString)
  180. odds6 = 1.07
  181. Dim sqlcommand2 As New SqlClient.SqlCommand
  182. sqlcommand2 = sqlconnect.CreateCommand
  183. sqlcommand2.CommandText = "UPDATE odds_unitab SET dateTime='" + odds2 + "',totePlace='" + odds3 + "',toteWin='" + odds4 + "',fixedPlace='" + odds5 + "',fixedWin='" + odds6 + "',lscr='" + odds11 + odds12 + "',status='" + "' WHERE horseName= '" + odds7 + "'"
  184. str = sqlcommand2.CommandText
  185. sqlcommand2.ExecuteNonQuery()
  186. sqlcommand2.Dispose()
  187.  
  188. Finally
  189. sqlconnect.Close()
  190. sqlconnect.Dispose()
  191. sqlconnect = Nothing
  192. End Try
  193.  
  194. Catch ex1 As System.Exception
  195. '' MsgBox(ex1.ToString)
  196. 'Print1("exception in update one market unitab")
  197. 'odds6 = 1.08
  198. 'Dim sqlcommand2 As New SqlClient.SqlCommand
  199. 'sqlcommand2 = sqlconnect.CreateCommand
  200. 'sqlcommand2.CommandText = "UPDATE odds_unitab SET dateTime='" + odds2 + "',totePlace='" + odds3 + "',toteWin='" + odds4 + "',fixedPlace='" + odds5 + "',fixedWin='" + odds6 + "',lscr='" + odds11 + odds12 + "',status='" + "' WHERE horseName= '" + odds7 + "'"
  201. 'str = sqlcommand2.CommandText
  202. 'sqlcommand2.ExecuteNonQuery()
  203. 'sqlcommand2.Dispose()
  204. 'ok_to_proceed = False
  205. hardLimit = 4
  206. gross_limit = hardLimit
  207. cancel_all_bets_ng_all()
  208. Threading.Thread.Sleep(1500)
  209. cancel_all_bets_ng_all()
  210. Threading.Thread.Sleep(1500)
  211. cancel_all_bets_ng_all()
  212. End Try
  213. Else
  214. Print1("Market doenst support fixed odds , hence skipping")
  215. exit_market1 = True
  216. hold1 = 0
  217. End If
  218. Print1("primary update_one_market_unitab xml " + Date.Now)
  219. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement