Re: Tasto hotkey uscita emu + autoit + windows 10
Inviato: 11/04/2020, 16:33
primo post modificato. ci sono aggiornamenti.
Il Forum di riferimento italiano per gli appassionati di Cabinati Arcade
http://www.arcadeitalia.net/
Codice: Seleziona tutto
...
executable "C:\Program Files (x86)\AutoIt3\AutoIt3_x64.exe"
args "[romfilename]"
romext .au3
...
A cosa ti serve farlo partire all'avvio di Windows? Per avere un monitor sempre attivo, tale che alla pressione di quella combinazione di tasti esegue quella catena di chiusure? Fossi in te farei uno script generico che lancia un gioco demul (parametro ricevuto da Attract) che rimane poi in attesa di quella combinazione. Chiaro che lo userai solo per i giochi interessati._Gioacchino_ ha scritto: ↑07/04/2020, 22:28 Salve a tutti, sono riuscito a scrivere sto script su autoit e ad compilarlo. funziona per funzionare.
il problema è che non ne vuole sapere di partire in automatico all' avvio di windows / pc. sto uscendo pazzo, dove sbaglio?
...
io ho fatto cosi: (per il momento solo su piattaforma naomi):alucard ha scritto: ↑11/04/2020, 17:57 A cosa ti serve farlo partire all'avvio di Windows? Per avere un monitor sempre attivo, tale che alla pressione di quella combinazione di tasti esegue quella catena di chiusure? Fossi in te farei uno script generico che lancia un gioco demul (parametro ricevuto da Attract) che rimane poi in attesa di quella combinazione. Chiaro che lo userai solo per i giochi interessati.
ora la includo e lo ricompilo, cosa strana è che naomi_lightgun l'ho lasciato senza hotkey per chiudere l'emutore e mi chiude lo stesso gli emulatori con la combo select + start p1 (combo che impostato in tutti gli emulatori su attract mode).
Codice: Seleziona tutto
#RequireAdmin
#include <Misc.au3>
#include <GamePadEx.au3>
Sleep (1500)
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
While 1
Sleep(10)
$pressedbutton = GPExGetPressed($myGamePadHandle, $myID)
$pressedbutton2 = GPExGetPressed($myGamePadHandle, $myID)
if $pressedbutton= GPExButton(9) and $pressedbutton2 = GPExButton(10) and ProcessExists("DemulShooter.exe") Then
ProcessClose ( "demul.exe" )
ProcessClose ( "DemulShooter.exe" )
EndIf
WEnd
Codice: Seleziona tutto
#RequireAdmin
#include <Misc.au3>
#include <GamePadEx.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
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
ProcessClose ( "demul.exe" )
ProcessClose ( "DemulShooter.exe" )
EndIf
WEnd
Codice: Seleziona tutto
$romname=name
Run ("C:\Users\marie\Downloads\demul07a_221215\demul.exe -$romname")
Non credo riesca a sostituire il valore della variabile in quel modo. Penso sia_Gioacchino_ ha scritto: ↑13/04/2020, 18:14
qual' è la sintassi per passare il nome rom come argomento per la riga di comando?
Codice: Seleziona tutto
$romname=name Run ("C:\Users\marie\Downloads\demul07a_221215\demul.exe -$romname")
Codice: Seleziona tutto
RunWait ("C:\Users\marie\Downloads\demul07a_221215\demul.exe -" & $romname)
per quanto riguarda demulshooter?
Codice: Seleziona tutto
RunWait ("C:\Users\marie\Downloads\demul07a_221215\DemulShooter.exe" -target=demul07a -rom=$romname -noresize -widescreen -v)
Codice: Seleziona tutto
# Generated by Attract-Mode v2.6.1
#
executable C:\Cabinato\Utility\naomi_loader.exe
args "[romfilename]"
rompath C:\Cabinato\Rom\Sega Naomi
romext .zip
system Sega Naomi
info_source thegamesdb.net
exit_hotkey
artwork marquee C:\Cabinato\Rom\Sega Naomi\Logos
artwork snap C:\Cabinato\Rom\Sega Naomi\Video_MP4_HI_QUAL
artwork wheel C:\Cabinato\Rom\Sega Naomi\Logos
Codice: Seleziona tutto
# Generated by Attract-Mode v2.6.1
#
executable C:\Cabinato\Utility\sammy_loader.exe
args "[romfilename]"
rompath C:\Cabinato\Rom\Sammy Atomiswave
romext .zip
system Sammy Atomiswave
info_source thegamesdb.net
exit_hotkey
artwork marquee C:\Cabinato\Rom\Sammy Atomiswave\Logos
artwork snap C:\Cabinato\Rom\Sammy Atomiswave\Snap
artwork wheel C:\Cabinato\Rom\Sammy Atomiswave\wheel
Codice: Seleziona tutto
#RequireAdmin
#include <Misc.au3>
#include <GamePadEx.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
RunWait ("C:\Cabinato\Emulatori\demul07a_221215\demul.exe -run=naomi -rom=romfilename")
RunWait ("C:\Cabinato\Emulatori\demul07a_221215\DemulShooter.exe -target=demul07a -rom=romfilename -noresize -widescreen -v")
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
ProcessClose ( "demul.exe" )
ProcessClose ( "DemulShooter.exe" )
Exit
EndIf
WEnd
Codice: Seleziona tutto
#RequireAdmin
#include <Misc.au3>
#include <GamePadEx.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
RunWait ("C:\Cabinato\Emulatori\demul07a_221215\demul.exe -run=awave -rom=romfilename")
RunWait ("C:\Cabinato\Emulatori\demul07a_221215\DemulShooter.exe -target=demul07a -rom=romfilename -noresize -widescreen -v")
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
ProcessClose ( "demul.exe" )
ProcessClose ( "DemulShooter.exe" )
Exit
EndIf
WEnd
lo script lo si deve passare col sorgente in .au3 o compilato?alucard ha scritto: ↑11/04/2020, 17:40 Questo post è un mutaforma
Visto che hai deciso di buttarti su Autoit per la parte batch, questo è quello che metto io nella configurazione dell'emulatore che ne fa uso
Di base Attract passa la palla al processo, e al termine del processo a cui ha passato la palla (non ad un suo delegato questo è importante) ritorna in primo piano. Quindi in generale lo script Autoit deve essere redatto in modo tale da rimanere vivo fino alla fine dei processi che lancia.Codice: Seleziona tutto
... executable "C:\Program Files (x86)\AutoIt3\AutoIt3_x64.exe" args "[romfilename]" romext .au3 ...
Ora mi guardo il tuo script e vedo di capire cosa non sta andando
Codice: Seleziona tutto
$CmdLine[1]
$CmdLine[2]
...
Codice: Seleziona tutto
#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