another quick query on the getNextRace code, if I may:-
- Code: Select all
Sub getNextRace()
Dim sports, sport, Events, evnt, diff, result
If ba Is Nothing Then
Set ba = New BettingAssistantCom.ComClass
End If
sports = ba.getSports()
For Each sport In sports
If sport.sport = "Horse Racing - Todays Card" Then
Events = ba.getEvents(sport.sportId)
For Each evnt In Events
diff = DateDiff("s", Now(), evnt.startTime)
If diff >= 0 And InStr(evnt.eventName, "(") = 0 Then
result = ba.openMarket(evnt.eventId, evnt.exchangeId)
Exit For
End If
Next
End If
Next
End Sub
The above code will grab the next race when the current time is greater than the scheduled-off time of the prior race.
As such, the code above is directly linked to the current time.
However, I would like to be able to grab the next race in the left nav bar of GRUSS, irrespective of whether the current time is greater or less than the scheduled off-time of the prior race i.e.
In summary, my algorithm would:-
- performs specified orders on prior race;
- when this is complete [irrespective of time], a flag is triggered;
- this flag is then used to call the next race in the event ladder.
- the coding should be based on grabbing the next event ID in the event
ladder, irrespective of off-time, bringing my robot into the next race.
Whereas: the current approach [as above] relies on waiting until the scheduled off-time of the prior race.
Is this something that is possible?
Thanks,
G.