Sign in to follow this  
Followers 0
Math2

Cancel Function

9 posts in this topic

#1 ·  Posted (edited)

While 1
Sleep(15)
$coord1 = PixelSearch(300, 641, 345, 685, 16777215, 0)
If IsArray($coord1) = True Then
  Send("{a}")
  Send("{a down}")
EndIf

This color is White, then what I want is when the screen appear all white(sometime happen), the code has to cancel the func up. How ?

Edited by Math2

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

get a pixelchecksum of the whole white screen (use the optional step parameter for speed)

check also for that checksum in the loop, and return from function if true.

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

And with this, is possible to come back the Func ? Because the white screen is so fast, then after it appear, I want the func working, again.

Share this post


Link to post
Share on other sites

It is many code for me begginer. I think in a possibility of put an hotkey to stop the program and when the Checksum find the screen, it send the stop key sleep some time the come back the func send the key again. Do you agree with me ?

Share this post


Link to post
Share on other sites

I agree that is the best way because you thought of it yourself. But I would advise you look at AdLibRegister() before using hotkeys

That function will run a function every 250 milliseconds (default) that could be your function to test for the white screen.

I do not agree that it is "many code for you beginner".


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

Then, If I use hotkey, Should I use Pixelchecksum or PixelSearch ? I think that have to be this way

$Protection = PixelChecksum(bla, bla, bla, bla, 16777215, 0)
  If IsArray($Protection) = True Then
       Send("{hotkey}")
    sleep(250)
    Send("{hotkey up}")
  EndIf

What do you think ?

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Sorry, but I can do manually but automatically it is difficulty because the things that I am sending keys are white, and all the screen be white, then the program send the key in the wrong time.

Edited by Math2

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
Sign in to follow this  
Followers 0