DodgeThis Posted October 10, 2006 Posted October 10, 2006 (edited) PixelSearch Function searches only in rectangular area , right ? Please forgive my noobism as an effort to learn more. But is there a way i can use Same function to search Triangular area.So please help me with these:1) While using AutoIt Window Info is it advisable to keep it set for screen or client window while using it for game?2) In context to above , since i want to use it for triangular search is it possible?3) What would be the fastest way to scan an image for certain color (any special algorithm to use ? fast in sense of CPU Time and efficiency.)4) I believe searching very small rectangle areas spread over the entire screen. Would this make it slower.I do apolize if i am sounding absurd. This is not an idea i have so far been succesful only with the rectangular search, but at cost of CPU Overheat.Any help appreciatedHere what i am trying to do: Edited October 10, 2006 by DodgeThis
PsaltyDS Posted October 10, 2006 Posted October 10, 2006 DodgeThis said: PixelSearch Function searches only in rectangular area , right ? Please forgive my noobism as an effort to learn more. But is there a way i can use Same function to search Triangular area.No, not with PixelSearch(), but you could code a function of your own. Just take in three sets of coordinates instead of two and do the maths to generate a loop for PixelGetColor(). You could make a fuction to search an oval or a pentagon. Anything for which you can do the maths to find a set of x/y coordinates contained in the shape. Quote So please help me with these:1) While using AutoIt Window Info is it advisable to keep it set for screen or client window while using it for game?Probably window vice desktop, especially if not running full-screen. Quote 2) In context to above , since i want to use it for triangular search is it possible?Answered above. Quote 3) What would be the fastest way to scan an image for certain color (any special algorithm to use ? fast in sense of CPU Time and efficiency.)a. Search the smallest possible area that will provide usefull results. b. Don't search every pixel. If the target is a square 10 pixels on a side, then searching every ninth or tenth pixel will find it. Quote 4) I believe searching very small rectangle areas spread over the entire screen. Would this make it slower.It will if you still cover the whole screen. But this is testable. Code a search both ways and time it with TimerInit()/TimerDiff(). Quote I do apolize if i am sounding absurd. This is not an idea i have so far been succesful only with the rectangular search, but at cost of CPU Overheat.I hope you meant overhead. Nothing about an AutoIT script will cause overheating in a normally functioning computer. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
DodgeThis Posted October 10, 2006 Author Posted October 10, 2006 Aight thanks for replying. I was thinking more like make small rectangles. Keep each as a separte Switch Case(with minimum result needed for matching). Once found jump to executing that part of code.
DodgeThis Posted October 10, 2006 Author Posted October 10, 2006 One more quick question: How does pixelsearch work ? Diagonally Horizontally or just equationally (x1 + x2 )/2 , in context of rectangle
PsaltyDS Posted October 10, 2006 Posted October 10, 2006 DodgeThis said: One more quick question: How does pixelsearch work ? Diagonally Horizontally or just equationally (x1 + x2 )/2 , in context of rectangle Left-to-Right, and Top-to-Bottom. The equivelent function is: Func _SearchPattern($X1, $Y1, $X2, $Y2) Local $x, $y, $Color For $x = $X1 To $X2 For $y = $Y1 To $Y2 $Color = PixelGetColor($x, $y) ; Compare logic goes here... Next Next EndFunc Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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