SUBSIM Radio Room Forums


SUBSIM: The Web's #1 BBS for all submarine and naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SHIII Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 03-26-2012, 05:22 PM   #1
Rubini
Ocean Warrior
 
Join Date: May 2005
Location: São Paulo Brazil
Posts: 2,754
Downloads: 126
Uploads: 0
Default [REL] SH3 Long Patrol Script!

Quote:
Updated 07/05/2012 V1.1
SH3_LongPatrol_Script v1.1 by Rubini

Changelog v1.1:
- few script refinements
- added return to previous script boat speed (ahead standard or ahead slow) after unpause.
- adjusted the image search frequency (the script will be much more smart to detect images now)
- fixed enemy image recon detection (.bmp and coord.); task forces will now be detected too.
- added TC control on the fly! (not more needed to adjust it on the .ini)
- added keyboard key behaviour press (pause game&script or only script) on the fly!
- added new image recon for fog sighted (16x) (for H.sie&Stiebler´s mod users)
- added player configurable image recon for any GUI, adjustable on .ini file!
- added submerged and surfaced time length factors adjustables by player on .ini (LGN1 requestion)
- adjusted the actions time length (they are almost the same now for any TC)
- added player configurable dive time for shallow or deep hydro checks on .ini and on the fly (J0313 suggestion)

All these new features are explained on the .ini

To the new configurable image recon feature work you need to replace the four .bmp with yours own (GUI related) and adjust the coordenates on .ini (resolution related). For WideScreen basic GUI users it will work out of the box, no work needed.

Please, let me know any issue or suggestion about this script.
Good hunting!
Rubini.
==================================================
Basic key commands for the script v1.1:
(Note that the script will work out of the box without any adjust, just left it with default values if you want to).

Pause/Break=> pause/unpause the script (the same as old version)
Alt+Pause/Break=> reset script (the same as old version)
Crt+Alt+Pause/Break=> exit app (the same as old version)

Advanced key commands for the script v1.1:
(All these commands works on the fly, I mean, with the game and script running, not need to pause or go out of the game or from scrip).

Alt+1=> force TC=128 (game&script)
Alt+2=> force TC=256 (game&script)
Alt+5=> force TC=512 (game&script)
Alt+0=> force TC=1024 (game&script)

Alt+7=> force hydrocheck depth to ~25m
Alt+8=> force hydrocheck depth to ~50m
Alt+9=> force hydrocheck depth to ~75m

Alt+k=> toggle between "any command key press will pause the game&script" or "only will pause the script"

Alt+x=> snorkel up/down with sound

=====================================
=====================================
Original readme
SP 26/03/2012
SH3_LongPatrol_Script v1.0a by Rubini
(dropped v1.0 because it was showing a debug window for test purposes. But other than this one, its exactly the same)


What is this?

The script executes a sequential chain of crew commands to allow better contact search during long patrol trips. It is not aimed for departure from harbors, for full of actions moments... really, just for long patrols moments. It´s some sort of "macro" but a complex and smart one.

The other goal (perhaps the main goal) is to free you, the player, from that boring long patrol trips in front of your computer...you can now make something more with your RL between actions in Sh3 while your crew performs a smart search! (although I had added some options for the ones that wants to make more routinely duties like hydro checks, etc. See below)


How it was built?

Using AutoHotkey, a freeware powerful computer language for macros, scripts and also for games. Take a look there:http://www.Autohotkey.com


How it works?

The script is compiled in an .exe (virus free!) that also calls for Sh3.exe itself. The script start paused, so you can use (unpause it) at any time (or never! ). You can pause again, reset or even exit it at any time too. It uses "only one" key: PAUSE/BREAK (pause/unpause script), ALT+PAUSE/BREAK (reset script), Crtl+ALT+PAUSE/BREAK (exit app)


What exactly it does?

Script resumed sequence:

1. NavMap

2. Ahead standard

