Random run times

General Macro Scheduler discussion

Moderators: JRL, Dorian (MJT support)

Post Reply
monarols
Newbie
Posts: 6
Joined: Mon Nov 17, 2003 8:11 am

Random run times

Post by monarols » Mon Nov 17, 2003 8:25 am

Hello there. I am new to MS, and am very impressed with the program. I am using the demo version at the moment.

I have a couple of questions about the program. Firstly, when you are setting up the macro to run at every * minutes, is there a way to to set the macro to run at random times, like say between 1 min and say 10 mins? (eg, the macro will run at 3.30pm, 3.32pm 3.35pm, 3.39pm 3.40pm etc) instaed of a fixed every * minutes.

I would also like to see the option in the log file of just recording when it started and when it stopped, without all the script in the middle (To make the .txt file size a lot smaller :-))

I have had a gander thru the help file and could not see if the above questions could be answered.

I am very happy with this software, and if the 2 issues above could be resolved, or included in a future release, I would be more than happy to buy this product!

Thanks for your time....Chris Johnson

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Mon Nov 17, 2003 9:05 am

Hi,

You would have to build the random start time into the script as there is no option in the standard scheduling settings. You could have the script run on startup and have it loop with a random wait time, or have it set to run so many minutes and have a random check to see if it should run.

The former would look something like:

Label>start
Random>9,interval
Let>interval=interval+1
Let>interval=interval*60
Wait>interval
..
.. your script code here
..
Goto>start

So this would wait anywhere from 1 to 10 minutes before the next iteration. It would have to be set to run all the time.

The alternative method would avoid it having to run all the time. Schedule it to run every minute for example and see if the minutes portion of the time matches the randomly produced value:

Minutes>mm
Random>58,rndmm
Let>rndmm=rndmm+1
If>mm=rndmm,start,end
Label>start
..
.. your code here
..
Label>end

You could schedule this to run at a repeating interval of whatever value of minutes you prefer, but the bigger the interval the less the chance it will run.

Regarding your second question about logging. If you just want to log when the macro started and when it stopped simply do this in your macro:

Timestamp>c:\mypath\mylogfile.txt,Macro MyMacro Started
..
.. your code here
..
Timestamp>c:\mypath\mylogfile.txt,Macro MyMacro Finished

Hope this helps ...
MJT Net Support
[email protected]

monarols
Newbie
Posts: 6
Joined: Mon Nov 17, 2003 8:11 am

Post by monarols » Mon Nov 17, 2003 12:43 pm

Thankyou so much for your detailed and prompt reply!

Sadly, I find writing and understanding the script quite complicated, and have only been using the program using the standard scheduling, which I find easy to understand.

I can edit the script written by the recorder (eg alter the mouse cursor position) but would be unsure as where to place the script you furnished.

Could I post a 48 line script here which I currently use with the fixed run time here so you may be able to show me how the info u furnished fits in to it to make it random run as above, or perhaps email the script to support?

Many thanks, Chris Johnson

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Mon Nov 17, 2003 12:48 pm

Just copy the recorded script and place it where I put "..your code here'

Replace:

..
.. your code here
..

with your recorded code. Copy and paste will do the job just fine.

Alternatively copy the lines above that section to the top of your script and the lines below to the end of your script.
MJT Net Support
[email protected]

monarols
Newbie
Posts: 6
Joined: Mon Nov 17, 2003 8:11 am

Post by monarols » Mon Nov 17, 2003 1:00 pm

Ok, thanks so much for that. I will give it a bash and see what happens :D

Warmest regards, Chris Johnson

monarols
Newbie
Posts: 6
Joined: Mon Nov 17, 2003 8:11 am

Post by monarols » Mon Nov 17, 2003 1:30 pm

Mmmm, I copied the recorded script into the area you suggested and ran the script, but it just keeps repeating over and over again with no interval. May have to look at something else here as obviously I have done it wrong somehow :roll:

Regards Chris Johnson

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Mon Nov 17, 2003 1:57 pm

Which bit did you use. I might have made a mistake - I didn't check it. Paste your script in here and I'll work out what is wrong.
MJT Net Support
[email protected]

