Sign in to follow this  
Followers 0
fireblazehu

Help with a simple script ~

4 posts in this topic

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 =(

Share this post


Link to post
Share on other sites



pixelsearch

Share this post


Link to post
Share on other sites

pixelsearch

Can you be more specific? =/ I dont know what that is

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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.

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