3. TC to 128, 256, 512 or 1024 (player choice on ini)

4. Surface for visual/radar search, for 4 to 8hrs (depends on TimeCompression)

5. Ahead slow

6. Dive to 32 to 70m (depends on TimeCompression)

7. Hydrophone search for 1 to 2hrs (depends on TimeCompression) - The player can do this by yourself adjusting this parameter on the ini file.

8. PD for pre surface check for 30 to 60min (depends on TimeCompression) - The player can do this by yourself adjusting this parameter on the ini file.

9. Loop!

Also you can enable reports during the cycles, like weather, visual and sound contacts, send radio patrol reports, etc. All customizable on ini.

The script also can pause the game and the script automatically when contacts were made, even for distant convoys radio contacts (this last one isn´t allowed on stock game!!!). These are made by image recon, and for now, only works for WideScreen1360x768 using the basic WS GUI. See here: http://www.subsim.com/radioroom/showthread.php?t=166094. So if you don´t use this GUI you can disable this option on ini, the imagerecon will not work at all. (but not really necessary to disable it).

The script adds yet the missing snorkel sound up/down by pressing ALT+x. Note that the sound will be played even if you don´t have snorkel. So use it accordingly. The snorkel sound is on the data\sound and can be edited as you like.

Also a lot others smart (well, a try ) controls and checks, like start the Sh3.exe, check if the game is running, check active window, smart keyboard - script will pause at any key pressing with few exceptions ; some keys are used also by the script like ALT, SHIFT, etc - send beep feedbacks, etc.

The code uses complex programming routines to not interfere with the game performance. I have Win7 64 bits, I52500, GTX560, 8GB ram and the scripts run at back without ANY problem or slowdown.


Installation ?

JSGME ready. The files needs to be in the same directory (except the snorkel sound obviously)


Usage ?

Just double click on the SH3_LongPatrol_Script.exe (or create a shortcut for it on yout desktop). It will start the Sh3 game and the script (you can also start the script and the game alone if you want, see the ini file).

Goes to Sh3 normally and when you are at open sea, plot you route and press PAUSE/BREAK once to start the script (a beep will play). You can be at any position, under or below water, at any speed, at any TC. The script will adjust for its settings and the patrol routine will start.

If you want to do anything in the middle of the script patrol just press the desired key (your own commands_xxx.cfg ones) - a beep will sound - and the script will pause at that point; do what you want (anything). When done, press PAUSE/BREAK again and the script will continue from that point. If you changed to much thing (direction, change deep position, etc) could be a good idea to reset and start the script again (ALT+PAUSE/BREAK, PAUSE/BREAK). Beeps will sound specifically for each script action (pause, reset, etc).

If a contact was achieve the in game TC will drop accordingly yours settings on Main.cfg (it is in the folder where Sh3 save the games/careers, etc). I suggest to adjust the Main.cfg for airplanes, ships and radio contacts to zero or 1 (one if you uses WS GUI). Not really necessary, but fit better the idea to go out for your RL and when return, any contact made by crew will be there waiting you.
This point ahead (a contact made) is up to you. You can go to it or just ignore it pressing again the PAUSE/BREAK once or twice (one beep unpaused, two beeps paused) and go on.

Seems complicated but it is not. It´s easy (only one key), if you made something wrong just reset and restart the script on the fly! Easy as cake.
The option to exit the app (CRTL+ALT+PAUSE/BREAK) isn´t to be used because, again, if you are in doubt/troubles just reset it. It will not start again unless you press PAUSE/BREAK and so on.

I guess that ppl need to play a bit with it to get secure and confident about its use.


Remarks and tips:

1. The ini file settings are auto explicative, pay attention.

2. The script can´t read anything from the game. The contact pauses are made by image recon. I provided them for WS 1360x768 basic users. If you use any other GUI the imagerecon routine pixels address and reference images needs to be redone. It´s easy but you need to have that GUI and I only have my own modded game for now. I can show how to make it if someone is interested.

