Jump to content

When progress is compelete send email?


Recommended Posts

How would I go about inserting a set of code to email me once the progress bar has reached its max?

Thanks for the help :D

Opt("WinWaitDelay", 100)
Opt("WinTitleMatchMode", 4)
Opt("WinDetectHiddenText", 1)
Opt("MouseCoordMode", 0)

;Hotkey to exit (ctrl+alt+x)

HotKeySet("^!x", "QuitProg")
Func QuitProg()
    Exit
EndFunc 

;Display Warning

MsgBox(0, "YAMS YAMS YAMS", "PLEASE DO A MANUAL SCAN BEFORE RUNNING THIS SCRIPT" & @CRLF & "Please be signed in as Admin User" & @CRLF & "Please do not move mouse when script is running" & @CRLF & "Click Ok to start 100 scans")

;Start loop of 100 and display of progress bar

Dim $Count = 1
ProgressOn("Progress Information", "Current scanning cycle", "Yar" , 500 , 500 , 10)
For $Count = 1 To 100 Step +1
    ProgressSet( $Count, $Count & " of 100 scans.")



WinActivate("YAMS","")
If Not WinActive("YAMS","") Then WinActivate("YAMS","")
WinActivate("YAMS","")
If Not WinActive("YAMS","") Then WinActivate("YAMSl","")
WinWaitActive("YAMSl","")
MouseMove(166,82)
MouseDown("left")
MouseUp("left")
WinWait("Select Scan Method","")
If Not WinActive("Select Scan Method","") Then WinActivate("Select Scan Method","")
WinWaitActive("Select Scan Method","")
MouseMove(80,228)
MouseDown("left")
MouseUp("left")

WinWaitActive("hp scanning","")
WinWaitNotActive("hp scanning","")

WinWaitActive("Wait","")
WinWaitNotActive("Wait","")

Next

ProgressSet(100 , "Done", "Complete")
sleep(500)
ProgressOff()


;Exit after loop and closes progress bar

Exit
Edited by jbsoccerbrit
Link to comment
Share on other sites

Look at _INetSmtpMail in the help file

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

Look at _INetSmtpMail in the help file

I understand the concepts its displaying in the help file but do not know how to integrate it with when the progress bar finishes, have it perform some sort of trigger so to speak.

But thank you for directing me to the right part of the help file :D

Link to comment
Share on other sites

ProgressSet(100 , "Done", "Complete")
sleep(500)
ProgressOff()

; This would be a good place to put the code for sending the email

;Exit after loop and closes progress bar

Exit

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

ProgressSet(100 , "Done", "Complete")
sleep(500)
ProgressOff()

; This would be a good place to put the code for sending the email

;Exit after loop and closes progress bar

Exit
Exactly before the program closes but I think more of what I am looking for how to write the code to trigger the email.

Example:

When ProgressSet is == 100

Then

Send the email

Exit

Link to comment
Share on other sites

Exactly before the program closes but I think more of what I am looking for how to write the code to trigger the email.

Example:

When ProgressSet is == 100

Then

Send the email

Exit

I am so clueless about what you're trying to say but to continue on the earlier theme:

ProgressSet(100 , "Done", "Complete")
; This would be a good place to put the code for sending the email
sleep(500)
ProgressOff()

;Exit after loop and closes progress bar

Exit
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...