scriptshark

If image detected for 60 seconds = click

7 posts in this topic

#1 ·  Posted (edited)

i don't know what conditions i need to use, to be honest i don't know where to start

i want something like: if image is the same for 60 seconds = click that image.

i have this code but it click when the image is found

While (1)

                  $result111 = _ImageSearch("flower.png",1,$x1,$y1,10) 
if $result111=1 Then
    MouseClick("left",$x1,$y1,1,3)
                    Sleep(1000)
             EndIf
WEnd

 

Edited by scriptshark

Share this post


Link to post
Share on other sites



You have to check it twice. After you found the image, wait for 60 seconds and check again.
Out of curiosity: Which program do you try to automate?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

the one we have on work, we're trying to test the routers if it's working. i need to check the icon on the internet if it's on or not.

can you give me an example please?

Edited by scriptshark

Share this post


Link to post
Share on other sites

Something like this:

If _ImageSearch("flower.png",1,$x1,$y1,10) = 1 Then
    Sleep(60000)
    If _ImageSearch("flower.png",1,$x1,$y1,10) = 1 Then
        MouseClick("left", $x1, $y1, 1, 3)
    EndIf
EndIf

But to check routers etc. I would suggest to use something more reliable like Nagios.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

the one you gave is already good enough i think, let me try. thank you!

Share this post


Link to post
Share on other sites

:)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

All these new fancy Cisco routers we have around here with flowers in the GUI :)

If I needed to see if something was online or not my first thoughts go to Ping()

P.S. We have Nagios and Solarwinds they work, but still always like to write my own stuff.

Share this post


Link to post
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