Could anyone offer basic help with triggered betting ?

Please post any questions regarding the program here.

Moderator: 2020vision

Could anyone offer basic help with triggered betting ?

Postby philipmyers » Fri Nov 21, 2008 6:46 pm

Hello I am wondering if anyone could help me with triggered betting.

I have the BA open and a new spreadsheet.

Ive written a tiny macro which fires a bet in if i run the macro from the tools/macro/ run macro - but it only does it the once

I am having a little difficulty in getting the macro to run each time the sheet updates/calculates

i may not have attached the macro to the sheet properly

I am using Xp and an Excel from office 2000
philipmyers
 
Posts: 11
Joined: Thu Jan 10, 2008 1:08 am

Postby Roger » Sat Nov 22, 2008 8:30 am

The secret is to put your code in a Worksheet_Change event, then every time the prices are refreshed, the code runs. The basice code is:

Code: Select all
 
Private Sub Worksheet_Change(ByVal Target As Range)


If Target.Columns.Count <> 16 Then Exit Sub


If you search for worksheet_change in the forum, you will find lots of example snippets of code you can use.
Roger
 
Posts: 140
Joined: Fri Nov 18, 2005 10:45 pm

Postby philipmyers » Sat Nov 22, 2008 9:32 pm

Thankyou Roger for taking the trouble to reply.

I have altered my tiny macro according to your suggestions and it now looks like this

Private Sub Worksheet_Change(ByVal Target As Range)
If Sheet1.Cells(6, 24) = 0 Then
Sheet1.Cells(5, 17) = "BACK"
Else
Sheet1.Cells(5, 17) = ""
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

End Sub

It certainly seems to enter the "BACK" instruction into the relevant trigger cell.
Unfortunately the Betting Assistant doesn't seem to carry out the instruction even though triggered betting is enabled.

Could you possibly offer any further help ?
philipmyers
 
Posts: 11
Joined: Thu Jan 10, 2008 1:08 am

Postby philipmyers » Sat Nov 22, 2008 9:43 pm

What an idiot, I overlooked that bit about <>16

My code is now

Private Sub Worksheet_Change(ByVal Target As Range)
If Sheet1.Cells(6, 24) = 0 Then
Sheet1.Cells(5, 17) = "BACK"
Else
Sheet1.Cells(5, 17) = ""
End If
If Target.Columns.Count <> 16 Then Exit Sub
End Sub




Private Sub Worksheet_SelectionChange(ByVal Target As Range)

End Sub

managed to get the bet fired in automatically once now
philipmyers
 
Posts: 11
Joined: Thu Jan 10, 2008 1:08 am

Postby philipmyers » Sun Nov 23, 2008 2:46 am

Think Im getting somewhere now

if after a bet is fired I delete the details of the bet in cells T5 U5 V5 and W5 the macro will continue to monitor and fire in another bet on its own
if required
anyone know how I can delete these cells automatically ?
philipmyers
 
Posts: 11
Joined: Thu Jan 10, 2008 1:08 am

Postby PeteB » Sun Nov 23, 2008 12:41 pm

Philip,

Have you read the help file? You can use the CLEAR command to clear the cells so that BA will accept another bet - it won't accept another bet until the BetRef column is cleared.

You also need to change the order of your code.

Worksheet_Change will get fired whenever anything on the sheet changes - i.e. changes by BA or by you manually, or by something in your macro.

BA makes several different refreshes - see this thread:
http://www.gruss-software.co.uk/forum/v ... php?t=2866

You only want your code to trigger after the main price refresh, not after every change, and so you can use the line
Code: Select all
If Target.Columns.Count <> 16 Then Exit Sub

to make sure you don't do any processing unless it's the main price refresh.

So your code should be:
Code: Select all
Private Sub Worksheet_Change(ByVal Target As Range)
' bomb out unless it's the main price refresh
If Target.Columns.Count <> 16 Then Exit Sub
' else do my processing
If Sheet1.Cells(6, 24) = 0 Then
Sheet1.Cells(5, 17) = "BACK"
Else
Sheet1.Cells(5, 17) = ""
End If
End Sub


A search on here for things like "BETWEEN_1_AND_60_BETS_REQUIRED" will find you a thread that has all the possible messages that could come in the BetRef cell before the BetRef is returned, whihc might also be useful.
A search for "Target.Columns.Count" will thwo up most of the example bit of code people have posted - there are a lot of ideas in these.
PeteB
 
Posts: 258
Joined: Tue May 23, 2006 12:13 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 49 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.