Cockpit use: automation, checks, settings, instructions...

I would like to share the following video, which shows the AutoHotkey script I have written for using my cockpit, including different automations and checks. Maybe you can get some ideas from it. I run it before I launch Assetto Corsa. Actually I run Assetto Corsa (Content Manager) with another script, which defines the functions of my button box and does a lot of other things which I could explain in another thread.

As you can see, the script checks the presence of all the USB devices connected in my cockpit. If none of them (or any in particular) is not detected or any unwanted device is found, an error message is displayed. It not only detects gaming devices, but also other devices such as the fans controllers, the mouse, the VR headset and the motion platform. For this the script calls USBDeview, a tool that can work with commands and that lets you identify all the USB devices with unique references. Joyids is also run in the background to be sure the gaming devices are set in the right order.

The script also perform a sound test of the different shakers on my cockpit (again just to be sure the hardware the connections are fine) and then launches all the necessary programs (SimuCUBE, SimDash, SimHub, Simtools...), most of them hidden or minimized. One of these programs is XOutput, a simulator of a virtual Xbox 360 pad, whic I use to be able to run the virtual desktop from the Oculus client without grabbing the Oculus controllers.

When I finish my driving, I run the script again, in which case it closes all the programs and leaves everything as before, for instance, setting the audio playback to my speakers (using Nircmd for this).

I have also included an icon which opens a help document with a series of steps for the correct use of my cockpit. I try to always follow these steps in the right order. That makes things easier. For instance, put on your gloves before the VR headset, never seat on your bucket if you have not put the harness outside of the seat, or always remember to put the headset on the cockpit tray before seating and fastening your harness. Obviously, I know all this by heart now, but my cousins do not :)

01 - PLACE THE HARNESS OUTSIDE OF THE SEAT
02 - PUT ON THE BOOTS (OPTIONAL)
03 - PLUG THE POWER CABLE INTO THE COCKPIT CONNECTOR (REAR RIGHT)
04 - PLUG THE USB CABLE AND THE 2 AUDIO CABLES INTO THE COCKPIT CONNECTORS (RIGHT)
05 - RUN THE COCKPIT SCRIPT (DESKTOP) AND WAIT FOR IT TO FINISH
06 - CLEAN THE HEADSET LENSES (IF NECESSARY)
07 - PLACE THE HEADSET ON THE COCKPIT TRAY
08 - SIT IN THE BUCKET SEAT
09 - FASTEN THE HARNESS
10 - PUT ON THE GLOVES
11 - PUT ON THE HEADSET WITHOUT TIGHTENING
12 - PUT ON THE HEADPHONES AND PLUG THEM INTO THE HEADSET
13 - TIGHTEN THE HEADSET
14 - PRESS THE RED BUTTON, LOOK AT THE MONITOR ICON (OCULUS TRAY) AND PRESS IT AGAIN
15 - RUN THE ASSETTO CORSA SCRIPT (DESKTOP)
16 - CHOOSE CAR, TRACK AND MODE
17 - PRESS THE RED BUTTON TO START

Sorry for the quality of the video, but I have no idea how to record my screen to a video file.

 
Last edited:
Awesome work! Are you willing to share your script?
Sure. Of course you will have to adapt it to your settings. It's script made for my specific setup and settings.
Code:
#SingleInstance, force
#persistent
Menu, Tray, Tip, Cockpit

