#RequireAdmin
#include <Misc.au3>
#include <GamePadEx.au3>
#include <File.au3>
Sleep (100)
Global $myGamePadHandle = GPExInitialize() ; Get a handle. This doesn't have to be global but needs to be passed to all the other functions.
Global $myID = 0 ; We want to monitor the default GamePad
Global $gameRom = $CmdLine[1]
LogMessage("richiesta avvio rom " & $gameRom)
Run("C:\Cabinato\Emulatori\demul07a_221215\demul.exe -run=awave -rom=" & $gameRom)
Run("C:\Cabinato\Emulatori\demul07a_221215\DemulShooter.exe -target=demul07a -noresize -widescreen -v -rom=" & $gameRom)
While 1
Sleep(10)
$testrawdata = GPExGetRawData($myGamePadHandle, $myID) ; Get almost every data possible from the gamepad. Returns in an array with 8 elements.
if $testrawdata[7]= (768) and ProcessExists("DemulShooter.exe") Then
LogMessage("chiusura processi..."")
ProcessClose ( "demul.exe" )
ProcessClose ( "DemulShooter.exe" )
LogMessage("chiusura processi completata"")
Exit
EndIf
WEnd
Func LogMessage($logMessage)
_FileWriteLog(@ScriptDir & "\launcher.log", $logMessage)
EndFunc
i tried to write an autoit script. but it doesn't work. can you help me?