• Blitz Shadow Player
  • Caius
  • redboot
  • Rules
  • Chain of Command
  • Members
  • Supported Ladders & Games
  • Downloads


Hot Key Assignment?
11-22-2012, 05:26 AM,
#11
RE: Hot Key Assignment?
76mm, I know exactly what you mean.

I went through AutoHotkey tutorial and used basic examples. Unfortunately, my knowledge is currently far less to answer you this question. Method I used is recommended for toolbar buttons activation. To actually go deeper through command menu is something I don’t know how to achieve (if possible at all). I would really have to go thoroughly through scripting methods to find the possibilities. Nevertheless, I will try to search this answer.

My main obstacle is lack of time to do so: daytime job and family to feed. Big Grin
Send this user an email
Quote this message in a reply
11-22-2012, 05:50 AM,
#12
RE: Hot Key Assignment?
Attached is the ZIP archive and inside is PzC.exe file. Extract this file and place it wherever you like: your desktop, create some separate folder etc.

This EXE file is actually compiled AutoHotkey script. In this way you don’t have to download or install any other component from AutoHotkey. I tested this script end execution with success under: Win XP, Win 7 and Win 8.

To run it just do usual mouse double-click. Once started it will place icon in a tray, in this way you will know script is active.

[Image: 6781adcfc9trayicons.png]

I tested this script on all PzC titles (with latest updates applied) except: El Alamein ’42, Moscow ’41 and Sea Lion ’40.

Once active together with PzC game it will add and activate following hotkeys:

Ctrl+F - toggle Fixed Units
Ctrl+S - toggle Spotted Units
Ctrl+U - toggle Used Movement Points
Ctrl+D - toggle Disrupted or Broken Units
Ctrl+L - toggle Low Ammo or Fuel
Ctrl+T - highlight Travel Mode

To stop script from running, right-click tray icon and choose EXIT or use Ctrl+Q hotkeys for same effect.

[Image: 2831ddc171trayicons_exit.png]

As stated before, this script is not perfect in any sense. It will malfunction if toolbar is not positioned in a top row. This is due to the method used within script and my lack of real deep knowledge of AutoHotkey scripting language. Somebody more experienced and versatile with AutoHotkey could probably do it far more better.

Additional bonus: although conceived mainly for use with PzC titles, this script is also compatible with WWI: France ’14. Helmet Smile

Unfortunately, it is incompatible with Napoleonic Battles series. This requires separate script due to the different toolbar buttons arrangement in NB GUI.

Have fun!


Attached Files
.zip   Red_Star.zip (Size: 379.69 KB / Downloads: 11)
Send this user an email
Quote this message in a reply
11-22-2012, 06:34 AM,
#13
RE: Hot Key Assignment?
Attached is the ZIP archive and inside is PzC.ahk file.

AHK is the extension used for AutoHotkey script files. This is a source code file for previously posted compiled AutoHotkey script. When script file is compiled it can be executed on operating system autonomously from developing environment.

Basically, script files are just plain text; therefore this AHK file can be opened, read and edited with Notepad or some similar text editor.

I post this for sole purpose if anybody is interested to see what this script looks like from inside.


Attached Files
.zip   PzC.zip (Size: 648 bytes / Downloads: 10)
Send this user an email
Quote this message in a reply
11-22-2012, 07:06 PM,
#14
RE: Hot Key Assignment?
Vsadek, will this script work if our screen resolution is different from yours?
Quote this message in a reply
11-22-2012, 10:23 PM,
#15
RE: Hot Key Assignment?
76mm, script will function properly as long as this toolbar is positioned in top row, as in screenshot.

[Image: 67310ed04dtop_row_position.png]

If toolbar is repositioned in a second row, the toolbar buttons coordinates are changed and therefore script will not function properly.

[Image: 37f0520803second_row_position.png]

This situation can happen on monitors if lower resolutions are applied or if you manually resize game window in such manner. I use 17” and 19” monitors from 1280x1024 up to 1600x900 and do not have this issue. I presume some players could have.
Send this user an email
Quote this message in a reply
11-22-2012, 10:45 PM,
#16
RE: Hot Key Assignment?
It just seems like even if all of the buttons are on one row, their coordinates would also change if the resolution is different, although maybe I'm confused?

I will try to look at this program this weekend if I have some time, it sounds interesting, especially if it could be used with menu items.
Quote this message in a reply
11-22-2012, 11:36 PM,
#17
RE: Hot Key Assignment?
Button coordinates used (X, Y) are “In Active Window” values; when I tried different resolutions they didn’t change. Hopefully, it will work for you as well. Let me know is it any good when you try it.

Regards
Send this user an email
Quote this message in a reply
11-25-2012, 04:28 AM, (This post was last modified: 11-25-2012, 04:32 AM by 76mm.)
#18
RE: Hot Key Assignment?
Vsadek, hi, your scripts worked great, and I found that it was very easy to add hotkeys for menu items as well--I've added the second set of hotkey commands below (note that my script retains your hotkeys, although I switched one from Ctrl-U to Ctrl-M).
**********************
Ctrl+F - Highlight Fixed Units
Ctrl+S - Highlight Spotted Units
Ctrl+M - Highlight Units Which Used Movement Points
Ctrl+D - Highlight Disrupted or Broken Units
Ctrl+L - Highlight Low Ammo or Fuel
Ctrl+T - Highlight Travel Mode

Ctrl+U - To Top of Stack
Ctrl+B - To Bottom of Stack
Ctrl+C - Combine/Breakdown
Ctrl+R - Recon Spotting
Ctrl+G - Go On Foot
Ctrl+P - Toggle Patrolling
Ctrl+W - View Weather
*****************

Thanks for mentioning AutoHotKey, it was super-easy to use, and these hotkeys should make playing PzC a much easier affair. I've attached the script file but for some reason it would not let me upload an ahk file, so before using it the file suffix should be changed from txt to ahk.


Attached Files
.txt   PzCv2.txt (Size: 1.52 KB / Downloads: 57)
Quote this message in a reply
11-25-2012, 08:34 AM,
#19
RE: Hot Key Assignment?
76mm this is great news! Smile

I see you found the way to actually go through menu items using Send. I should have use this method as well, instead of Click, to avoid messing up with coordinates.

When you have the time, check this guys too: AutoIT

They even have the free editor with syntax coloring and folding points options.
Send this user an email
Quote this message in a reply
11-25-2012, 08:50 AM,
#20
RE: Hot Key Assignment?
True, it might be easier/better if all of the macros work the same way, via the menus. Basically you hit Alt+first letter of menu item to open the menu, and then the first letter of the subitem to select it (if there are multiple subitems starting with the same letter, just press it as many times as necessary).
Quote this message in a reply


Forum Jump:


Users browsing this thread: 1 Guest(s)