AutoHotKey script : visually scan asteroids for minerals remotely

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

User avatar
Submarine
Posts: 562
Joined: Thu, 11. Nov 04, 22:25
x4

AutoHotKey script : visually scan asteroids for minerals remotely

Post by Submarine »

This is a very simple script which can be used with AutoHotKey to perform a series of repetitive operations when viewing asteroids remotely and trying to spot minerals in the early game.

It actuates default keys automatically to focus view on a selected object, zoom out, raise the angle of inspection, rotate clockwise one full rotation, lower the angle of inspection, rotate clockwise one full rotation, then the script stops and the operator can continue as usual. Also one can add key presses while the script is active.

In this way it allows viewing of the entire surface of any object without excessive key presses.

To operate press CTRL + [NUMPAD * ] when a target asteroid has been selected (for continuous use [page down} between uses will usually achieve a change in target to a new asteroid). The script allows you to stop it using CTRL+[NUMPAD 0 ] but if the last instruction was a key down operation that key will continue firing and you need to press it manually once to issue the key up order and stop it. This is usually either NUMPAD 4 or 2, but could in theory be NUMPAD - or 8.

Executive Summary.
Target an object.
start = CTRL + [NUMPAD * ]
interrupt = CTRL+[NUMPAD 0 ] followed by any one of NUMPAD 4 / 2 / 8 / -
to repeat press [Pg Dn] or use mouse to change target followed by Ctrl + [NUMPAD * ] again

Code: Select all

^NumpadMult::
setkeydelay, 5, 50
send, {F3}{F3}{Numpad5}
send, {NumpadSub down} 
sleep, 650 
send, {NumpadSub up}
send, {Numpad8 down} 
sleep, 600 
send, {Numpad8 up}
send, {Numpad4 down} 
sleep, 6000 
send, {Numpad4 up}
send, {Numpad2 down} 
sleep, 1600 
send, {Numpad2 up}
send, {Numpad4 down} 
sleep, 6000 
send, {Numpad4 up}
^Numpad0::Reload
exit
More on AutoHotKey here.
https://www.autohotkey.com/docs_1.0/commands/Send.htm
bloop

Return to “X4: Foundations - Scripts and Modding”