ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

AleaPause

(1/3) > >>

Contro:

The idea is simple.

Delay the execution of a loop or Do While with an aleatory time in a range.
So I think i need an ini file to control the minimum time and the maximum time.
By example.
I have to do the next task in the range (1/2 hour to 1 hour)
In the ini file : 30, 60 minutes or any other accorded configuration.
The script don't liberate or allows the next step in my script until the time is passed.
I will insert the AleaPause script in my script to control aleatory times in a predefined range of time.
When the first task is done, enter AleaPause, then when finished the second task and so on while the loop ... do while .... enddo is acting.


Is this possible ?
 :-*

4wd:
Sleep.cmd

Hardcoded:

--- Code: Text ---REM Generate random number between 30 and 60set /a num=%RANDOM% * (%%60 - %%30 + 1) / 32768 + %%30 REM Multiply by 60 for minutesset /a delay = %num% * 60 REM Wait (timeout is a Win 7+ command)timeout %delay%

The non hardcoded version:

--- Code: Text ---REM Generate random number between first and second argumentREM Second argument > first argumentset /a num=%RANDOM% * (%2 - %1 + 1) / 32768 + %1 REM Multiply by 60 for minutesset /a delay = %num% * 60 REM Wait (timeout is a Win 7+ command)timeout %delay%
Sleep.cmd 30 60

Contro:
Sleep.cmd

Hardcoded:

--- Code: Text ---REM Generate random number between 30 and 60set /a num=%random% %%60 +30 REM Multiply by 60 for minutesset /a delay = %num% * 60 REM Wait (timeout is a Win 7+ command)timeout %delay%

The non hardcoded version:

--- Code: Text ---REM Generate random number between first and second argumentREM Second argument > first argumentset /a num=%random% %%%2 +%1 REM Multiply by 60 for minutesset /a delay = %num% * 60 REM Wait (timeout is a Win 7+ command)timeout %delay%
Sleep.cmd 30 60
-4wd (January 06, 2014, 06:55 PM)
--- End quote ---


but where is the ini file ?
 :-[

I can understand almost in the batch language. I'll try executing. It's the best.

Best Regards
 :-*

Contro:
One consideration.
I will run this script in a virtual machine under windows xp pro
And perhaps under windows 7 someday.
The hard code option offer the console with the counting. I would like something more interactive.
I have to edit the cmd file to vary the arguments.
 :P

Contro:
something fails.
Begin with 4860 seconds. More than 1 hour.
The target was between 1/2 hour and 1 hour.
 :-[

Navigation

[0] Message Index

[#] Next page

Go to full version