Thomas56 Posted October 4, 2017 Posted October 4, 2017 Hi all, I´am new to Autoit and I have no programming skills. What I want to do is I have to check the Screen for an alarm message (Picture) and if this appears I have to send a post request. What I have till now is a Script which can find this Picture with PictureSearch and make the post request to a Server. This works fine. I have copied the needed parts from different sample Scripts all over the web. Now the script search for the Picture, send the request and stops. What I want to change is that the script keeps running and make the request, after a sleep again for three times. Then it shoulg go back to the top and search again for the picture. The script should keep running until it is stopped manualy. Would be great if someone could help. Thanks
Developers Jos Posted October 5, 2017 Developers Posted October 5, 2017 Please post the code as tekst in a codebox using the <> option available in the top row of the message editor so we can cut&paste it to assist. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Thomas56 Posted October 5, 2017 Author Posted October 5, 2017 Hi Jos, thank you for your replay. here the Code: #include <ImageSearch2015.au3> #include "WinHttp.au3" $x1 = 0 $y1 = 0 $picture = "C:\alarm.PNG" Do $result = _ImageSearch ($picture,1,$x1,$y1,100,0) ;_ImageSearch($findImage, $resultPosition, ByRef $x, ByRef $y, $tolerance, $transparency = 0) ConsoleWrite($result) until $result = 1; if $result=1 Then Global $MD5 = HttpPost("https://www.pushsafer.com/api?k=xxxxxxxxxxxxxx&d=xxxxxx&s=xx&v=x&m=%0A") MsgBox(64, "MD5", $MD5) Else MsgBox(0,"MSG","End") EndIf
Developers Jos Posted October 5, 2017 Developers Posted October 5, 2017 Wouldn't it be as simple as this?: #include <ImageSearch2015.au3> #include "WinHttp.au3" $x1 = 0 $y1 = 0 $picture = "C:\alarm.PNG" While 1 $result = _ImageSearch($picture, 1, $x1, $y1, 100, 0) ;_ImageSearch($findImage, $resultPosition, ByRef $x, ByRef $y, $tolerance, $transparency = 0) ConsoleWrite($result) If $result = 1 Then Global $MD5 = HttpPost("https://www.pushsafer.com/api?k=xxxxxxxxxxxxxx&d=xxxxxx&s=xx&v=x&m=%0A") MsgBox(64, "MD5", $MD5) EndIf WEnd Jos Thomas56 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Thomas56 Posted October 5, 2017 Author Posted October 5, 2017 Hi Jos, yes, for a true master it is easy. For me it is just . Thank you very much. Now I can go on to step 2 of my Project. On a System start I have to start the Monitoring Software with username and password and for sure this script. I will try to find a way by myself. But is nice to have such helpful People. Thanks again, Thomas
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now