Email Notifications?

Discussion regarding the spreadsheet functionality of Bet Angel.
Post Reply
Citysharks
Posts: 14
Joined: Mon Feb 10, 2020 12:37 pm

Hi

I read in the past that Excel could be used to set up email notifications?

Basically I really need email notifications of when my bets are matched with Bet Angel but have very limited technical knowledge. I'm not using Excel sheets just running automation using Bet Angel.

Could someone point me in the direction of someone that can help? I'm willing to pay for if someone can create or share email notification with solution me.

Bet Angel is perfect for automation but when I'm not at the computer I need to know what's going on so any help would be great.
sniffer66
Posts: 1818
Joined: Thu May 02, 2019 8:37 am

Outside of Excel I can think of one way - but it would take a little scripting knowledge.

Set up Auto-It\Auto Hot Key (or another scripting language) to read the automation log file and look for the matched string on a regular basis i.e Every 1 minute.


Match on "Fully matched at" etc or create a rule that writes a Stored Value of x when matched count > 1 etc then use a SendMail script to mail the relevant mailbox
It would have to ensure it only read entries since last read but should work

You could also maybe set a BA alert window for Auto-It to detect via Window Handle, Click "Ok" to clear it, and then send the mail.
Citysharks
Posts: 14
Joined: Mon Feb 10, 2020 12:37 pm

Thanks so much for your reply.

Could you point me in the direction of someone who would be willing to do this for a fee as I have zero script knowledge.

Cheers.
User avatar
jimibt
Posts: 4197
Joined: Mon Nov 30, 2015 6:42 pm

sniffer66 wrote:
Wed Jul 15, 2020 11:48 am
Outside of Excel I can think of one way - but it would take a little scripting knowledge.

Set up Auto-It\Auto Hot Key (or another scripting language) to read the automation log file and look for the matched string on a regular basis i.e Every 1 minute.


Match on "Fully matched at" etc or create a rule that writes a Stored Value of x when matched count > 1 etc then use a SendMail script to mail the relevant mailbox
It would have to ensure it only read entries since last read but should work

You could also maybe set a BA alert window for Auto-It to detect via Window Handle, Click "Ok" to clear it, and then send the mail.
i had pondered the same idea of using the BA alert window in some way. in fact, it would be a decent idea for BA to implement an additional action along the lines of launching a chosen process (exe) with a set of commandline parameters. that way, you could invoke a task or exe with the required info and have it notify you as required (emailed or pinged up to a RESTApi (bespoke or 3rd party)) etc... etc
sniffer66
Posts: 1818
Joined: Thu May 02, 2019 8:37 am

jimibt wrote:
Wed Jul 15, 2020 11:59 am
sniffer66 wrote:
Wed Jul 15, 2020 11:48 am
Outside of Excel I can think of one way - but it would take a little scripting knowledge.

Set up Auto-It\Auto Hot Key (or another scripting language) to read the automation log file and look for the matched string on a regular basis i.e Every 1 minute.


Match on "Fully matched at" etc or create a rule that writes a Stored Value of x when matched count > 1 etc then use a SendMail script to mail the relevant mailbox
It would have to ensure it only read entries since last read but should work

You could also maybe set a BA alert window for Auto-It to detect via Window Handle, Click "Ok" to clear it, and then send the mail.
i had pondered the same idea of using the BA alert window in some way. in fact, it would be a decent idea for BA to implement an additional action along the lines of launching a chosen process (exe) with a set of commandline parameters. that way, you could invoke a task or exe with the required info and have it notify you as required (emailed or pinged up to a RESTApi (bespoke or 3rd party)) etc... etc
Should be relatively simple using Auto-IT - grab the Handle and possibly match a given string in the visible text, Then kick off x,y or z
I prefer the logfile method as it's cleaner but both ways would work

Thinking it through you could even kick off a screen scrape for the runner/player in the alert and pass that data back to be used. Options :)
User avatar
jimibt
Posts: 4197
Joined: Mon Nov 30, 2015 6:42 pm

sniffer66 wrote:
Wed Jul 15, 2020 12:04 pm
jimibt wrote:
Wed Jul 15, 2020 11:59 am
sniffer66 wrote:
Wed Jul 15, 2020 11:48 am
Outside of Excel I can think of one way - but it would take a little scripting knowledge.

