Driveskull Posted March 6, 2014 Share Posted March 6, 2014 Hello i have a problem . I am working on the script Which need to find an image on the screen and Right click it . Problem is that the image which needs to be clicked is the same as the others 75 Process need to be repeated until there are no more those images on the screen The other part of the code is using images from the folded and click 2 times . So its like this Image found > right click , new image >left click > new image left click . IS there a way so the first image will be clicked , now script only goes from image to image right clicking all the time . And can iput smth like this ? >>> If _ImageSearchArea(@WorkingDir & "\Images\5.png" & "\Images\2.png" & "\Images\4.png" , 1, 0, 150, @DesktopWidth, @DesktopHeight, $imageX, $imageY, 0) = 1 Then $image = $imageList[1] ;First image in file dont use 1 number ;This will search the entire screen for the image If _ImageSearchArea(@WorkingDir & "\Images\5.png" , 1, 0, 150, @DesktopWidth, @DesktopHeight, $imageX, $imageY, 0) = 1 Then ;------------------ MouseMove($imageX, $imageY, 0) Sleep(100) ;A small amount of time for the mouse to move to the image MouseClick("Right") EndIf $imageCount = 2 While $imageCount <= (UBound($imageList) - 1) ;will continue until there are no more images in the array $image = $imageList[$imageCount] While _ImageSearchArea(@WorkingDir & "\Images\" & $image, 1, 0, 150, @DesktopWidth, @DesktopHeight, $imageX, $imageY, 0) = 1 MouseMove($imageX, $imageY, 0) Sleep(300) MouseClick("Left") WEnd $imageCount = $imageCount + 1 WEnd Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted March 6, 2014 Moderators Share Posted March 6, 2014 What exactly are you trying to automate? I can almost guarantee there is a better way than using ImageSearch, especially if you have so many of the same type of images. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Driveskull Posted March 6, 2014 Author Share Posted March 6, 2014 Imagesearch is the must , because in the first part there will be around 60 types of images which will have own duplicates. So its need to find it then click it with right button so the new window will apear to delete it and click confirm Link to comment Share on other sites More sharing options...
Driveskull Posted March 6, 2014 Author Share Posted March 6, 2014 Any ideas ? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 6, 2014 Moderators Share Posted March 6, 2014 Driveskull,Please do not bump your own threads within 24 hours. Remember that this is not a 24/7 support forum - those who answer are only here because they like helping others and have some time to spare. Although the problem might be urgent to you, it is not to anyone else. You just have to wait until someone who knows something about your particular problem, and is willing to help, comes online. Be patient and someone will answer eventually. 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: 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...
Driveskull Posted March 7, 2014 Author Share Posted March 7, 2014 Daily bump Link to comment Share on other sites More sharing options...
Driveskull Posted March 7, 2014 Author Share Posted March 7, 2014 Daily bump Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted March 8, 2014 Moderators Share Posted March 8, 2014 What part of Melba's warning not to bump more than once a day escaped you? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Bert Posted March 8, 2014 Share Posted March 8, 2014 Please provide a screenshot of what you see on your screen so we can see what you are dealing with. No shot of one item, but THE ENTIRE SCREEN. This is easily done by using the ctrl key and pressing print screen. This copies what is on your screen to the clipboard. You then paste it to paint and save it. Now with that saved file upload it here so we can see what you are dealing with. We do not need another worded post explaining your problem we need to SEE what you want. Got it? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 8, 2014 Moderators Share Posted March 8, 2014 Driveskull,Pretty short days where you are - how about sticking to the standard 24hr one that everyone else uses. And I echo MBALZESHARI's comment - please let us see a screenshot. 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: 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...
Driveskull Posted March 8, 2014 Author Share Posted March 8, 2014 http://imgur.com/X4KvR1n So as you can see , alot of the same images . First i need to right click one of them ( which is snipped into image folder of the script ) then click left button on the new 2 images . But as there are alot of the same images when i put the code above its just going from image to image not clicking it Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 8, 2014 Moderators Share Posted March 8, 2014 Driveskull,And what is the purpose of all this? Why do you need to click these images? 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: 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...
Driveskull Posted March 8, 2014 Author Share Posted March 8, 2014 I am learning how image search works , when there are alot of different images there are no problems, but when images are the same imageserach not performing functions i want . I want to learn how to make it work , but till now i dont have any ideas . Link to comment Share on other sites More sharing options...
Bert Posted March 8, 2014 Share Posted March 8, 2014 And once you gain this knowledge, what do you plan to do with it? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Driveskull Posted March 8, 2014 Author Share Posted March 8, 2014 Use it for reference for future work , repair the script above , use it for sprite copying automate it so it dont take so much time to gather graphic for some custom build flash pages ? I dont know why you are so suspicious i dont break any rules with asking for help with my problem yes ? Link to comment Share on other sites More sharing options...
Bert Posted March 9, 2014 Share Posted March 9, 2014 We are suspicious for what you are asking for is (just about EVERY TIME) is for gaming. Seeing how you want to use this for Photoshop that would have been easier if you had just said that from the start. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Driveskull Posted March 9, 2014 Author Share Posted March 9, 2014 (edited) Its only graphic and sprite related no games involwed. So anyone have idea why its bugs when looking for one from alot of duplicates ? Edited March 9, 2014 by Driveskull Link to comment Share on other sites More sharing options...
Bert Posted March 9, 2014 Share Posted March 9, 2014 what is the image type? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Driveskull Posted March 9, 2014 Author Share Posted March 9, 2014 png , but the same occurs when using bmp ones . Link to comment Share on other sites More sharing options...
Driveskull Posted March 9, 2014 Author Share Posted March 9, 2014 (edited) expandcollapse popupinclude <ImageSearch.au3> #include <File.au3> #include <Misc.au3> AdlibRegister("_MyExitFunc", 35000) ;40sec HotKeySet("{ESC}", "Terminate") ;Creates an Array with all the file names in your image folder Dim $imageList = _FileListToArray(@WorkingDir & "\Images1") ;Change name to folder that holds your images. Dim $imageList = _FileListToArray(@WorkingDir & "\Images2") ;--------- Dim $imageName Dim $imageX Dim $imageY Dim $imageCount While 1 $image = $imageList $image = _ImageSearchArea(@WorkingDir & "\Images1\" & $image ,1, 0, 150, @DesktopWidth, @DesktopHeight, $imageX, $imageY, 0) = 1 If $image=1 Then MouseMove($imageX, $imageY, 0) MouseClick("Right") sleep(50) $image1=0 EndIf $image = _ImageSearchArea(@WorkingDir & "\Images2\" & $image ,1, 0, 150, @DesktopWidth, @DesktopHeight, $imageX, $imageY, 0) = 1 If $image=1 Then MouseMove($imageX, $imageY, 0) MouseClick("Left") sleep(50) $image1=0 EndIf WEnd Func Terminate() Exit EndFunc Func _MyExitFunc() Exit ;Terminate the script EndFunc Tried another script , but if i put $imagelist[1] it uses only first image in the folder , how to make it it will look for all the items and duplicates ? Edited March 9, 2014 by Driveskull Link to comment Share on other sites More sharing options...
Recommended Posts