3. A workaround for the imagerecon is to set yours contacts to zero (pause) on main.cfg file. This will works correctly and very well with the script.

4. Anyway the minimum recommended for SH3 serious game for airplanes, ships and radar contacts is 1 (main.cfg again).

5. The script adds a small icon on the task bar when it is running. When closed, the icon goes out too. Right click it o see some options.

6. Stiebler´s heavy fog warnning, IIRC, drops the TC for 16 and this can mess with the script. I suggest to not use it or we can also ask to Stiebler to allow an option to drop it to 1 or 0 (pause) at once.

7. As a first try, after have the game running just play a bit with that "only one key". Pause, unpause, reset, and exit (if exit needs to alt+ tab and then restart the script again). Press some in game keys to see how the script pauses. And so on. Dont fear, its just a smart macro that has only crew commands. It will not save, delete, load or copy anything.


Credits:

TDW for the initial idea on SH5 and Privateer for suggested the use of 3rd part softers.
That is it!
Hopes that it could be useful for you too.
If you try it, post feedbacks .

Good hunting!
Rubini.
=================================================
Link V1.0a
http://www.mediafire.com/?6v1fa3d0f9ygipi

Link V1.1
http://www.mediafire.com/?gb7x1zuyia72i0n
__________________
One gamer's must-have mod is another gamer's waste of time.
-Sailor Steve

Last edited by Rubini; 05-09-2012 at 10:14 AM.
Rubini is offline   Reply With Quote
Old 03-26-2012, 06:50 PM   #2
reaper7
sim2reality
 
Join Date: Jun 2007
Location: AM 82
Posts: 2,278
Downloads: 254
Uploads: 32
Default

Quote:
Originally Posted by Rubini View Post
That is it!
Hopes that it could be useful for you too.
If you try it, post feedbacks .

Good hunting!
Rubini.
=================================================
Link:
http://www.mediafire.com/?u398ud17f6k5wm5
Download and it works perfectly so far, very nice addition to Sh3
reaper7 is offline   Reply With Quote
Old 03-26-2012, 07:14 PM   #3
Rubini
Ocean Warrior
 
Join Date: May 2005
Location: São Paulo Brazil
Posts: 2,754
Downloads: 126
Uploads: 0
Default

Quote:
Originally Posted by reaper7 View Post
Download and it works perfectly so far, very nice addition to Sh3
Thanks reaper7!
__________________
One gamer's must-have mod is another gamer's waste of time.
-Sailor Steve
Rubini is offline   Reply With Quote
Old 03-26-2012, 07:25 PM   #4
Rubini
Ocean Warrior
 
Join Date: May 2005
Location: São Paulo Brazil
Posts: 2,754
Downloads: 126
Uploads: 0
Default

Uhhh...just noticed that this version is showing a window with all the variables used by the script.
This was just for debug purposes.
Already reuploaded a version without this (v1.0a).
Sorry!
__________________
One gamer's must-have mod is another gamer's waste of time.
-Sailor Steve
Rubini is offline   Reply With Quote
Old 03-26-2012, 07:31 PM   #5
reaper7
sim2reality
 
Join Date: Jun 2007
Location: AM 82
Posts: 2,278
Downloads: 254
Uploads: 32
Default

Quote:
Originally Posted by Rubini View Post
Uhhh...just noticed that this version is showing a window with all the variables used by the script.
This was just for debug purposes.
Already reuploaded a version without this (v1.0a).
Sorry!
was wondering what I was meant to do with them
reaper7 is offline   Reply With Quote
Old 03-26-2012, 07:36 PM   #6
Rubini
Ocean Warrior
 
Join Date: May 2005
Location: São Paulo Brazil
Posts: 2,754
Downloads: 126
Uploads: 0
Default