monarols
Newbie
Posts: 6
Joined: Mon Nov 17, 2003 8:11 am

Post by monarols » Mon Nov 17, 2003 9:33 pm

Thanks for helping out here. The script is as below:

Label>start
Random>9,interval
Let>interval=interval+1
Let>interval=interval*60
Wait>interval
// D:\Program Files\MJT Net Ltd\Macro Scheduler\SONY.scp
// Recorded on Friday, October 31, 2003, at 11:57 AM
//Recorded Events
Let>WW_TIMEOUT=5
CapsOn
MouseMove>72,775
WaitWindowOpen>Sweep! V1.71 by Paul P.M. Beuger
MoveWindow>Sweep! V1.71 by Paul P.M. Beuger,0,0
ResizeWindow>Sweep! V1.71 by Paul P.M. Beuger,350,906
Wait>0.52
LClick
LClick
Wait>0.22
LDown
WaitWindowOpen>SonyStyle Australia - Icenet Internet Services
MoveWindow>SonyStyle Australia - Icenet Internet Services,323,0
ResizeWindow>SonyStyle Australia - Icenet Internet Services,960,974
WaitWindowOpen>Sweep! V1.71 by Paul P.M. Beuger
MoveWindow>Sweep! V1.71 by Paul P.M. Beuger,0,0
ResizeWindow>Sweep! V1.71 by Paul P.M. Beuger,350,906
Wait>0.12
LUp
WaitWindowOpen>SonyStyle Australia - Icenet Internet Services
MoveWindow>SonyStyle Australia - Icenet Internet Services,323,0
ResizeWindow>SonyStyle Australia - Icenet Internet Services,960,974
WaitWindowOpen>AutoFill - RoboForm
MoveWindow>AutoFill - RoboForm,1086,131
ResizeWindow>AutoFill - RoboForm,171,492
WaitWindowOpen>ninemsn - Icenet Internet Services
MoveWindow>ninemsn - Icenet Internet Services,323,0
ResizeWindow>ninemsn - Icenet Internet Services,960,974
Wait>0.01
MouseMove>1129,179
WaitWindowOpen>AutoFill - RoboForm
MoveWindow>AutoFill - RoboForm,1086,131
ResizeWindow>AutoFill - RoboForm,171,492
Wait>0.28
LClick
Wait>0.12
MouseMove>1212,580
Wait>2.06
LClick
WaitWindowOpen>ninemsn - Icenet Internet Services
MoveWindow>ninemsn - Icenet Internet Services,323,0
ResizeWindow>ninemsn - Icenet Internet Services,960,974
Wait>7.34
Goto>start


The inserted recording runs fine if I select a fixed schedule (eg, run every 5 mins) but need to vary it to run at random intervals between say 1 and 10 mins

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Mon Nov 17, 2003 10:18 pm

Hi,

The script is fine. With this method you now need to start the script and leave it running. You can set it to run on startup if you like with advanced schedule settings. Leave it running and it will loop, waiting between 1 and 10 minutes before each iteration.
MJT Net Support
[email protected]

monarols
Newbie
Posts: 6
Joined: Mon Nov 17, 2003 8:11 am

Post by monarols » Tue Nov 18, 2003 11:07 am

Many thanks for your time spent with my questions! That script is working ok now :D

If I wanted to make the interval between 1 and 5 mins, I guess I would need to change part of the script below?:

Random>9,interval
Let>interval=interval+1
Let>interval=interval*60

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Tue Nov 18, 2003 11:13 am

Hi,

Yes, change the Random> line to:

Random>4,interval
MJT Net Support
[email protected]

G-u-e-s-t

Post by G-u-e-s-t » Sat Apr 10, 2004 6:07 pm

Hi,
I would like to know how I can have the random time in seconds not minutes. For example between 2 and 7 seconds :?:
Thanks

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Mon Apr 12, 2004 7:56 pm

Just remove the *60. The script is already waiting a number of seconds. The wait command waits a specified number of seconds. Since the original request was to delay a number of minutes we multiplied the number by 60 to get the number of seconds to wait (60 seconds is 1 minute).
MJT Net Support
[email protected]

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