Bet Refs always PENDING

Please post any questions regarding the program here.

Moderator: 2020vision

Bet Refs always PENDING

Postby dgs2001 » Thu Feb 14, 2008 8:48 pm

HI

Hopefully one of you kind people can help me with this!!
My bets are being placed but I'm not recording Bet Refs.

Code: Select all
Dim countRange
Set countRange = ThisWorkbook.Sheets("Sheet1").Range("T5:T75")
Dim mywait
        mywait = Now()
    t = Application.WorksheetFunction.Count(countRange)
   
    Do While t = 0
        If Now() >= mywait + TimeValue("00:00:10") Then
            GoTo SaveRecord
        End If
    t = Application.WorksheetFunction.Count(countRange)
    DoEvents
    Loop
    GoTo SaveRecord

SaveRecord:
ThisWorkbook.Application.ScreenUpdating = False
For i = 5 To 75
nxtRw = ThisWorkbook.Sheets("Bets").Range("A65000").End(xlUp).row + 1
    If ThisWorkbook.Sheets("Sheet1").Range("Q" & i) = "LAY" Then
       
                LayRef = ThisWorkbook.Sheets("Sheet1").Range("T" & i)
                ThisWorkbook.Sheets("bets").Range("A" & nxtRw) = LayRef
            ThisWorkbook.Sheets("bets").Range("I" & nxtRw) = ThisWorkbook.Sheets("sheet1").Range("AC77")
            ThisWorkbook.Sheets("bets").Range("B" & nxtRw) = ThisWorkbook.Sheets("Sheet1").Range("S" & i)
            ThisWorkbook.Sheets("bets").Range("D" & nxtRw) = ThisWorkbook.Sheets("Sheet1").Range("R" & i)
            ThisWorkbook.Sheets("bets").Range("G" & nxtRw) = ThisWorkbook.Sheets("Sheet1").Range("A" & i)
           
            ThisWorkbook.Sheets("bets").Range("H" & nxtRw) = ThisWorkbook.Sheets("Sheet1").Range("A1")
       
    End If
nxtRw = ThisWorkbook.Sheets("Bets").Range("A25000").End(xlUp).row + 1
    If ThisWorkbook.Sheets("Sheet1").Range("Q" & i) = "BACK" Then
                           
            BetRef = ThisWorkbook.Sheets("Sheet1").Range("T" & i)
                       
            ThisWorkbook.Sheets("bets").Range("A" & nxtRw) = BetRef
            ThisWorkbook.Sheets("bets").Range("C" & nxtRw) = ThisWorkbook.Sheets("Sheet1").Range("S" & i)
            ThisWorkbook.Sheets("bets").Range("D" & nxtRw) = ThisWorkbook.Sheets("Sheet1").Range("R" & i)
            ThisWorkbook.Sheets("bets").Range("G" & nxtRw) = ThisWorkbook.Sheets("Sheet1").Range("A" & i)
           
            ThisWorkbook.Sheets("bets").Range("H" & nxtRw) = ThisWorkbook.Sheets("Sheet1").Range("A1")
       
    End If
   
Next i



I'm trying to record my bet info, but using the above code all I get are PENDING bet refs on my "Bets" sheet.
The Back and Lay info is recorded and the bets are placed but thats it.

This is not a Betting Assistant error but something to do with my code, but I just can't fathom it!! :x

Thanks Duncan
User avatar
dgs2001
 
Posts: 334
Joined: Thu Apr 05, 2007 4:53 pm
Location: The Home Of National Hunt

Postby phrenetic » Thu Feb 14, 2008 11:08 pm

Duncan

When a bet is placed, it goes PENDING until a bet reference is returned. This can take several seconds (especially if dealing with InPlay betting).

I suspect that your routine is firing "too early", so it correctly records the PENDING values rather than the bet references.

Why don't you include another count for "PENDING" in the reference column and only call your save routine when that equals zero? So you would be checking for two counts - one for references and one for PENDINGs.....if you see what I mean.

Alistair
phrenetic
 
Posts: 142
Joined: Tue Oct 16, 2007 8:44 pm

Postby dgs2001 » Fri Feb 15, 2008 2:20 pm

Alistair thanks for the input,

I think I see what you mean.
This will be my Saterday morning project!!

I was confused because I have put a COUNT loop in my code,this should loop until there is a number in the Bet refs column but stay at zero if only text. Then I also put a 10 second get out clause so that my code wouldnt lock up and loop continuosly if no bet ref was returned.

Thanks Duncan
User avatar
dgs2001
 
Posts: 334
Joined: Thu Apr 05, 2007 4:53 pm
Location: The Home Of National Hunt


Return to Help

Who is online

Users browsing this forum: No registered users and 56 guests

Sports betting software from Gruss Software


The strength of Gruss Software is that it’s been designed by one of you, a frustrated sports punter, and then developed by listening to dozens of like-minded enthusiasts.

Gruss is owned and run by brothers Gary and Mark Russell. Gary discovered Betfair in 2004 and soon realised that using bespoke software to place bets was much more efficient than merely placing them through the website.

Gary built his own software and then enhanced its features after trialling it through other Betfair users and reacting to their improvement ideas, something that still happens today.

He started making a small monthly charge so he could work on it full-time and then recruited Mark to help develop the products and Gruss Software was born.

We think it’s the best of its kind and so do a lot of our customers. But you can never stand still in this game and we’ll continue to improve the software if any more great ideas emerge.