Jonneh Posted May 16, 2014 Share Posted May 16, 2014 (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 May 16, 2014 by Jonneh Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted May 16, 2014 Moderators Share Posted May 16, 2014 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? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Jonneh Posted May 16, 2014 Author Share Posted May 16, 2014 (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 May 16, 2014 by Jonneh Link to comment Share on other sites More sharing options...
JohnOne Posted May 16, 2014 Share Posted May 16, 2014 several scripts. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Jonneh Posted May 16, 2014 Author Share Posted May 16, 2014 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? Link to comment Share on other sites More sharing options...
JohnOne Posted May 16, 2014 Share Posted May 16, 2014 Yes, don't put hotkeys in the scripts, just use them for the search. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Jonneh Posted May 16, 2014 Author Share Posted May 16, 2014 (edited) how would i do that? could you show me an example based on what i posted please? Edited May 16, 2014 by Jonneh Link to comment Share on other sites More sharing options...
JohnOne Posted May 16, 2014 Share Posted May 16, 2014 $location = PixelSearch($Left, $Top, $Right, $Bottom, $Colour, 0, 3) If @error then Exit 0 IniWrite("ini.ini", "section", "x", $location[0]) IniWrite("ini.ini", "section", "y", $location[1]) Exit 1 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Palestinian Posted May 16, 2014 Share Posted May 16, 2014 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now