space = y+5
Gui, +ToolWindow -Caption +alwaysontop +lastfound
Gui, font, s12 w600
Gui, Color, 2f2c36
Gui, add, picture,x0 y0, c:\Scripts\Cockpit\guiback.png
Gui, Add, Text, x65 y15 w400 cffffff vtitle, ELAPHE'S RACING COCKPIT LAUNCHER
Gui, font, s10 w600
Gui, Add, Text, w400 x18 y65 c00ff99 vconfig,
Gui, Add, Text, w400 x18 y65 c00ff99 vdevices,
Gui, Add, Text, w400 x18 y65 c00ff99 vclosing,
Gui, Add, Text, w450 %space% cffffff vsimucube,
Gui, Add, Text, w450 %space% cffffff vpedals,
Gui, Add, Text, w450 %space% cffffff vshifter,
Gui, Add, Text, w450 %space% cffffff vhandbrake,
Gui, Add, Text, w450 %space% cffffff vbutton1,
Gui, Add, Text, w450 %space% cffffff vbutton2,
Gui, Add, Text, w450 %space% cffffff,
Gui, Add, Text, w450 %space% cffffff vother c00ff99,
Gui, Add, Text, w450 %space% cffffff vmouse,
Gui, Add, Text, w450 %space% cffffff vfan1,
Gui, Add, Text, w450 %space% cffffff vfan2,
Gui, Add, Text, w450 %space% cffffff,
Gui, Add, Text, w450 %space% cffffff voculus c00ff99,
Gui, Add, Text, w450 %space% cffffff voculusf,
Gui, Add, Text, w450 %space% cffffff,
Gui, Add, Text, w450 %space% cffffff vnjmotion c00ff99,
Gui, Add, Text, w450 %space% cffffff vnjmotionf,
Gui, Add, Text, w450 %space% cffffff,
Gui, Add, Text, w450 %space% c00ff99 vshakers,
Gui, Add, Text, w450 %space% cffffff cffffff vshakerst,
Gui, Add, Text, w450 %space% cffffff,
Gui, Add, Text, w450 %space% cffffff vprograms c00ff99,
Gui, Add, Text, w450 %space% cffffff vxoutput,
Gui, Add, Text, w450 %space% cffffff vsimhub,
Gui, Add, Text, w450 %space% cffffff vsimucubep,
Gui, Add, Text, w450 %space% cffffff vsimtoolsge,
Gui, Add, Text, w450 %space% cffffff vsimtoolsgm,
Gui, Add, Text, w450 %space% cffffff vsimdash,
Gui, Add, Text, w450 %space% cffffff voculuscl,
Gui, Add, Text, w450 %space% cffffff,
Gui, Add, Text, w450 %space% cffffff vfinished,
Gui, Add, Picture, x426 y7 vhelp ghelp, help.png

GuiControl +BackgroundTrans, title
Gui, Show, x40 y40 w460 h97, Cockpit

ifwinexist, ahk_exe SimuCUBE Configuration Tool.exe
{
sleep 250
GuiControl,, closing, CLOSING PROGRAMS...
winclose, ahk_exe OculusClient.exe
process, close, SimHubWPF.exe
winclose, SimuCUBE Configuration Tool
runwait, %comspec% /c taskkill /IM SimDash.exe /F ,,hide
winclose, ahk_exe SimTools_GameEngine.exe
winclose, ahk_exe SimTools_GameManager.exe
ifwinexist, XOutput
winclose, XOutput
run, C:\NirCmd\nircmdc.exe setdefaultsounddevice "SONY TV"
sleep 500
run, C:\NirCmd\nircmdc.exe setdefaultsounddevice "RX-V375"
sleep 1800
filedelete, C:\XOutput\XOutput.log
filedelete, c:\USBDeview\cockpitdevices.txt
Gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
run, C:\NirCmd\nircmdc.exe mutesysvolume 0
run, C:\NirCmd\nircmdc.exe setsysvolume 65535
exitapp
}

sleep 250
GuiControl,, config, ANALYZING SYSTEM...

SetWorkingDir, c:\USBDeview
runwait, %comspec% /c c:\USBDeview\usbdeview.exe /DisplayDisconnected 0 /stext >c:\USBDeview\cockpitdevices.txt,,hide
sleep 1600
fileread, cockpitdevices, cockpitdevices.txt
SetWorkingDir %A_ScriptDir%

GuiControl,, config,
sleep 300
GuiControl,, devices, DETECTING GAMING DEVICES...
sleep 400

if cockpitdevices not contains USB\VID_16D0&PID_0D5A\0123456789,USB\VID_30B7&PID_1001\SP24148F065BB1727F,USB\VID_1DD2&PID_22B6\B72110
{
Gui, Font, cffbc00
GuiControl, Font, simucube
Gui, Show, x40 y40 w457 h118, Cockpit
GuiControl,, simucube, ERROR: Devices not found (check power and USB cables)
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}