Set up Auto-It\Auto Hot Key (or another scripting language) to read the automation log file and look for the matched string on a regular basis i.e Every 1 minute.


Match on "Fully matched at" etc or create a rule that writes a Stored Value of x when matched count > 1 etc then use a SendMail script to mail the relevant mailbox
It would have to ensure it only read entries since last read but should work

You could also maybe set a BA alert window for Auto-It to detect via Window Handle, Click "Ok" to clear it, and then send the mail.
i had pondered the same idea of using the BA alert window in some way. in fact, it would be a decent idea for BA to implement an additional action along the lines of launching a chosen process (exe) with a set of commandline parameters. that way, you could invoke a task or exe with the required info and have it notify you as required (emailed or pinged up to a RESTApi (bespoke or 3rd party)) etc... etc
Should be relatively simple using Auto-IT - grab the Handle and possibly match a given string in the visible text, Then kick off x,y or z
I prefer the logfile method as it's cleaner but both ways would work

Thinking it through you could even kick off a screen scrape for the runner/player in the alert and pass that data back to be used. Options :)
yeah -just looked at the specs for AutoIt, looks like it's pretty fully featured and one bit caught my eye:

Call Win32 and third-party DLL APIs

this would allow you to capture the window handle of the Alert dialog, read the text
[see https://www.autoitscript.com/autoit3/do ... au3spy.htm] to ensure you were acting on the correct alert and then run a routine against your chosen exe/dll etc, etc... all very good ;)
Last edited by jimibt on Wed Jul 15, 2020 12:13 pm, edited 2 times in total.
sniffer66
Posts: 1818
Joined: Thu May 02, 2019 8:37 am

jimibt wrote:
Wed Jul 15, 2020 12:06 pm
sniffer66 wrote:
Wed Jul 15, 2020 12:04 pm
jimibt wrote:
Wed Jul 15, 2020 11:59 am


i had pondered the same idea of using the BA alert window in some way. in fact, it would be a decent idea for BA to implement an additional action along the lines of launching a chosen process (exe) with a set of commandline parameters. that way, you could invoke a task or exe with the required info and have it notify you as required (emailed or pinged up to a RESTApi (bespoke or 3rd party)) etc... etc
Should be relatively simple using Auto-IT - grab the Handle and possibly match a given string in the visible text (https://www.autoitscript.com/autoit3/do ... au3spy.htm), Then kick off x,y or z
I prefer the logfile method as it's cleaner but both ways would work

Thinking it through you could even kick off a screen scrape for the runner/player in the alert and pass that data back to be used. Options :)
yeah -just looked at the specs for AutoIt, looks like it's pretty fully featured and one bit caught my eye:

Call Win32 and third-party DLL APIs

this would allow you to capture the window handle of the Alert dialog, read the text (to ensure you were acting on the correct alert) and then run a routine against your chosen exe/dll etc, etc... very good ;)
yes, it's very well feautured. I've been using it for years to manipulate window based wallboards for my systems alerting at work. I know it so well I 've been doing my web scraping using the IE functions. Not found anything it hasnt been able to do I need to yet :)
User avatar
jimibt
Posts: 4197
Joined: Mon Nov 30, 2015 6:42 pm

Citysharks meet sniffer66

sniffer66 meet Citysharks

;)
spreadbetting
Posts: 3140
Joined: Sun Jan 31, 2010 8:06 pm

I have some VBA that sends me email reports at set times. I'll dig it out when I'm at my pc. You just need to write some routine to kick off the email sub code
spreadbetting
Posts: 3140
Joined: Sun Jan 31, 2010 8:06 pm

Here's a sendmail sub routine that woks with outlook and excel

I don't use BA so not sure where or the format it sends data to excel or even logfiles. But shouldn't be too hard a stretch to have excel monitor changes in a logfile or excel sheet to kick it off when there's been a change in bets.

Code: Select all

Sub Send_Mail()
Application.DisplayAlerts = False
On Error Resume Next


Dim Email_Subject, Email_Send_From, Email_Send_To, _
Email_Cc, Email_Bcc, Email_Body As String
Dim Mail_Object, Mail_Single As Variant
Email_Subject = time() & " whatever message you want"
Email_Send_From = "[email protected]"
Email_Send_To = "[email protected]"