Quote:
Originally Posted by reaper7 View Post
was wondering what I was meant to do with them
LOL!
Let me know if some more odd things happens!
__________________
One gamer's must-have mod is another gamer's waste of time.
-Sailor Steve
Rubini is offline   Reply With Quote
Old 03-26-2012, 08:55 PM   #7
Madox58
Navy Seal
 
Join Date: Dec 2006
Location: Los Angeles
Posts: 9,578
Downloads: 72
Uploads: 12
Default

Nice work Mate.


You really didn't need to credit me though.
Madox58 is offline   Reply With Quote
Old 03-26-2012, 10:25 PM   #8
Rubini
Ocean Warrior
 
Join Date: May 2005
Location: São Paulo Brazil
Posts: 2,754
Downloads: 126
Uploads: 0
Default

Quote:
Originally Posted by privateer View Post
Nice work Mate.


You really didn't need to credit me though.
But if you didn´t have post replies and insights about that softers i never had start to look at them...and was a nice surprise, i learned a lot, was a revival for me (have had good knowledge on Basic and Cobol - I´m old, ok! - 20-25 years ago.) This was one of the mods that I most liked to do.
__________________
One gamer's must-have mod is another gamer's waste of time.
-Sailor Steve
Rubini is offline   Reply With Quote
Old 03-27-2012, 05:03 AM   #9
Magic1111
Silent Hunter
 
Join Date: Sep 2008
Location: Germany - Sailing on U-552 in North Atlantic
Posts: 4,414
Downloads: 777
Uploads: 0


Default

Hi Rubini!

Two questions please:

1.) Does your Script work with Widescreen MaGUI from here?

2.) Does your Script work in connection with SH3-Commander and how? Because the SH3-Commander .exe starts automatically the SH3.exe.

Best regards,
Magic
Magic1111 is offline   Reply With Quote
Old 03-27-2012, 12:51 PM   #10
Rubini
Ocean Warrior
 
Join Date: May 2005
Location: São Paulo Brazil
Posts: 2,754
Downloads: 126
Uploads: 0
Default

Quote:
Originally Posted by Magic1111 View Post
Hi Rubini!

Two questions please:

1.) Does your Script work with Widescreen MaGUI from here?

2.) Does your Script work in connection with SH3-Commander and how? Because the SH3-Commander .exe starts automatically the SH3.exe.

Best regards,
Magic
1. the script works with any Sh3 installation. Just the imagerecon is GUI specific, but it´s optional on the ini. Use zero on your main.cfg for airplanes, ships and radio contacts for best results.

2. Not a problem, this is also optional on the ini, then launch the script first.
__________________
One gamer's must-have mod is another gamer's waste of time.
-Sailor Steve

Last edited by Rubini; 03-27-2012 at 10:48 PM.
Rubini is offline   Reply With Quote
Old 03-27-2012, 01:47 PM   #11
Wolfstriked
Samurai Navy
 
Join Date: Apr 2011
Posts: 594
Downloads: 159
Uploads: 0
Default

Rubini,genius idea and love that you can set it to pause game when enemy is sighted.Just an issue I am having is sometimes I press pause/break key and nothing happens.Also,I set to flank speed and press P/B and it goes to nav map,TC goes up but it stays at flank speed damaging the engines.
Wolfstriked is offline   Reply With Quote
Old 03-27-2012, 04:43 PM   #12
LGN1
Ace of the Deep
 
Join Date: Mar 2006
Posts: 1,104
Downloads: 143
Uploads: 11
Default

Hi Rubini,

I've tested the script. Works very well. Very nice work Thanks.

Just one small question: Is the snorkel depth command used at any time? I've seen it in the command list, but I don't know when it is used

Regards, LGN1
LGN1 is offline   Reply With Quote
Old 03-27-2012, 06:35 PM   #13
vienna
Navy Seal
 
Join Date: Jun 2005
Posts: 5,120
Downloads: 85
Uploads: 0
Default