if cockpitdevices contains USB\VID_045E&PID_028E\0AA839E,USB\VID_0925&PID_0005\7&30bbaa6&0&3
{
Gui, Font, cffbc00
GuiControl, Font, simucube
Gui, Show, x40 y40 w460 h118, Cockpit
GuiControl,, simucube, ERROR: unplug other gaming devices
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}

if cockpitdevices contains USB\VID_16D0&PID_0D5A\0123456789
{
Gui, Show, x40 y40 w460 h118, Cockpit
GuiControl,, simucube, SimuCUBE
sleep 200
}
else
{
Gui, Font, cffbc00
GuiControl, Font, simucube
Gui, Show, x40 y40 w460 h118, Cockpit
GuiControl,, simucube, ERROR: Simucube not found
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}

if cockpitdevices contains USB\VID_30B7&PID_1001\SP24148F065BB1727F
{
Gui, Show, x40 y40 w460 h139, Cockpit
GuiControl,, pedals, Heusinkveld Sprint Pedals
sleep 200
}
else
{
Gui, Font, cffbc00
GuiControl, Font, pedals
Gui, Show, x40 y40 w460 h139, Cockpit
GuiControl,, pedals, ERROR: Heusinkveld Sprint Pedals not found
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}

if cockpitdevices contains USB\VID_1DD2&PID_22B6\B72110
{
Gui, Show, x40 y40 w460 h160, Cockpit
GuiControl,, shifter, Pro-Sim Lite V2 Sequential Shifter
sleep 200
}
else
{
Gui, Font, cffbc00
GuiControl, Font, shifter
Gui, Show, x40 y40 w460 h160, Cockpit
GuiControl,, shifter, ERROR: Pro-Sim Lite V2 Sequential Shifter not found
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}

if cockpitdevices contains USB\VID_10C4&PID_8B82\SH2017030050
{
Gui, Show, x40 y40 w460 h181, Cockpit
GuiControl,, handbrake, Heusinkveld Handbrake
sleep 200
}
else
{
Gui, Font, cffbc00
GuiControl, Font, handbrake
Gui, Show, x40 y40 w460 h181, Cockpit
GuiControl,, handbrake, ERROR: Heusinkveld Handbrake not found
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}

if cockpitdevices contains USB\VID_16C0&PID_05E1\6&33c17457&0&1
{
Gui, Show, x40 y40 w460 h202, Cockpit
GuiControl,, button1, Button box 1
sleep 200
}
else
{
Gui, Font, cffbc00
GuiControl, Font, button1
Gui, Show, x40 y40 w460 h202, Cockpit
GuiControl,, button1, ERROR: Button box 1 not found
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}

if cockpitdevices contains USB\VID_0079&PID_0006\7&bfe832a&0&1
{
Gui, Show, x40 y40 w460 h223, Cockpit
GuiControl,, button2, Button box 2
sleep 200
}
else
{
Gui, Font, cffbc00
GuiControl, Font, button2
Gui, Show, x40 y40 w460 h223, Cockpit
GuiControl,, button2, ERROR: Button box 2 not found
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}

run, C:\NirCmd\nircmdc.exe mutesysvolume 1
SetWorkingDir, c:\JoyIDs\
runwait, %comspec% /c c:\JoyIDs\JoyIDs.exe Cockpit.jid,,hide
SetWorkingDir %A_ScriptDir%

Gui, Show, x40 y40 w460 h265, Cockpit
GuiControl,, other, DETECTING OTHER DEVICES...
sleep 400
run, C:\NirCmd\nircmdc.exe mutesysvolume 0

if cockpitdevices contains USB\VID_0458&PID_0036\7&1eb833cf&0&2
{
Gui, Show, x40 y40 w460 h286, Cockpit
GuiControl,, mouse, Mouse
sleep 700
}
else
{
Gui, Font, cffbc00
Gui, Show, x40 y40 w460 h286, Cockpit
GuiControl, Font, mouse
GuiControl,, mouse, ERROR: Mouse not found
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}

if cockpitdevices contains USB\VID_04D8&PID_9AAB\001
{
Gui, Show, x40 y40 w460 h307, Cockpit
GuiControl,, fan1, Fan controller 1
sleep 700
}
else
{
Gui, Font, cffbc00
Gui, Show, x40 y40 w460 h307, Cockpit
GuiControl, Font, fan1
GuiControl,, fan1, Fan controller 1 not found
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}


if cockpitdevices contains USB\VID_04D8&PID_9AAB\144
{
Gui, Show, x40 y40 w460 h328, Cockpit
GuiControl,, fan2, Fan controller 2
sleep 700
}
else
{
Gui, Font, cffbc00
Gui, Show, x40 y40 w460 h328, Cockpit
GuiControl, Font, fan2
GuiControl,, fan2, Fan controller 2 not found
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}


Gui, Show, x40 y40 w460 h370, Cockpit
GuiControl,, oculus, DETECTING VR HEADSET...
sleep 400
if cockpitdevices contains USB\VID_2833&PID_2052\MSFT201WMGH5205P9364
{
Gui, Show, x40 y40 w460 h391, Cockpit
GuiControl,, oculusf, Oculus Rift S
sleep 700
}
else
{
Gui, Font, cffbc00
Gui, Show, x40 y40 w460 h391, Cockpit
GuiControl, Font, oculusf
GuiControl,, oculusf, ERROR: Oculus Rift S not found
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}

Gui, Show, x40 y40 w460 h433, Cockpit
GuiControl,, njmotion, DETECTING MOTION PLATFORM...
sleep 400
if cockpitdevices contains USB\VID_2341&PID_0042\75932313738351E08222
{
Gui, Show, x40 y40 w460 h454, Cockpit
GuiControl,, njmotionf, NjMotion Compact-R
sleep 700
}
else
{
Gui, Font, cffbc00
GuiControl, Font, njmotionf
Gui, Show, x40 y40 w460 h454, Cockpit
GuiControl,, njmotionf, ERROR: NjMotion Compact-R not found
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}

run, C:\NirCmd\nircmdc.exe setdefaultsounddevice "Altavoces"
Gui, Show, x40 y40 w460 h496, Cockpit
GuiControl,, shakers, SHAKERS SOUND TEST
sleep 400
soundplay, c:\scripts\cockpit\shake3.wav
Gui, Show, x40 y40 w460 h517, Cockpit
GuiControl,, shakerst, Left
sleep 1070
GuiControl,, shakerst, Right
sleep 1070
GuiControl,, shakerst, Pedals
sleep 1070
GuiControl,, shakerst, .....
sleep 600

filecopy, c:\scripts\Cockpit\Settings-normal.xml, C:\Users\Elaphe\AppData\Local\SimDash\Settings.xml,1

run, C:\NirCmd\nircmdc.exe mutesysvolume 1
Gui, Show, x40 y40 w460 h559, Cockpit
GuiControl,, programs, LAUNCHING PROGRAMS...
sleep 400
Gui, Show, x40 y40 w460 h580, Cockpit
GuiControl,, xoutput, XOutput (XBOX pad emulator)
run, C:\XOutput\XOutput.lnk
sleep 400
Gui, Show, x40 y40 w460 h601, Cockpit
GuiControl,, simhub, SimHub (shakers)
run, C:\SimHub\SimHubWPF.lnk
sleep 400
Gui, Show, x40 y40 w460 h622, Cockpit
GuiControl,, simucubep, SimuCUBE (steering wheel)
run, C:\SimuCUBE\SimuCUBE.lnk
sleep 400
Gui, Show, x40 y40 w460 h643, Cockpit
GuiControl,, simtoolsge, SimTools Game Engine (NjMotion Compact-R)
run, C:\SimTools\SimTools_GameEngine.exe,min
sleep 400
Gui, Show, x40 y40 w460 h664, Cockpit
GuiControl,, simtoolsgm, SimTools Game Manager (NjMotion Compact-R)
run, C:\SimTools\SimTools_GameManager.exe,min
sleep 400
run, C:\SimDash\SimDash.lnk,hide
Gui, Show, x40 y40 w460 h685, Cockpit
GuiControl,, simdash, SimDash (fans)
sleep 400
Gui, Show, x40 y40 w460 h706, Cockpit
GuiControl,, oculuscl, Oculus client (VR)
run, C:\Program Files\Oculus\Support\oculus-client\OculusClient.exe
run, C:\NirCmd\nircmdc.exe mutesysvolume 0
run, C:\NirCmd\nircmdc.exe setsysvolume 65535

sleep 1200
Gui, Font, c00ff99
Gui, Show, x40 y40 w460 h748, Cockpit
GuiControl, Font, finished
GuiControl,, finished, FINISHED

sleep 3000
Gui, destroy

sleep 4500
winminimize, Oculus ahk_class Chrome_WidgetWin_1
run, C:\NirCmd\nircmdc.exe setdefaultsounddevice "Auriculares"
sleep 600
SoundBeep, 1000, 1000
sleep 600
filedelete, c:\USBDeview\cockpitdevices.txt

exitapp

help::
ifwinexist, Instructions ahk_class AutoHotkeyGUI
{
winclose, Instructions ahk_class AutoHotkeyGUI
return
}
else
{
run, C:\Scripts\Cockpit\Instructions.ahk
return
}
 
Sure. Of course you will have to adapt it to your settings. It's script made for my specific setup and settings.
Code:
#SingleInstance, force
#persistent
Menu, Tray, Tip, Cockpit

space = y+5
Gui, +ToolWindow -Caption +alwaysontop +lastfound
Gui, font, s12 w600
Gui, Color, 2f2c36
Gui, add, picture,x0 y0, c:\Scripts\Cockpit\guiback.png
Gui, Add, Text, x65 y15 w400 cffffff vtitle, ELAPHE'S RACING COCKPIT LAUNCHER
Gui, font, s10 w600
Gui, Add, Text, w400 x18 y65 c00ff99 vconfig,
Gui, Add, Text, w400 x18 y65 c00ff99 vdevices,
Gui, Add, Text, w400 x18 y65 c00ff99 vclosing,
Gui, Add, Text, w450 %space% cffffff vsimucube,
Gui, Add, Text, w450 %space% cffffff vpedals,
Gui, Add, Text, w450 %space% cffffff vshifter,
Gui, Add, Text, w450 %space% cffffff vhandbrake,
Gui, Add, Text, w450 %space% cffffff vbutton1,
Gui, Add, Text, w450 %space% cffffff vbutton2,
Gui, Add, Text, w450 %space% cffffff,
Gui, Add, Text, w450 %space% cffffff vother c00ff99,
Gui, Add, Text, w450 %space% cffffff vmouse,
Gui, Add, Text, w450 %space% cffffff vfan1,
Gui, Add, Text, w450 %space% cffffff vfan2,
Gui, Add, Text, w450 %space% cffffff,
Gui, Add, Text, w450 %space% cffffff voculus c00ff99,
Gui, Add, Text, w450 %space% cffffff voculusf,
Gui, Add, Text, w450 %space% cffffff,
Gui, Add, Text, w450 %space% cffffff vnjmotion c00ff99,
Gui, Add, Text, w450 %space% cffffff vnjmotionf,
Gui, Add, Text, w450 %space% cffffff,
Gui, Add, Text, w450 %space% c00ff99 vshakers,
Gui, Add, Text, w450 %space% cffffff cffffff vshakerst,
Gui, Add, Text, w450 %space% cffffff,
Gui, Add, Text, w450 %space% cffffff vprograms c00ff99,
Gui, Add, Text, w450 %space% cffffff vxoutput,
Gui, Add, Text, w450 %space% cffffff vsimhub,
Gui, Add, Text, w450 %space% cffffff vsimucubep,
Gui, Add, Text, w450 %space% cffffff vsimtoolsge,
Gui, Add, Text, w450 %space% cffffff vsimtoolsgm,
Gui, Add, Text, w450 %space% cffffff vsimdash,
Gui, Add, Text, w450 %space% cffffff voculuscl,
Gui, Add, Text, w450 %space% cffffff,
Gui, Add, Text, w450 %space% cffffff vfinished,
Gui, Add, Picture, x426 y7 vhelp ghelp, help.png

