Script to repeat x time

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
dutaun
Newbie
Posts: 2
Joined: Sun Jul 10, 2011 6:44 am

Script to repeat x time

Post by dutaun » Sun Jul 10, 2011 10:07 am

Hi All,

First of all sorry for the terms used in this post, I am not the greatest scripter.

What I am trying to do is have a dialog input to repeat an action x amount of times. I have tried looking through the forums for hours!!! but I am either blind or stupid or both. Below is the code that I am trying to repeat.

Any assistance would be greatly appreciated.

Code: Select all

MouseMove>251,191
LDown
Wait>0.09
LUp
Wait>7.36
MouseMove>217,184
LDown
Wait>0.09
LUp
Wait>2.61
MouseMove>217,184
wait>1
MouseMove>251,191
LDown
Wait>0.09
LUp 
ps. oh and if the code looks old, this is because my work is using Version 6 of Macro scheduler on the most part.

Okapi
Junior Coder
Posts: 28
Joined: Wed Dec 29, 2010 1:22 am

Post by Okapi » Sun Jul 10, 2011 11:41 am

Hi dutaun,
Put this code between "Repeat ... Until" command :

Code: Select all

Let>k=0
Repeat>k
MouseMove>251,191
LDown
Wait>0.09
LUp
Wait>7.36
MouseMove>217,184
LDown
Wait>0.09
LUp
Wait>2.61
MouseMove>217,184
wait>1
MouseMove>251,191
LDown
Wait>0.09
LUp
Let>k=k+1
Until>k,x
k is a counter. x is the number of times you want to repeat the code.

dutaun
Newbie
Posts: 2
Joined: Sun Jul 10, 2011 6:44 am

Post by dutaun » Wed Jul 13, 2011 1:43 am

Hi Okapi,

Thanks for the code improvement!

But alas as my company is using MSched Ver 6.0 the repeat function is not working, is there another way to do this?

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed Jul 13, 2011 2:49 am

I think this will work under v6

Code: Select all

Let>k=0
Label>Repeat
MouseMove>251,191
LDown
Wait>0.09
LUp
Wait>7.36
MouseMove>217,184
LDown
Wait>0.09
LUp
Wait>2.61
MouseMove>217,184
wait>1
MouseMove>251,191
LDown
Wait>0.09
LUp
Let>k=k+1
If>k<x,Repeat

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts