Good morning from England.
I am trying to produce a bit of code based on using a variable for positioning the mouse.
So, every 70 pixels or so, I want to left-click and select something from a dropdown list, save it as a print screen, bounce back to the original position, then select the next thing which is 70 pixels further down, save it as a print screen, bounce back to the original position, and so on, until I reach the bottom of the list.
The first thing I want to select is approximately 1277 pixels from the top of the screen. So, the second thing will be (1277+70) pixels, the third thing (1277+140) pixels...
For now, I am not too bothered about the print screen. I just want to get it selecting things in the way my mind is envisaging.
I came up with this:
Label>cycle
Let>orig=1277
Let>multi=0
Let>prod=70*multi
Let>total=orig+prod
MouseMove>2000,orig
LClick
Wait>2
MouseMove>2000,total
LClick
Wait>2
MouseMove>2000,orig
LClick
Wait>2
Let>multi=multi+1
If multi<5
Wait>1
Goto>cycle
Endif
So, the first thing should be 1277 + (70*0) pixels from the top of the screen, the second 1277 + (70*1) pixels, etc.
But the mouse does not move down. It just stays at 1277 pixels, cycling over the same thing time and time again.
Where am I going wrong, please?
Mouse movement based on a variable - where am I going wrong?
Moderators: Dorian (MJT support), JRL
- Grovkillen
- Automation Wizard
- Posts: 1131
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: Mouse movement based on a variable - where am I going wrong?
You're setting Let>multi=0 in the beginning of each iteration. Move it above the label>cycle.