Jump to content

Help with a simple script ~


Recommended Posts

I need help on making a simple script that do the following :

press a key

check if a certain pixel color on the screen appear, if it does, wait like 10 sec and repeat

if it not wait 2 sec and press backspace

press the original key aggain and repeat

can anyone help? thanks.

Far as i can go is get it to press the key and repeat, i dont know how to work the pixel color part =(

Link to comment
Share on other sites

Welcome to the forum!

It would be easiest to use pixelchecksum, which checks if any pixels in a region have changed. If that works, you could use something like this:

I commented it for you, since your new.

$checksumregion = PixelChecksum(left, top, right, bottom) ; left top right and bottom define the area that it checks

While 1; infinite loop
    Send("key")
    Sleep(1000); the sleep function uses milliseconds
    If $checksumregion <> PixelChecksum(left, top, right, bottom) Then; checks if the region has changed
        Sleep(10000); if it has, it waits 10 seconds
    Else
        Sleep(2000); else it waits 2 seconds
        Send("{backspace}"); and sends backspace
    EndIf
WEnd

pixelsearch would work too, but you would have to know the exact coordinates of the pixel.

The helpfile is a great resource.

Edited by pigeek

The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

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