Sign in to follow this  
Followers 0
Odelay

Detect Movement / Colour ... And then ?

3 posts in this topic

#1 ·  Posted (edited)

Hey there!..

I'm trying to make this sort of program with the main idea:

I. Wait for a window

II. Wait a bit longer and then

III. Start searching for a colour / searching for movement .. and if that is detected, then

IV. Do some action.

Basicly the waiting for the window and stuff is no problem, but when it comes to the part where I would need the

script to first search for a colour, or wait for a movement, and then send for example space button, it doesnt work. :P

Ive used both Pixelsearch and Pixelchecksum and all kinds of other methods, but i cant get it to work. I guess this

type of script would be somewhat like the ususal " world of warcraft fishing bots ", but this script is meant for something

else,

Its for a game, that requires fast reflexes. A green light shows up, and then you should press space as soon as possible.

If anyone would have the time to give me any idea how to work out the Pixelsearches etc I would be very,very happy! :)

;--------------------------------------
Sleep ( 1000 )
WinActive ( "" ); Name of the specific Window
Sleep ( 1000 )
Mouseclick ( "left" , 340, 490, 1, 0 )
Sleep ( 3000 )
;--------------------------------------
; Now the next part im not at all sure about.
;--------------------------------------
While 1
    Do
    $coord = PixelSearch( 295, 450, 391, 535, 0x009A00, 40, 4 ); Greenish Colour
    sleep(30)
until    $coord = PixelSearch( 295, 450, 391, 535, 0x009A00, 40, 4 )
WEnd
Send ("{Space}")
;--------------------------------------
Edited by Odelay

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Well... you have only set the value for $coord... you are not using it :)

Edited by dcer

Share this post


Link to post
Share on other sites

Well... you have only set the value for $coord... you are not using it :P

Heheh :) well it doesnt work even if id just skip the $coord part, or should it even work then, im quite the beginner :P.

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