GuiControl +BackgroundTrans, title
Gui, Show, x40 y40 w460 h97, Cockpit

ifwinexist, ahk_exe SimuCUBE Configuration Tool.exe
{
sleep 250
GuiControl,, closing, CLOSING PROGRAMS...
winclose, ahk_exe OculusClient.exe
process, close, SimHubWPF.exe
winclose, SimuCUBE Configuration Tool
runwait, %comspec% /c taskkill /IM SimDash.exe /F ,,hide
winclose, ahk_exe SimTools_GameEngine.exe
winclose, ahk_exe SimTools_GameManager.exe
ifwinexist, XOutput
winclose, XOutput
run, C:\NirCmd\nircmdc.exe setdefaultsounddevice "SONY TV"
sleep 500
run, C:\NirCmd\nircmdc.exe setdefaultsounddevice "RX-V375"
sleep 1800
filedelete, C:\XOutput\XOutput.log
filedelete, c:\USBDeview\cockpitdevices.txt
Gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
run, C:\NirCmd\nircmdc.exe mutesysvolume 0
run, C:\NirCmd\nircmdc.exe setsysvolume 65535
exitapp
}

sleep 250
GuiControl,, config, ANALYZING SYSTEM...

SetWorkingDir, c:\USBDeview
runwait, %comspec% /c c:\USBDeview\usbdeview.exe /DisplayDisconnected 0 /stext >c:\USBDeview\cockpitdevices.txt,,hide
sleep 1600
fileread, cockpitdevices, cockpitdevices.txt
SetWorkingDir %A_ScriptDir%

GuiControl,, config,
sleep 300
GuiControl,, devices, DETECTING GAMING DEVICES...
sleep 400

if cockpitdevices not contains USB\VID_16D0&PID_0D5A\0123456789,USB\VID_30B7&PID_1001\SP24148F065BB1727F,USB\VID_1DD2&PID_22B6\B72110
{
Gui, Font, cffbc00
GuiControl, Font, simucube
Gui, Show, x40 y40 w457 h118, Cockpit
GuiControl,, simucube, ERROR: Devices not found (check power and USB cables)
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}

if cockpitdevices contains USB\VID_045E&PID_028E\0AA839E,USB\VID_0925&PID_0005\7&30bbaa6&0&3
{
Gui, Font, cffbc00
GuiControl, Font, simucube
Gui, Show, x40 y40 w460 h118, Cockpit
GuiControl,, simucube, ERROR: unplug other gaming devices
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}

if cockpitdevices contains USB\VID_16D0&PID_0D5A\0123456789
{
Gui, Show, x40 y40 w460 h118, Cockpit
GuiControl,, simucube, SimuCUBE
sleep 200
}
else
{
Gui, Font, cffbc00
GuiControl, Font, simucube
Gui, Show, x40 y40 w460 h118, Cockpit
GuiControl,, simucube, ERROR: Simucube not found
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}

if cockpitdevices contains USB\VID_30B7&PID_1001\SP24148F065BB1727F
{
Gui, Show, x40 y40 w460 h139, Cockpit
GuiControl,, pedals, Heusinkveld Sprint Pedals
sleep 200
}
else
{
Gui, Font, cffbc00
GuiControl, Font, pedals
Gui, Show, x40 y40 w460 h139, Cockpit
GuiControl,, pedals, ERROR: Heusinkveld Sprint Pedals not found
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}

if cockpitdevices contains USB\VID_1DD2&PID_22B6\B72110
{
Gui, Show, x40 y40 w460 h160, Cockpit
GuiControl,, shifter, Pro-Sim Lite V2 Sequential Shifter
sleep 200
}
else
{
Gui, Font, cffbc00
GuiControl, Font, shifter
Gui, Show, x40 y40 w460 h160, Cockpit
GuiControl,, shifter, ERROR: Pro-Sim Lite V2 Sequential Shifter not found
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}

