kileveryone6 Posted May 1, 2014 Share Posted May 1, 2014 (edited) Hi there, I would like to make a script that interacts with a 3rd party application which I downloaded onto my computer. This application has a few sets of interactions. My ultimate goal with the help of you pushing me in the right direction is to interact with this application which has no menu. What I want is when a integrated pop-up appears in this window (near the bottom) I would like to send it a command. I've attempted to use the picture recognition as discussed here... '?do=embed' frameborder='0' data-embedContent>> but sadly I dont think this custom code fits my needs. Maybe I'm going about this wrong, but I would happy to be pointed in the correct direction. If more information is needed, please let me know and I'll try to provide as much detail as possible. #include <MsgBoxConstants.au3> #include <Array.au3> #include <ImageSearchMod.au3> Global $x = 0 Global $y = 0 $sFldr1 = @DocumentsCommonDir & "\MyScripts\" $imageArray[4] ;images locations $imageArray[0] = $sFldr1 & "image1.bmp" $imageArray[1] = $sFldr1 & "image2.bmp" $imageArray[2] = $sFldr1 & "image3.bmp" $imageArray[3] = $sFldr1 & "image4.png" While 1 If WinWaitActive("[CLASS:Application Name]") Then $pictureResults = _WaitForImagesSearch($imageArray, 1, 1, $x, $y, 10) MsgBox($MB_SYSTEMMODAL, "Title", "Picture found = " & $pictureResults) WinWaitNotActive("[CLASS:Application Name]") EndIf Sleep(15000) WEnd Edited May 1, 2014 by kileveryone6 Link to comment Share on other sites More sharing options...
JohnOne Posted May 1, 2014 Share Posted May 1, 2014 Be a good idea to explain what exactly is going wrong with your code, post the missing function from your code and explain exactly what "send it a command" means (close it, flash it, turn it upside down). AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
DatMCEyeBall Posted May 1, 2014 Share Posted May 1, 2014 (edited) Be a good idea to explain what exactly is going wrong with your code, post the missing function from your code and explain exactly what "send it a command" means (close it, flash it, turn it upside down). ...And the missing include "ImageSearchMod.au3", or at least a url from which it can be downloaded. Maybe the bug is in those missing things - we'll never know until you post them. Shouldn't the definition of $imageArray be "Global $imageArray[4]" and not just "$imageArray[4]"? Edited May 1, 2014 by DatMCEyeBall "Just be fred, all we gotta do, just be fred." -Vocaliod "That is a Hadouken. A KAMEHAMEHA would have taken him 13 days and 54 episodes to form." - Roden Hoxha @tabhooked Clock made of cursors ♣ Desktop Widgets ♣ Water Simulation Link to comment Share on other sites More sharing options...
kileveryone6 Posted May 1, 2014 Author Share Posted May 1, 2014 (edited) Here's the original download for that included image file... http://www.autoitscript.com/forum/index.php?app=core&module=attach§ion=attach&attach_id=40653 (This file includes the au3 file and a DLL) As far as my code, it's just not doing anything, and by that I mean for the messagebox to appear. My array seems to work as I can callout each image just find and see the file size. I attempted with a global attribute to the variable with no luck as well. Goal of this is to have AutoIT to interact with a 3rd party application. When this pops up at the bottom, as such: I want AutoIT to send a command, which will be... Send("{ENTER}") For the include file, the only changes I made in case you get the same error is as follows. Line 39-40 has been changed from ; If error exit if $result[0]="0" then return 0 To ; If error exit ;if $result[0]="0" then return 0 If IsArray($result) Then If $result[0] = "0" Then Return 0 Else If $result = "0" Then Return 0 EndIf Edited May 1, 2014 by kileveryone6 Link to comment Share on other sites More sharing options...
kileveryone6 Posted May 4, 2014 Author Share Posted May 4, 2014 bump... would anyone recommend attempting at another approach such as attempting to read the memory? If so how would one go and start doing that? Link to comment Share on other sites More sharing options...
LarsJ Posted May 5, 2014 Share Posted May 5, 2014 Take a look at the UI Automation framework.Download the two UDFs in bottom of first post, and download and run the code in the "Simple spy demo" codebox in the middle of first post.To verify that a control/window can be identified place the mouse cursor over the control/window and press Ctrl+w. You can see an example here.Note that the framework is based on COM interface objects (created with ObjCreateInterface), so it's not just as easy to use as most built-in commands. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
kileveryone6 Posted May 6, 2014 Author Share Posted May 6, 2014 Thanks for the reply, I'll take a look into this and let you know. 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