Email_Body = Worksheets("Sheet1").Range("A10").Value & " Balance £" & Worksheets("Sheet1").Range("I11").Value

On Error GoTo debugs
Set Mail_Object = CreateObject("Outlook.Application")
Set Mail_Single = Mail_Object.CreateItem(0)
With Mail_Single
.Subject = Email_Subject
.To = Email_Send_To
.cc = Email_Cc
.BCC = Email_Bcc
.Body = Email_Body
.send
End With
debugs:
If Err.Description <> "" Then MsgBox Err.Description
Application.DisplayAlerts = True
End Sub
Citysharks
Posts: 14
Joined: Mon Feb 10, 2020 12:37 pm

This was created and is open source from another provider

module BfexplorerBot

//(*
#I @"C:\Program Files (x86)\BeloSoft\Bfexplorer\"

#r "BeloSoft.Data.dll"
#r "BeloSoft.Betfair.API.dll"
#r "BeloSoft.Bfexplorer.Domain.dll"
#r "BeloSoft.Bfexplorer.Trading.dll"
#r "BeloSoft.Bfexplorer.Service.Core.dll"
//*)

open System
open System.Diagnostics
open System.Net
open System.Net.Mail

open BeloSoft.Data
open BeloSoft.Bfexplorer.Domain
open BeloSoft.Bfexplorer.Trading

// https://myaccount.google.com/lesssecureapps
let FromEmail = "[email protected]"
let ToEmail = "[email protected]"

/// <summary>
/// EmailService
/// </summary>
type EmailService() =

let smtpClient = new SmtpClient("smtp.gmail.com", 587)

do
//smtpClient.DeliveryMethod <- SmtpDeliveryMethod.Network
//smtpClient.UseDefaultCredentials <- true
smtpClient.Credentials <- NetworkCredential("[email protected]", "yourpassword")
smtpClient.EnableSsl <- true

static let instance = lazy(EmailService())

static member Instance
with get() = instance.Force()

member _this.Send(subject, message) =
try
let mailMessage = new MailMessage(FromEmail, ToEmail, subject, message)

smtpClient.SendMailAsync(mailMessage) |> Async.AwaitTask |> Async.Start
with
| ex -> Debug.WriteLine(ex.Message)

let isMatchedBet (bet : Bet) =
match bet.OrderStatus with
| BetOrderStatus.Matched
| BetOrderStatus.PartiallyMatched -> true
| _ -> false

let toBetHashCode (bet : Bet) =
sprintf "%s%.2f" bet.Id bet.Size

/// <summary>
/// BetMatchedNotificationBot
/// </summary>
type BetMatchedNotificationBot(market : Market, _selection : Selection, _botName : string, _botTriggerParameters : BotTriggerParameters, myBfexplorer : IMyBfexplorer) =

let getMatchedBetsHashCode() = maybe {
if market.Bets.HaveMatchedBets
then
return
market.Bets
|> Seq.filter isMatchedBet
|> Seq.map toBetHashCode
|> String.concat "|"
}

let matchedBetsToString() =
let matchedBets =
market.Bets
|> Seq.filter isMatchedBet
|> Seq.map (fun bet -> bet.ToString())
|> String.concat "\n"

sprintf "%s\n\nMatched bets:\n\n%s" market.MarketFullName matchedBets

let outputMessage message =
myBfexplorer.BfexplorerService.OutputMessage(message, market.Id)

let mutable matchedBetsHashCode : string = defaultArg (getMatchedBetsHashCode()) String.Empty

interface IBotTrigger with

/// <summary>
/// Execute
/// </summary>
member __.Execute() =
getMatchedBetsHashCode()
|> Option.iter (fun hashCode ->
if matchedBetsHashCode <> hashCode
then
matchedBetsHashCode <- hashCode

let message = matchedBetsToString()

EmailService.Instance.Send("Matched bets on betfair", message)
outputMessage message
)

TriggerResult.WaitingForOperation

/// <summary>
/// EndExecution
/// </summary>
member __.EndExecution() =
()
Post Reply

Return to “Bet Angel - Spreadsheet / Excel chat”