Football scores to Guardian programatically - Script & Sample BAF
Thanks Sniffer, for anyone else having issues, I had to download this version of binarycall.au3 as well, added to the includes folder and now working:sniffer66 wrote: ↑Sat Jan 30, 2021 4:02 pmSorry all. That UDF (user defined function) should ship with Auto-It and be included as part of the default install. Not sure why it's not in yours
The UDF can be downloaded as a zip file at the very bottom of the first post on this page.
https://www.autoitscript.com/forum/topi ... -udf-jsmn/
Its called: Json(2019.01.17).zip
Copy that to your \includes folder where you installed Auto-It, and unzip, and all should work
https://github.com/J2TEAM/AutoIt-Imgur-UDF
Cheers
Good stuff.
I've been using Auto-It for years and have downloaded many UDFs in that time. Sometimes it's easy to forget which are part of the default install and which need adding.
On another note, it's a relatively simple task to add in any of the in play statistics from each match. Shots on/off Target, Possession, Attacks etc.
Combined with saving SVs to History Lists it would be a cool way to add in stats based decisions to Guardian
If there is any interest in those I can improve the script. Let me know
Or if you have the ability it's not hard to update yourself. Just takes a little reading to get your head around the JSON format.
I've been using Auto-It for years and have downloaded many UDFs in that time. Sometimes it's easy to forget which are part of the default install and which need adding.
On another note, it's a relatively simple task to add in any of the in play statistics from each match. Shots on/off Target, Possession, Attacks etc.
Combined with saving SVs to History Lists it would be a cool way to add in stats based decisions to Guardian
If there is any interest in those I can improve the script. Let me know
Or if you have the ability it's not hard to update yourself. Just takes a little reading to get your head around the JSON format.
Yeah in play stats would be awesome, I'm trying to find info the SofaScore API but cant find anything published about it.sniffer66 wrote: ↑Sun Jan 31, 2021 8:55 amGood stuff.
I've been using Auto-It for years and have downloaded many UDFs in that time. Sometimes it's easy to forget which are part of the default install and which need adding.
On another note, it's a relatively simple task to add in any of the in play statistics from each match. Shots on/off Target, Possession, Attacks etc.
Combined with saving SVs to History Lists it would be a cool way to add in stats based decisions to Guardian
If there is any interest in those I can improve the script. Let me know
Or if you have the ability it's not hard to update yourself. Just takes a little reading to get your head around the JSON format.
mtrend wrote: ↑Sun Jan 31, 2021 9:27 amYeah in play stats would be awesome, I'm trying to find info the SofaScore API but cant find anything published about it.sniffer66 wrote: ↑Sun Jan 31, 2021 8:55 amGood stuff.
I've been using Auto-It for years and have downloaded many UDFs in that time. Sometimes it's easy to forget which are part of the default install and which need adding.
On another note, it's a relatively simple task to add in any of the in play statistics from each match. Shots on/off Target, Possession, Attacks etc.
Combined with saving SVs to History Lists it would be a cool way to add in stats based decisions to Guardian
If there is any interest in those I can improve the script. Let me know
Or if you have the ability it's not hard to update yourself. Just takes a little reading to get your head around the JSON format.
Very little published info on most sites APIs.
A good place to start is that AutoIt link I posted previously for that UDF. Json_dump() is a very handy function that will dump the contents of the json get to the console, but in readable format. Once you get your head around it, it's then relatively simple to query and return the right stats per team
Should have some free time tomorrow and will update the script with the stats.
-
- Posts: 4
- Joined: Fri Jun 19, 2020 9:40 am
Trying to download scores but no score.csv is to find on my computer. This feature is great so help is much appreciated. I have let the script run for several minutes before i terminated the process. I go to tools->Go and the console looks like this >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Program Files (x86)\AutoIt3\Examples\Football.au3" The score.csv should be saved down to the same folder as Football.au3 if i understand it correct?
-
- Posts: 6
- Joined: Wed Nov 09, 2016 8:46 am
Hi Sniffer66,sniffer66 wrote: ↑Sun Jan 31, 2021 9:34 ammtrend wrote: ↑Sun Jan 31, 2021 9:27 amYeah in play stats would be awesome, I'm trying to find info the SofaScore API but cant find anything published about it.sniffer66 wrote: ↑Sun Jan 31, 2021 8:55 amGood stuff.
I've been using Auto-It for years and have downloaded many UDFs in that time. Sometimes it's easy to forget which are part of the default install and which need adding.
On another note, it's a relatively simple task to add in any of the in play statistics from each match. Shots on/off Target, Possession, Attacks etc.
Combined with saving SVs to History Lists it would be a cool way to add in stats based decisions to Guardian
If there is any interest in those I can improve the script. Let me know
Or if you have the ability it's not hard to update yourself. Just takes a little reading to get your head around the JSON format.
Very little published info on most sites APIs.
A good place to start is that AutoIt link I posted previously for that UDF. Json_dump() is a very handy function that will dump the contents of the json get to the console, but in readable format. Once you get your head around it, it's then relatively simple to query and return the right stats per team
Should have some free time tomorrow and will update the script with the stats.
Have you been able to update the script with in-play stats? This would be extremely useful in improving my automation results. Thank you.
To be honest, I've not used this since I created it as I don't trade football on auto in BA - just thought it would be usefulpetermikael wrote: ↑Sun Mar 07, 2021 11:21 amTrying to download scores but no score.csv is to find on my computer. This feature is great so help is much appreciated. I have let the script run for several minutes before i terminated the process. I go to tools->Go and the console looks like this >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Program Files (x86)\AutoIt3\Examples\Football.au3" The score.csv should be saved down to the same folder as Football.au3 if i understand it correct?
I've just tested it though and ran fine for me - CSV file saves to same folder location as the script
Returned
1
* * *Central Coast Mariners* * S Score 1
* * *Macarthur FC* * S Score 0
* * *Abeldos United* * S Score 0
* * *Ab ovo* * S Score 0
* * *Bangalore Dream United FC* * S Score 0
* * *Income Tax SC* * S Score 0
Did you download the addititonal UDF's mentioned previously in the thread, and are you seeing any errors in the Scite Console ?
-
- Posts: 6
- Joined: Wed Nov 09, 2016 8:46 am
The work you have done so far with the scores is working brilliantly for me. My comment was in relation to the in-play stats from Sofascore as you had previously mentioned that it would be easy (well for you anyway!) to add these in to the csv. Thanks again.
Wonkymuffin wrote: ↑Mon Mar 08, 2021 9:53 amThe work you have done so far with the scores is working brilliantly for me. My comment was in relation to the in-play stats from Sofascore as you had previously mentioned that it would be easy (well for you anyway!) to add these in to the csv. Thanks again.
I'm afraid I've had to time lately. In the middle of moving house so all over the place
It's worth doing some reading on the Auto-It forum - some good examples in those threads I linked. Definitely preferable to pick up the skills yourself then you can pull data down for any sport you like
Try using the existing script and the Json_Dump() function I've mentioned previously and that will give you an idea of how the json notation works, then it's just a case of adding additional lines to pull the values you are after.
As a hint, the stats are on an additional URL, which you can create from the JSON containing the current scores. Put a link/Json_Get to that in the existing score loop and you can then grab all the stats you like
Starter for 10:
$URL = "https://api.sofascore.com/api/v1/event/" & Json_Get($object, '.events' & '[' & $i & '].id') & "/statistics"
No problem Peter. I was doing this via Excel previously but the new CSV import function simplifies it hugely (and saves a lot in CPU overhead)
Lovely when you can get up to date data like this into Guardian
08/03/2021 13:08:41: [G_Auto 1] : Store Value for Alex Molcan: 1stServeIn% = 61
08/03/2021 13:08:41: [G_Auto 1] : Store Value for Alex Molcan: 1stServePoints% = 91
08/03/2021 13:08:41: [G_Auto 1] : Store Value for Alex Molcan: 2ndServePoints% = 86
08/03/2021 13:08:41: [G_Auto 1] : Store Value for Alex Molcan: OppPointsCount = 2
08/03/2021 13:08:41: [G_Auto 1] : Store Value for Alex Molcan: BPAgainstCount = 0
08/03/2021 13:08:41: [G_Auto 1] : Store Value for Alex Molcan: ServeBrokenNo = 0
08/03/2021 13:10:25: [G_Auto 1] : Store Value for Ernests Gulbis: 1stServeIn% = 55
08/03/2021 13:10:25: [G_Auto 1] : Store Value for Ernests Gulbis: 1stServePoints% = 75
08/03/2021 13:10:25: [G_Auto 1] : Store Value for Ernests Gulbis: 2ndServePoints% = 23
08/03/2021 13:10:25: [G_Auto 1] : Store Value for Ernests Gulbis: OppPointsCount = 14
08/03/2021 13:10:25: [G_Auto 1] : Store Value for Ernests Gulbis: BPAgainstCount = 8
08/03/2021 13:10:25: [G_Auto 1] : Store Value for Ernests Gulbis: ServeBrokenNo = 2
08/03/2021 13:10:25: [G_Auto 1] : Store Value for market: GameCount = 8 + 1 = 9
08/03/2021 13:13:56: [G_Auto 1] : Store Value for Alex Molcan: 1stServeIn% = 70
08/03/2021 13:13:56: [G_Auto 1] : Store Value for Alex Molcan: 1stServePoints% = 88
08/03/2021 13:13:56: [G_Auto 1] : Store Value for Alex Molcan: 2ndServePoints% = 86
08/03/2021 13:13:56: [G_Auto 1] : Store Value for Alex Molcan: OppPointsCount = 3
08/03/2021 13:13:56: [G_Auto 1] : Store Value for Alex Molcan: BPAgainstCount = 0
08/03/2021 13:13:56: [G_Auto 1] : Store Value for Alex Molcan: ServeBrokenNo = 0
08/03/2021 13:13:56: [G_Auto 1] : Store Value for market: GameCount = 9 + 1 = 10
will be even lovlier when the SV-CSV functionality is updated to allow MarketId and SelectionId to be passed in, rather than coercing and mapping variations of name etc..!!sniffer66 wrote: ↑Mon Mar 08, 2021 1:17 pmNo problem Peter. I was doing this via Excel previously but the new CSV import function simplifies it hugely (and saves a lot in CPU overhead)
Lovely when you can get up to date data like this into Guardian
08/03/2021 13:08:41: [G_Auto 1] : Store Value for Alex Molcan: 1stServeIn% = 61
08/03/2021 13:08:41: [G_Auto 1] : Store Value for Alex Molcan: 1stServePoints% = 91
08/03/2021 13:08:41: [G_Auto 1] : Store Value for Alex Molcan: 2ndServePoints% = 86
08/03/2021 13:08:41: [G_Auto 1] : Store Value for Alex Molcan: OppPointsCount = 2
08/03/2021 13:08:41: [G_Auto 1] : Store Value for Alex Molcan: BPAgainstCount = 0
08/03/2021 13:08:41: [G_Auto 1] : Store Value for Alex Molcan: ServeBrokenNo = 0
08/03/2021 13:10:25: [G_Auto 1] : Store Value for Ernests Gulbis: 1stServeIn% = 55
08/03/2021 13:10:25: [G_Auto 1] : Store Value for Ernests Gulbis: 1stServePoints% = 75
08/03/2021 13:10:25: [G_Auto 1] : Store Value for Ernests Gulbis: 2ndServePoints% = 23
08/03/2021 13:10:25: [G_Auto 1] : Store Value for Ernests Gulbis: OppPointsCount = 14
08/03/2021 13:10:25: [G_Auto 1] : Store Value for Ernests Gulbis: BPAgainstCount = 8
08/03/2021 13:10:25: [G_Auto 1] : Store Value for Ernests Gulbis: ServeBrokenNo = 2
08/03/2021 13:10:25: [G_Auto 1] : Store Value for market: GameCount = 8 + 1 = 9
08/03/2021 13:13:56: [G_Auto 1] : Store Value for Alex Molcan: 1stServeIn% = 70
08/03/2021 13:13:56: [G_Auto 1] : Store Value for Alex Molcan: 1stServePoints% = 88
08/03/2021 13:13:56: [G_Auto 1] : Store Value for Alex Molcan: 2ndServePoints% = 86
08/03/2021 13:13:56: [G_Auto 1] : Store Value for Alex Molcan: OppPointsCount = 3
08/03/2021 13:13:56: [G_Auto 1] : Store Value for Alex Molcan: BPAgainstCount = 0
08/03/2021 13:13:56: [G_Auto 1] : Store Value for Alex Molcan: ServeBrokenNo = 0
08/03/2021 13:13:56: [G_Auto 1] : Store Value for market: GameCount = 9 + 1 = 10
viewtopic.php?f=20&t=23204
-
- Posts: 4
- Joined: Fri Jun 19, 2020 9:40 am
Did a restart on my computer and then it worked Thanks for the replysniffer66 wrote: ↑Mon Mar 08, 2021 8:39 amTo be honest, I've not used this since I created it as I don't trade football on auto in BA - just thought it would be usefulpetermikael wrote: ↑Sun Mar 07, 2021 11:21 amTrying to download scores but no score.csv is to find on my computer. This feature is great so help is much appreciated. I have let the script run for several minutes before i terminated the process. I go to tools->Go and the console looks like this >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Program Files (x86)\AutoIt3\Examples\Football.au3" The score.csv should be saved down to the same folder as Football.au3 if i understand it correct?
I've just tested it though and ran fine for me - CSV file saves to same folder location as the script
Returned
1
* * *Central Coast Mariners* * S Score 1
* * *Macarthur FC* * S Score 0
* * *Abeldos United* * S Score 0
* * *Ab ovo* * S Score 0
* * *Bangalore Dream United FC* * S Score 0
* * *Income Tax SC* * S Score 0
Did you download the addititonal UDF's mentioned previously in the thread, and are you seeing any errors in the Scite Console ?