Sign in to follow this  
Followers 0
Maibuwolf

pixelsearch problems

6 posts in this topic

so i got this code typed out and it is as follows

Func bleh()


$F = PixelSearch( 141, 90, 470, 350, 15058587, 0, 10 )
sleep(500)
if not @error then
   MouseMove($F[0], $F[1], 0)
   Sleep(100)
   MouseClick("left")

else

endif


 

EndFunc

ok as you can see im running a pixel search for the said pixel looking for an exact match and stepping by 10. Now if it fails it should set @error to 1. So assuming the pixel is found it should do the code in my if statement correct? Please note that performing the code inside the if state if said pixel is found is what im going for here. Also note i have this looped to run continuously. Every time i run it it errors instantly with autoit saying:

error on line blah blah

MouseMove($F[0], $F[1], 0)

MoveMouse($F^ Error

Error: Subscript used with non-array Variable

only way it should perform that code is if the error was not set to 1 meaning that it found the pixel. If it infact found the pixel then the variable $f should infact be an array. From this it appears as though it is performing the code withing my if statement regardless of what @error is equal to. Any ideas?

Share this post


Link to post
Share on other sites



thanx cant belive i didnt notice that..well it is 4:30 am and i have to go to bed late coding rawks :o

Share this post


Link to post
Share on other sites

$F = PixelSearch( 141, 90, 470, 350, 15058587, 0, 10 )

Why decimal colors ?


-jaenster

Share this post


Link to post
Share on other sites

Because he can.

In the helpfile for PixelSearch: Color: Color value of pixel to find (in decimal or hex).

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