DEVID=8888 PID=8888 vPATH=c:\mmjoy2 1Joy17::;button 17 of Joystick #1 pressed (assigned to Landing gear) if vGear=0 ;vGear variable to remember the last state on/off of Landing Gear { Run %vPATH%\ledcontrol.exe %DEVID% %PID% 003 255 0 0, min vGear=1 sleep, 500 Process, Close, LEDcontrol.exe Run %vPATH%\ledcontrol.exe %DEVID% %PID% 001 255 0 0, min sleep, 500 Process, Close, LEDcontrol.exe } else { Run %vPATH%\ledcontrol.exe %DEVID% %PID% 003 0 0 0, min vGear=0 sleep, 500 Process, Close, LEDcontrol.exe Run %vPATH%\ledcontrol.exe %DEVID% %PID% 001 0 0 0, min sleep, 500 Process, Close, LEDcontrol.exe } Return 1Joy18:: ;button 18 of Joystick #1 pressed (assigned to Cargo scoop) if vScoop=0 ;vScoop variable to remember the last state on/off of Cargo Scoop { Run %vPATH%\ledcontrol.exe %DEVID% %PID% 004 255 255 0, min vScoop=1 sleep, 500 Process, Close, LEDcontrol.exe Run %vPATH%\ledcontrol.exe %DEVID% %PID% 001 255 255 0, min sleep, 500 Process, Close, LEDcontrol.exe } else { Run %vPATH%\ledcontrol.exe %DEVID% %PID% 004 0 0 0, min vScoop=0 sleep, 500 Process, Close, LEDcontrol.exe Run %vPATH%\ledcontrol.exe %DEVID% %PID% 001 0 0 0, min sleep, 500 Process, Close, LEDcontrol.exe } Return