Quote:
2. Not a problem, this is also optional on the ini, then lunch the script first.
I've downloaded but have not yet tried the mod. One question: is it required to have lunch or can I skip this part? I've been trying to lose a few pounds...

...
__________________
__________________________________________________ __
vienna is offline   Reply With Quote
Old 03-27-2012, 10:34 PM   #14
Rubini
Ocean Warrior
 
Join Date: May 2005
Location: São Paulo Brazil
Posts: 2,754
Downloads: 126
Uploads: 0
Default

Quote:
Originally Posted by Wolfstriked View Post
Rubini,genius idea and love that you can set it to pause game when enemy is sighted.Just an issue I am having is sometimes I press pause/break key and nothing happens.Also,I set to flank speed and press P/B and it goes to nav map,TC goes up but it stays at flank speed damaging the engines.
I will try to help to clarify how the script sequence works and the best scenario to use it. I guess that these type of replies can be useful for all:

1. You can always use/make the script running in background because in truth It will never start to send key press unless you press the PAUSE/BREAK. So, again, it will not do anything until you press PAUSE/BREAK. And will stop to send things when you press any key, PAUSE/BREAK or reset/exit the script.

2.All the time that you press PAUSE/BREAK the script will toggle pause. If UNPAUSE is sent, then it will do these things (it do more things when you play PAUSE/BREAK, it will do different things when PAUSE, but these are what matters here for UNPAUSED state):

Go NavMAP, <== Here your second reply, edited: Wolfstiked!
Return to couse,
TC=1
TC=Player setting on ini (128/256/512/1024)
Go to main LOOP script

The above is necessary because the PAUSE/BREAK is also used to put the script on the rails again. See, we can´t know what each ppl will do when he pause the script. Then it needs to have a "small" restart all time that ppl unpause it.

Also look that I don´t put the speed ahead standart on the above, so it will continues with your choosed speed until find a spped command inside the script. The main motive is that we have different speeds inside the script (for surfaced and for submerged). But see below what you can do...

3. You always can change speed and plot waypoints with the mouse at any time! Don´t forget this ! In truth you can send any command with the mouse during the script execution, but some will result in strange things...This is why i made the script pause at any key press, but allowed the mouse to be used. I guess that you can get my point.

4. When you alt tab, the script and the game pauses. Just press PAUSE/BREAK and the SH3 will maximize and the script will unpause automatically. Usefull for some situations.

5. If you change the TC with the mouse the script will be messed, as it follow its own time, not the game time. So, both must stay at the "same music". If you want to change in game the TC, pause the script before it.

6. Dont forget: If in trouble, just reset the script (it will be also paused) with ALT+PAUSE/
BREAK

7. The PAUSE/BREAK will be always work (with feedback beep/beeps)...if not, check if the script is really running at background...
__________________
One gamer's must-have mod is another gamer's waste of time.
-Sailor Steve

Last edited by Rubini; 03-27-2012 at 10:49 PM.
Rubini is offline   Reply With Quote
Old 03-27-2012, 10:44 PM   #15
Rubini
Ocean Warrior
 
Join Date: May 2005
Location: São Paulo Brazil
Posts: 2,754
Downloads: 126
Uploads: 0
Default

Quote:
Originally Posted by LGN1 View Post
Hi Rubini,

I've tested the script. Works very well. Very nice work Thanks.

Just one small question: Is the snorkel depth command used at any time? I've seen it in the command list, but I don't know when it is used

Regards, LGN1
No, it is not. I put there on the ini a bit more commands than I used. Also note that if you follow the directions on the ini file you can add any command or variables (options) on the ini. I made this way for future updates, new scripts, etc. The routine that i made to read the ini is too powerfull, we can have a million of options/commands there that the script will understand and will be ready to use them.
__________________
One gamer's must-have mod is another gamer's waste of time.
-Sailor Steve

Last edited by Rubini; 03-28-2012 at 04:34 PM.
Rubini is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 01:04 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © 1997- 2017 Subsim