if cockpitdevices contains USB\VID_10C4&PID_8B82\SH2017030050
{
Gui, Show, x40 y40 w460 h181, Cockpit
GuiControl,, handbrake, Heusinkveld Handbrake
sleep 200
}
else
{
Gui, Font, cffbc00
GuiControl, Font, handbrake
Gui, Show, x40 y40 w460 h181, Cockpit
GuiControl,, handbrake, ERROR: Heusinkveld Handbrake not found
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}

if cockpitdevices contains USB\VID_16C0&PID_05E1\6&33c17457&0&1
{
Gui, Show, x40 y40 w460 h202, Cockpit
GuiControl,, button1, Button box 1
sleep 200
}
else
{
Gui, Font, cffbc00
GuiControl, Font, button1
Gui, Show, x40 y40 w460 h202, Cockpit
GuiControl,, button1, ERROR: Button box 1 not found
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}

if cockpitdevices contains USB\VID_0079&PID_0006\7&bfe832a&0&1
{
Gui, Show, x40 y40 w460 h223, Cockpit
GuiControl,, button2, Button box 2
sleep 200
}
else
{
Gui, Font, cffbc00
GuiControl, Font, button2
Gui, Show, x40 y40 w460 h223, Cockpit
GuiControl,, button2, ERROR: Button box 2 not found
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}

run, C:\NirCmd\nircmdc.exe mutesysvolume 1
SetWorkingDir, c:\JoyIDs\
runwait, %comspec% /c c:\JoyIDs\JoyIDs.exe Cockpit.jid,,hide
SetWorkingDir %A_ScriptDir%

Gui, Show, x40 y40 w460 h265, Cockpit
GuiControl,, other, DETECTING OTHER DEVICES...
sleep 400
run, C:\NirCmd\nircmdc.exe mutesysvolume 0

if cockpitdevices contains USB\VID_0458&PID_0036\7&1eb833cf&0&2
{
Gui, Show, x40 y40 w460 h286, Cockpit
GuiControl,, mouse, Mouse
sleep 700
}
else
{
Gui, Font, cffbc00
Gui, Show, x40 y40 w460 h286, Cockpit
GuiControl, Font, mouse
GuiControl,, mouse, ERROR: Mouse not found
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}

if cockpitdevices contains USB\VID_04D8&PID_9AAB\001
{
Gui, Show, x40 y40 w460 h307, Cockpit
GuiControl,, fan1, Fan controller 1
sleep 700
}
else
{
Gui, Font, cffbc00
Gui, Show, x40 y40 w460 h307, Cockpit
GuiControl, Font, fan1
GuiControl,, fan1, Fan controller 1 not found
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}


if cockpitdevices contains USB\VID_04D8&PID_9AAB\144
{
Gui, Show, x40 y40 w460 h328, Cockpit
GuiControl,, fan2, Fan controller 2
sleep 700
}
else
{
Gui, Font, cffbc00
Gui, Show, x40 y40 w460 h328, Cockpit
GuiControl, Font, fan2
GuiControl,, fan2, Fan controller 2 not found
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}


Gui, Show, x40 y40 w460 h370, Cockpit
GuiControl,, oculus, DETECTING VR HEADSET...
sleep 400
if cockpitdevices contains USB\VID_2833&PID_2052\MSFT201WMGH5205P9364
{
Gui, Show, x40 y40 w460 h391, Cockpit
GuiControl,, oculusf, Oculus Rift S
sleep 700
}
else
{
Gui, Font, cffbc00
Gui, Show, x40 y40 w460 h391, Cockpit
GuiControl, Font, oculusf
GuiControl,, oculusf, ERROR: Oculus Rift S not found
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}

Gui, Show, x40 y40 w460 h433, Cockpit
GuiControl,, njmotion, DETECTING MOTION PLATFORM...
sleep 400
if cockpitdevices contains USB\VID_2341&PID_0042\75932313738351E08222
{
Gui, Show, x40 y40 w460 h454, Cockpit
GuiControl,, njmotionf, NjMotion Compact-R
sleep 700
}
else
{
Gui, Font, cffbc00
GuiControl, Font, njmotionf
Gui, Show, x40 y40 w460 h454, Cockpit
GuiControl,, njmotionf, ERROR: NjMotion Compact-R not found
soundplay, c:\Scripts\Cockpit\error.wav
sleep 3500
gui, destroy
filedelete, c:\USBDeview\cockpitdevices.txt
exitapp
}

