Jump to content

How to implement İsOBject function of ACTool in Autoit?


Recommended Posts

Hi,

I first found ACtool in internet for macro writing then later AUTOIT. I found AUTOIT it more flexible-useful-advanced. ACTool has a function that i could not find it in AUTOIT implemeneted.(May be it is somewhere but i am not patient enough :idea:.

What I am trying to do is to write a function which compares pixel color values of a square (or rectengular) area on the screen with the values defined in the script and returns TRUE or FALSE (Like it is imlemented in ACtool).

This functionality is implemented in ACtool as follows:

// Define the Pixel and color values of an area as object

Object SomeObject // Test at coords 1387, 855

182=0,0|255=1,0|255=2,0|66=3,0|49=4,0|214=5,0|255=6,0|255=7,0|

198=0,1|255=1,1|140=2,1|33=3,1|41=4,1|41=5,1|214=6,1|255=7,1|

End Object

//Check object at given screen coordinates

isOBject SomeObject at 1387, 855

// Code... if object is present

Else

// Code... if object is not there

End

Can you help me to implement the above functionality in AUTOIT? (Script samles appriciated)

Thank You.

Link to comment
Share on other sites

  • Moderators

Facimus,

Welcome to the AutoIt forum. :idea:

Two possible ways to do what you want:

- 1. Use an array to hold the colours of the pixels. Then use PixelGetColor in a loop to read the current colours - if they match, the object you are looking for is there.

- 2. Use PixelCheckSum on the area when it contains the object you want and store the result. Then use PixelCheckSum on the area again - if you get the same value, the object you are looking for is there.

See which one is easier for you. :)

M23

P.S. No script samples - I am not patient enough. :(

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

or, if you know what color you are looking for and the only time that color appears is for your condition, you could do a pixelsearch in your area for that color until found.

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

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