| View previous topic :: View next topic |
| Author |
Message |
iambecomelife
Joined: 11 Apr 2005 Posts: 1047
|
Posted: Fri Aug 05, 2005 10:21 pm Post subject: Batch File Question |
|
|
I have successfully tested a batch file that improves the tonnage variations for merchant ships. I liked the other tonnage randomizers that had been developed earlier but I was bothered by the problem of all ships for a particular month still being the same tonnage. In reality, merchants of roughly similar dimensions could vary dramatically in terms of weight. My mod is a batch file that can implement changes to ships' tonnage the instant it is run; consequently, two ships from the same broad class will now differ in weight by hundreds or thousands of tons, and over the course of a single mission you can encounter these dramatic variations.
The only problem is that it is necessary to alt-tab out of the game to run the file. Is there any way to use a task scheduler or something similar to get the batch file to run constantly in the background? |
|
| Back to top |
|
 |
Gizzmoe
Joined: 22 Mar 2005 Posts: 3011 Location: Düsseldorf, Germany
|
Posted: Fri Aug 05, 2005 11:39 pm Post subject: |
|
|
You can use PING to emulate a sleep/wait command. This gives you a 60 second delay:
PING 1.1.1.1 -n 1 -w 60000 >nul
So your batch file would look something like this:
:loop
copy <whatever>
ping 1.1.1.1 -n 1 -w 60000 >nul
goto loop |
|
| Back to top |
|
 |
iambecomelife
Joined: 11 Apr 2005 Posts: 1047
|
Posted: Fri Aug 05, 2005 11:55 pm Post subject: |
|
|
| Gizzmoe wrote: | You can use PING to emulate a sleep/wait command. This gives you a 60 second delay:
PING 1.1.1.1 -n 1 -w 60000 >nul
So your batch file would look something like this:
:loop
copy <whatever>
ping 1.1.1.1 -n 1 -w 60000 >nul
goto loop |
Thanks for the response.
So where in the batch file do these lines go? Is it:
:loop (first)
the copying command lines (second)
and
ping 1.1.1.1 -n 1 -w 60000 >nul
goto loop
at the end? |
|
| Back to top |
|
 |
Gizzmoe
Joined: 22 Mar 2005 Posts: 3011 Location: Düsseldorf, Germany
|
Posted: Sat Aug 06, 2005 12:00 am Post subject: |
|
|
| Yes, :loop is first, then your commands and finally ping and "goto loop". |
|
| Back to top |
|
 |
iambecomelife
Joined: 11 Apr 2005 Posts: 1047
|
Posted: Sat Aug 06, 2005 6:45 pm Post subject: |
|
|
OK; I tried it and it worked like a charm. Thanks a lot  |
|
| Back to top |
|
 |
Laffertytig
Joined: 01 Feb 2003 Posts: 219
|
Posted: Sat Aug 06, 2005 6:50 pm Post subject: |
|
|
| will this run ok with rub1.3 and ops mod which is due very soon? |
|
| Back to top |
|
 |
|