Jump to content

Cancel Function


Math2
 Share

Recommended Posts

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
Link to comment
Share on other sites

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.

Link to comment
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 ?

Link to comment
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.

Link to comment
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 ?

Link to comment
Share on other sites

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
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...