Facimus Posted May 16, 2010 Share Posted May 16, 2010 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 .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 objectObject 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 coordinatesisOBject SomeObject at 1387, 855// Code... if object is presentElse// Code... if object is not thereEndCan you help me to implement the above functionality in AUTOIT? (Script samles appriciated)Thank You. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 20, 2010 Moderators Share Posted May 20, 2010 Facimus,Welcome to the AutoIt forum. 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. M23P.S. No script samples - I am not patient enough. 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
kaotkbliss Posted May 20, 2010 Share Posted May 20, 2010 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 gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! 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