Forum Index
SUBSIM Forum Search

The Web's #1 BBS for all submarine and naval simulations!
[ SUBSIM Review ] [ SUBSIM STORE ]
Current Forum | Archives 2002-2003 |

Batch File Question

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Forum Index -> SH3 Mods Workshop
View previous topic :: View next topic  
Author Message
iambecomelife



Joined: 11 Apr 2005
Posts: 1047

PostPosted: Fri Aug 05, 2005 10:21 pm    Post subject: Batch File Question Reply with quote

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
View user's profile Send private message Send e-mail
Gizzmoe



Joined: 22 Mar 2005
Posts: 3011
Location: Düsseldorf, Germany

PostPosted: Fri Aug 05, 2005 11:39 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
iambecomelife



Joined: 11 Apr 2005
Posts: 1047

PostPosted: Fri Aug 05, 2005 11:55 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Gizzmoe



Joined: 22 Mar 2005
Posts: 3011
Location: Düsseldorf, Germany

PostPosted: Sat Aug 06, 2005 12:00 am    Post subject: Reply with quote

Yes, :loop is first, then your commands and finally ping and "goto loop".
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
iambecomelife



Joined: 11 Apr 2005
Posts: 1047

PostPosted: Sat Aug 06, 2005 6:45 pm    Post subject: Reply with quote

OK; I tried it and it worked like a charm. Thanks a lot Thumbs Up
Back to top
View user's profile Send private message Send e-mail
Laffertytig



Joined: 01 Feb 2003
Posts: 219

PostPosted: Sat Aug 06, 2005 6:50 pm    Post subject: Reply with quote

will this run ok with rub1.3 and ops mod which is due very soon?
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Forum Index -> SH3 Mods Workshop All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group