SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   SHIII Mods Workshop (https://www.subsim.com/radioroom/forumdisplay.php?f=195)
-   -   [REL] SH3 Long Patrol Script! (https://www.subsim.com/radioroom/showthread.php?t=193794)

Rubini 03-26-12 04:22 PM

[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! :DL). 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 :DL ) 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

reaper7 03-26-12 05:50 PM

Quote:

Originally Posted by Rubini (Post 1861178)
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 :salute:

Rubini 03-26-12 06:14 PM

Quote:

Originally Posted by reaper7 (Post 1861211)
Download and it works perfectly so far, very nice addition to Sh3 :salute:

Thanks reaper7!:up:

Rubini 03-26-12 06:25 PM

Uhhh...just noticed that this version is showing a window with all the variables used by the script.
This was just for debug purposes.:damn:
Already reuploaded a version without this (v1.0a).
Sorry!:D

reaper7 03-26-12 06:31 PM

Quote:

Originally Posted by Rubini (Post 1861220)
Uhhh...just noticed that this version is showing a window with all the variables used by the script.
This was just for debug purposes.:damn:
Already reuploaded a version without this (v1.0a).
Sorry!:D

:haha: was wondering what I was meant to do with them :O:

Rubini 03-26-12 06:36 PM

Quote:

Originally Posted by reaper7 (Post 1861222)
:haha: was wondering what I was meant to do with them :O:

LOL!:rotfl2:
Let me know if some more odd things happens!:88)

Madox58 03-26-12 07:55 PM

Nice work Mate.
:salute:

You really didn't need to credit me though.
:)

Rubini 03-26-12 09:25 PM

Quote:

Originally Posted by privateer (Post 1861256)
Nice work Mate.
:salute:

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.:up:

Magic1111 03-27-12 04:03 AM

Hi Rubini!

Two questions please:D:

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

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

Best regards,
Magic

Rubini 03-27-12 11:51 AM

Quote:

Originally Posted by Magic1111 (Post 1861385)
Hi Rubini!

Two questions please:D:

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

2.) Does your Script work in connection with SH3-Commander and how? :hmmm: 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.:up:

Wolfstriked 03-27-12 12:47 PM

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.

LGN1 03-27-12 03:43 PM

Hi Rubini,

I've tested the script. Works very well. Very nice work :up: 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 :hmmm:

Regards, LGN1

vienna 03-27-12 05:35 PM

Quote:

2. Not a problem, this is also optional on the ini, then lunch the script first.:up:
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... :D

...

Rubini 03-27-12 09:34 PM

Quote:

Originally Posted by Wolfstriked (Post 1861597)
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...:03:

Rubini 03-27-12 09:44 PM

Quote:

Originally Posted by LGN1 (Post 1861672)
Hi Rubini,

I've tested the script. Works very well. Very nice work :up: 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 :hmmm:

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.:up:


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

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Đ 1995- 2024 Subsim®
"Subsim" is a registered trademark, all rights reserved.