MarauderNL Posted February 5, 2009 Posted February 5, 2009 Hi there! I've got a slight problem, I'm using AutoIt for this program called EeRom-8U. Basically what I'm doing is taking a file that got generated by a programming enviroment (CodeWright) and use EeRom to load it onto an emulator (used to test our gambling machine games before we put them onto a chip) The problem is this: The script works but is pretty sloppy. When I start up EeRom, it has to check wether the emulators are connected. I wanted to do this by checking if the text "not connected!" would have changed to "ERU#### / 2.0", but that doesn't work since the Window tool doesn't pick up the text. So my next idea was to see if the location of the "!" was black, that would mean it's not connected. If it was grey (the background color) it would mean it's connection. However, how do I manage to tell PixelGetColor that the coordinates should be calculated from within the control, and not the screen? Thanks in advance!
Moderators Melba23 Posted February 5, 2009 Moderators Posted February 5, 2009 MarauderNL,Had to look this up myself yesterday, so it is nice and fresh in the memory! You need to adjust the PixelCoordMode through the Opt function. From the Help file for Opt:PixelCoordMode Sets the way coords are used in the pixel functions, either absolute coords or coords relative to the window defined by hwnd (default active window):0 = relative coords to the defined window1 = absolute screen coordinates (default)2 = relative coords to the client area of the defined window Use the Au3Info tool to get the hwnd and set Mode 0 or 2. That should do it! Do not forget to reset the mode when you are done or you might get a nasty surprise when you next use a Pixel function - the current mode is returned when you set a new one, so it is easy to save it in a variable.M23 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: Reveal hidden contents 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
MarauderNL Posted February 5, 2009 Author Posted February 5, 2009 That worked! Awesome! Thanks a bunch!
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