Sign in to follow this  
Followers 0
Jonneh

Pixel Search Help

9 posts in this topic

#1 ·  Posted (edited)

Hi there, I've been using AutoIt for a very short time and I have found nothing on running multiple Pixel Search functions at the same time.

I was wondering if it was even possible to run them simultaneously?

This is a snipit from my program at the moment.

Dim $location = PixelSearch($Left, $Top, $Right, $Bottom, $Colour, 0, 3)

I want to basically run 1-5 of these at the same time. and each one to scan a different section of the screen.

Would it be resource heavy?

Any help would be much appreciated :)

Edited by Jonneh

Share this post


Link to post
Share on other sites



As AutoIt is single threaded, you're not going to get multiple actions at once, no. The bigger question is just what you are trying to accomplish. Most people who begin trying to manipulate an application or window using PixelSearch find in short order that there are much easier (and more stable) ways of accomplishing what they want to do. Can you explain more about what you want to do with your program, or post what you have thus far?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

The program waits for the user to select the Pixel colour to find, the pixel search then finds that exact pixel on the screen

Func GetPixel()
    $pos = MouseGetPos()
    Global $Colour = PixelGetColor(MouseGetPos(0), MouseGetPos(1))
    Sleep(250)
EndFunc

While True
    $hHandle = WinGetHandle("MyProcess")
    If $Active = True Then
        ToolTip("Active", 0, 0)
        Dim $location = PixelSearch($Left, $Top, $Right, $Bottom, $Colour, 0, 3)
        If Not @error Then
            ControlClick($hHandle, "", "#327701", "right", 1, $location[0], $location[1])
            Sleep(Random(10, 150, 1))
        EndIf
    EndIf
WEnd

It just needs to run multiple instances of the search at the same time to make it faster at finding it and clicking it.

If it's not possible to run the search multiple times from the same code, is it possible to do something like in VB where you can call a DLL that calls another X amount of DLL files all with the same function? Or would i have to run several scripts at the same time?

Edited by Jonneh

Share this post


Link to post
Share on other sites

my only problem with that is the clashing hotkeys, there is the hotkey for the pixel, a stop key so you can stop looking for that pixel and chose a new one and the end script hotkey... I dont fancy pressing 12-15 keys... do you know any work arounds?

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

how would i do that?

could you show me an example based on what i posted please?

Edited by Jonneh

Share this post


Link to post
Share on other sites


It just needs to run multiple instances of the search at the same time to make it faster at finding it and clicking it.

 


The program waits for the user to select the Pixel colour to find

 

I don't believe a user selecting pixel colours can do that faster than autoit finding the given pixels, you can't do a multi searching process if the script has already finished searching for the 1st colour.

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