Jump to content
Sign in to follow this  
Driveskull

Alot of the same images , only 1 need to be clicked .

Recommended Posts

Driveskull

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

Share this post


Link to post
Share on other sites
JLogan3o13

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.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Driveskull

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 

Share this post


Link to post
Share on other sites
Melba23

Driveskull,

Please do not bump your own threads within 24 hours. :naughty:

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

 

Share this post


Link to post
Share on other sites
JLogan3o13

What part of Melba's warning not to bump more than once a day escaped you?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Bert

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?

Share this post


Link to post
Share on other sites
Melba23

Driveskull,

Pretty short days where you are - how about sticking to the standard 24hr one that everyone else uses. :naughty:

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

 

Share this post


Link to post
Share on other sites
Driveskull

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 

Share this post


Link to post
Share on other sites
Melba23

Driveskull,

And what is the purpose of all this? Why do you need to click these images? :huh:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
Driveskull

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 . 

Share this post


Link to post
Share on other sites
Driveskull

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 ? 

Share this post


Link to post
Share on other sites
Driveskull

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 by Driveskull

Share this post


Link to post
Share on other sites
Driveskull

png , but the same occurs when using bmp ones . 

Share this post


Link to post
Share on other sites
Driveskull

include <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 by Driveskull

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×