Hi Guy's,
Been absent for a bit, but hoping you can help me.
I have a website I am needing to automate part of the screen using image capture and then clicking on said location.
The screen looks like this
I am needing to find all the Hyphens (Dashes). I am using an exact match to put them into an Array. I am then needing to step through the Array clicking on the location of the dash. Note I am using a screen capture to limit the search location as such there is the MouseMove>{%DashXArr_0%+767},{%DashYArr_0%+402} command but I am stuck trying to workout out how to step through the array getting each position and being able to mouse move to that location. I think I am having a brain fart in my old age, please help.
[snippet=]//Find and Left Click Center of
FindImagePos>%BMP_DIR%\image_10.bmp,%TEMP_DIR%\screenrect.bmp,0.7,1,DashXArr,DashYArr,DashNumFound,EXACT
If>NumFound>0
MouseMove>{%DashXArr_0%+767},{%DashYArr_0%+402}
LClick
Wait>0.5
EndIf
Endif[/snippet]
Stepping Through An Array
Moderators: Dorian (MJT support), JRL
- CyberCitizen
- Automation Wizard
- Posts: 723
- Joined: Sun Jun 20, 2004 7:06 am
- Location: Adelaide, South Australia
Stepping Through An Array
FIREFIGHTER
Re: Stepping Through An Array
Hi Cy.
Welcome back!
I don't have time to test but this should be close and you'll understand the concept.
Welcome back!
I don't have time to test but this should be close and you'll understand the concept.
Code: Select all
//Find and Left Click Center of
FindImagePos>%BMP_DIR%\image_10.bmp,%TEMP_DIR%\screenrect.bmp,0.7,1,DashXArr,DashYArr,DashNumFound,EXACT
If>NumFound>0
Let>kk=-1
Repeat>kk
Add>kk,1
Let>XMove=DashXArr_%kk%
Let>YMove=DashYArr_%kk%
MouseMove>{%XMove%+767},{%YMove%+402}
LClick
Wait>0.5
Until>kk={%DashNumFound%-1}
EndIf
- CyberCitizen
- Automation Wizard
- Posts: 723
- Joined: Sun Jun 20, 2004 7:06 am
- Location: Adelaide, South Australia
Re: Stepping Through An Array
Thanks JRL,
Got it working successfully now, turns out I was a little rusty in my MS Coding. Once I stopped and thought about it overnight it came back to me.
Got it working successfully now, turns out I was a little rusty in my MS Coding. Once I stopped and thought about it overnight it came back to me.
FIREFIGHTER