Jump to content

Strobe Lights Mod using Autohotkey


Jetfire
 Share

Recommended Posts

hi all,

 

I don't know if you ever saw Autohotkey before, but I love it. It lets you program endless macros with your keyboard, mouse and joysticks, and it's very dynamic. So, Diveplane, Ruggbutt and a few others mentioned it would be nice to have the Strobe Lights mod working, and I made this Autohotkey script months back, just to test, so I thought I would share my findings.

 

First you will need to download and install:

http://www.autohotkey.com/download/AutoHotkeyInstall.exe

and check out http://www.autohotkey.com/ if you're interested. No I don't have anything to do with the development of Autohotkey, but I have to say I've been looking for software like this for years and I think it's frickin awesome!!! ;)

 

Second, you will need to make a file called Lights.ahk and place this code inside:

blockKeyEntry = 0 ; DON'T TOUCH, used to block so we only have 1 thread at a time


; HERE IS WHERE YOU MAKE CHANGES
lightsKey = F6  ; <-- the key that turns on the external lights in LO
key = 0        ; <-- the key that will toggle strobe lights
$0::             ; <-- change 0 if you changed key to something besides 0
; HERE IS WHERE YOU ARE DONE MAKING CHANGES  
 ToggleStrobeLights( blockKeyEntry, key, lightsKey )
return

;=========================================================================
; DON'T GO ANY FURTHER UNLESS YOU KNOW WHAT YOU'RE DOING         
;=========================================================================

#SingleInstance force

 Menu, Tray, Tip, LockOn Strobe Lights
 DetectHiddenWindows, On
 
return

;=========================================================================

PressLightsKey( lightsKey )
{
 Send, {%lightsKey% down}
 Sleep, 50
 Send, {%lightsKey% up}
}

;=========================================================================

LightsOn( key, lightsKey )
{
 ; wait for the key to come up
 state = 0
 Loop 
 {
   GetKeyState, keyState, %key%, P
   if keyState = U
     Break
 } 
 Loop
 {
   GetKeyState, keyState, %key%, P
   if keyState = D
     Break
         
   if state < 4
     PressLightsKey( lightsKey )
    
   if state = 11
     state = 0    
   else
     state += 1
   
   Sleep, 50  
   
 } 
 if ( state = 1 || state = 3 )
   PressLightsKey( lightsKey )
}

ToggleStrobeLights( ByRef blockKeyEntry, key, lightsKey )
{
 if ( blockKeyEntry = 0 && WinExist( "LOCK ON" ) )
 {
   blockKeyEntry = 1
   LightsOn( key, lightsKey )
   blockKeyEntry = 0
 }
}

 

OR download the file: http://www.fileshack.us/files/591/lights.zip.

After you make the lights.ahk file, double click on the lights.ahk file and you should get an H icon in your system try indicating the script is active. Start Lock On, change your Onboard Lights key to F6, then start a mission. The 0 key (zero) will toggle the strobes off or on. To turn off the script, right click on the H icon in the system tray in windows, and click Exit.

 

Also, check out some of the documentation on Autohotkey if you like or would like to make macros for your keyboard, mouse, joystick or joystick axes. It's great!

  • Like 1
sig36aa.jpg
Link to comment
Share on other sites

Cool! Jetfire works this light mod again with 1.12a?

 

Regards

Best Regards

Viper

sigpic3353_7.gif

System: Intel Core i7-4790, 3,6GHz, 16GB RAM, 128GB SSD, 2TB HDD, NVIDIA GeForce GTX 960 2GB GDDR5,

TM HOTAS Warthog;(MSFFB2 for testing); TrackIR4 +Track Clip Pro; Windows 10 Pro.

Link to comment
Share on other sites

  • 4 weeks later...

Hi!

 

Alternative:

 

http://www.vmh59.hu/download/download.php?fname=./Addons/Aircraft_Strobe_Lights.zip

 

It's upgrade of Jetfire mod (already working with 1.12a and simple strobe added like at the real russian planes). Important! If you would like to see an edited track, you need to remove this addon before, because the different camera views will no pan out.

 

Have a nice day!

Two tails, two engines!

 

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...