run, C:\NirCmd\nircmdc.exe setdefaultsounddevice "Altavoces"
Gui, Show, x40 y40 w460 h496, Cockpit
GuiControl,, shakers, SHAKERS SOUND TEST
sleep 400
soundplay, c:\scripts\cockpit\shake3.wav
Gui, Show, x40 y40 w460 h517, Cockpit
GuiControl,, shakerst, Left
sleep 1070
GuiControl,, shakerst, Right
sleep 1070
GuiControl,, shakerst, Pedals
sleep 1070
GuiControl,, shakerst, .....
sleep 600

filecopy, c:\scripts\Cockpit\Settings-normal.xml, C:\Users\Elaphe\AppData\Local\SimDash\Settings.xml,1

run, C:\NirCmd\nircmdc.exe mutesysvolume 1
Gui, Show, x40 y40 w460 h559, Cockpit
GuiControl,, programs, LAUNCHING PROGRAMS...
sleep 400
Gui, Show, x40 y40 w460 h580, Cockpit
GuiControl,, xoutput, XOutput (XBOX pad emulator)
run, C:\XOutput\XOutput.lnk
sleep 400
Gui, Show, x40 y40 w460 h601, Cockpit
GuiControl,, simhub, SimHub (shakers)
run, C:\SimHub\SimHubWPF.lnk
sleep 400
Gui, Show, x40 y40 w460 h622, Cockpit
GuiControl,, simucubep, SimuCUBE (steering wheel)
run, C:\SimuCUBE\SimuCUBE.lnk
sleep 400
Gui, Show, x40 y40 w460 h643, Cockpit
GuiControl,, simtoolsge, SimTools Game Engine (NjMotion Compact-R)
run, C:\SimTools\SimTools_GameEngine.exe,min
sleep 400
Gui, Show, x40 y40 w460 h664, Cockpit
GuiControl,, simtoolsgm, SimTools Game Manager (NjMotion Compact-R)
run, C:\SimTools\SimTools_GameManager.exe,min
sleep 400
run, C:\SimDash\SimDash.lnk,hide
Gui, Show, x40 y40 w460 h685, Cockpit
GuiControl,, simdash, SimDash (fans)
sleep 400
Gui, Show, x40 y40 w460 h706, Cockpit
GuiControl,, oculuscl, Oculus client (VR)
run, C:\Program Files\Oculus\Support\oculus-client\OculusClient.exe
run, C:\NirCmd\nircmdc.exe mutesysvolume 0
run, C:\NirCmd\nircmdc.exe setsysvolume 65535

sleep 1200
Gui, Font, c00ff99
Gui, Show, x40 y40 w460 h748, Cockpit
GuiControl, Font, finished
GuiControl,, finished, FINISHED

sleep 3000
Gui, destroy

sleep 4500
winminimize, Oculus ahk_class Chrome_WidgetWin_1
run, C:\NirCmd\nircmdc.exe setdefaultsounddevice "Auriculares"
sleep 600
SoundBeep, 1000, 1000
sleep 600
filedelete, c:\USBDeview\cockpitdevices.txt

exitapp

help::
ifwinexist, Instructions ahk_class AutoHotkeyGUI
{
winclose, Instructions ahk_class AutoHotkeyGUI
return
}
else
{
run, C:\Scripts\Cockpit\Instructions.ahk
return
}
Thank you! I changed things around to accommodate my system and all works great. Pretty neat!
 

What are you racing on?

  • Racing rig

    Votes: 528 35.2%
  • Motion rig

    Votes: 43 2.9%
  • Pull-out-rig

    Votes: 54 3.6%
  • Wheel stand

    Votes: 191 12.7%
  • My desktop

    Votes: 618 41.2%
  • Something else

    Votes: 66 4.4%
Back
Top