2014-05-10 3 views
0

저는 현재 PC에서 ps2 게임을 에뮬레이트하고 있으며 Savedata의 손실 에 대한 보험을 갖고 싶습니다. 그래서 PCSX2 당신이일괄 처리 기능이있는 시간 자동 저장

이 조각 (다음 슬롯 및 F2 스위치) F1을 눌러 저장하면 PS2 목적을 위해 더 큰 파일의 일부이다 (I가 필요한 경우를 게시 할 수 있습니다) 하지만 그것은 기본적으로 달성해야 할 것은입니다 pcsx2.exe가 0.135 초마다 을 실행하는지 확인하고 매 3 분마다 게임을 저장하십시오.
이 코드를 실행하면 일괄 처리 스크립트가 즉시 종료되어 eveen에 오류 메시지가 표시됩니다. 누구나이 문제가 무엇이 될 수 있는지 말해 줄 수 있습니까? 아니면 문제가 다른 곳에서 거짓말을해야합니까?

SET /a time=0 

:loop 

if %time%==180(
    nircmd.exe sendkey F1 press 
    nircmd.exe sendkey F2 press 
     SET /a time=0 

) 

    tasklist /FI "IMAGENAME eq pcsx2-r5875.exe" 2>NUL | find /I /N "pcsx2r5875.exe">NUL 
    nircmd.exe wait 100 
    set /a time+=1 


    if "%ERRORLEVEL%"=="0" goto loop 

편집 : 도움을

@ echo off 
nircmd.exe cmdwait 10 nircmd.exe sendkey 0x5B down 
nircmd.exe cmdwait 10 nircmd.exe sendkey D press 
nircmd.exe cmdwait 10 nircmd.exe sendkey 0x5B up 
::simulates windows+D to close all windows 

taskkill /f /im explorer.exe 
::kills explorer 
start /d "C:\Program Files (x86)\Google\Drive" googledrivesync.exe 
::Google Drive to backup save files 
start /d "C:\Program Files\MotioninJoy\ds3" DS3_Tool.exe 
::DS3 Tool to play with wireless playstation controller 
start %windir%\System32\DisplaySwitch.exe /internal 
::switches to Single-Display mode 

start /d "C:\Program Files (x86)\PCSX2 1.2.1" pcsx2-r5875.exe 
::starts emulator 

SET timeloop=0 
goto loop2 
:loop 
    SET timeloop=0 
    nircmd.exe sendkey F1 press 
    nircmd.exe sendkey F2 press 
    echo Saved at %time% 
    :loop2 
     nircmd.exe wait 100 
     set /a timeloop+=1 
     tasklist /FI "IMAGENAME eq pcsx2-r5875.exe" 2>NUL | find /I /N "pcsx2-r5875.exe">NUL || goto EndOfLoop 
     if %timeloop% LSS 1800 goto :loop2 
goto loop 
:EndOfLoop 
::loop that autosaves to a different slot every 3 minutes and exits if emulator exits 

start %windir%\System32\DisplaySwitch.exe /extend 
taskkill /f /im googledrivesync.exe 
taskkill /f /im explorer.exe 
taskkill /f /im DS3_Tool.exe 
start explorer.exe 
::finally everything is cleaned up 

감사

관심있는 사람들을위한 완벽한 작업 스크립트!

+0

같은 일반 변수로 시스템 변수를 사용하지 마십시오? – Stephan

답변

1

하는 당신은 단지 우리에게을 yor 배치의 일부를 보여주는 것 때문에 말하기 어렵지만,

if %time%==180(

는 문법적으로 잘못된 톤이 카운트입니다.

먼저,도 180(

세컨드 사이의 공간이어야 time 현재 사용자가 선택한 포맷으로 현재 시스템 시간을 반환하는 magic variable이다. 내 경우에는 hh : mm : ss : ms입니다. 180과 일치하는 것은 거의 없습니다. time이라는 사용자 환경 변수를 설정하면 사용자 변수는 magic variable을 무시합니다. (이의 NORE 인 바이 - 더 -에 의해, 그러나 일반적으로 정말 좋은 생각)

가능성이 이러한 문제를 치료할 고정 - 당신이 (같은 오류 메시지를 볼 수 있도록 할 전략적으로 pause 명령을 삽입 직후 if 라인 ... 물론 전략적으로 어디인지는 짐작할 수 있어야합니다.)

+0

하하 감사, 왜 내 시스템 시간이 엉망이 궁금 해서요 : D 조 –

1

실행 파일이 닫히고 루프가 완료되면이 작업이 끝나고 종료됩니다.

는 nircmd.exe`이 errrorlevel을 변경하지 않는 '것을 확신 timedateusername

:loop 
    SET timeloop=0 
    tasklist /FI "IMAGENAME eq pcsx2-r5875.exe" 2>NUL | find /I /N "pcsx2r5875.exe">NUL || goto :EOF 
    nircmd.exe sendkey F1 press 
    nircmd.exe sendkey F2 press 
    :loop2 
     nircmd.exe wait 100 
     set /a timeloop+=1 
     if %timeloop% LSS 180 goto :loop2 
goto loop