Sign in to follow this  
Followers 0
DodgeThis

Game Triangular Pixel Search

6 posts in this topic

#1 ·  Posted (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 appreciated

Here what i am trying to do:

Posted Image

Edited by DodgeThis

Share this post


Link to post
Share on other sites



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.

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.

2) In context to above , since i want to use it for triangular search is it possible?

Answered above.

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.

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

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.

:lmao:


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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

One more quick question:

How does pixelsearch work ?

Diagonally Horizontally or just equationally (x1 + x2 )/2 , in context of rectangle

Share this post


Link to post
Share on other sites

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

:lmao:


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

Share this post


Link to post
Share on other sites

Once again thank you. :lmao:

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