Jump to content

PixelSearch Slower


Math2
 Share

Recommended Posts

Here is part of the script:

While 1
Sleep(15)
$coord1 = PixelSearch(300, 641, 345, 685, 13816530, 16,)
If IsArray($coord1) = True Then
  Send("{a}")
EndIf
If IsArray($coord1) = True Then
  Send("{a down}")
EndIf
WEnd

But it is missing some "send key". Example, appears 2 and it only send one and miss the other. I think it is because I use vista, but I'm not sure. Is possible to optimize this script or I have to change the OS ?

Edited by Math2
Link to comment
Share on other sites

I see you send "{a}" then an Send("{a down}"). If you want your loop to run faster shorten your sleep statement. Of course you run the risk of increasing your processor overhead. Changing your OS won't make a difference seeing how you are viewing a virtual PC screen when doing your search.

Edited by MPH
Link to comment
Share on other sites

Did you suggest to me reduce the Sleep ? If yes, I had already tried reduce the sleep, it gets a little bit better, but continue missing. And before this numbers of the PixelSearch I tried more numbers and this was the best, but continue missing points, I think that is my processor, What do you think ?

Edited by Math2
Link to comment
Share on other sites

If IsArray($coord1) = True Then
  Send("{a}")
EndIf
If IsArray($coord1) = True Then
  Send("{a down}")
EndIf

It might run a bit more efficiently if you weren't checking to see if $coord1 were an array twice. You should be able to just do it once. Conditional statements tend to use more CPU.

If IsArray($coord1) = True Then
  Send("{a}")
  Send("{a down}")
EndIf

You might also condense it down to just one Send() statement.

If IsArray($coord1) = True Then Send("{a}{a down}")
Link to comment
Share on other sites

Since you said you were on Vista, do a search for DWM. You will find explanations both on why PixelSearch() can be very slow and how to fix it.

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