Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;This script automates the export of all items in all model/animation/scenery entries, in each NSF archive in the script's directory, for each game.
- #SingleInstance Force ;Disable running more than one instance of the script
- #MaxThreadsPerHotkey, 2 ;Set an additional thread for pause detection
- #NoEnv ;Disable checking if variables are environment variables
- DllCall("QueryPerformanceFrequency","Int64*",Frequency) ;Retrieve the performance counter frequency
- FSO:=ComObjCreate("Scripting.FileSystemObject") ;Call the FileSystemObject
- SetBatchLines -1 ;Remove the command delay
- SetControlDelay -1 ;Remove the control input delay
- SendMode InputThenPlay ;Make the script's inputs a higher priority than the user's inputs
- Multiplier:=1 ;Set the specific command delay multiplier
- SetWorkingDir % A_ScriptDir ;Set the working directory relative to the script's directory
- CrashEdit:="ahk_exe CrashEdit.exe" ;Simplify the CrashEdit window checking commands
- If !FileExist("CrashEdit.exe") ;If CrashEdit is missing:
- {
- MsgBox 48,Error,"CrashEdit.exe" was not found.`nThe script will now exit. ;Wait for confirmation
- Gosub Exit ;Stop the script (line 417)
- }
- If !FileExist("Entry IDs") ;If the "Entry IDs" directory is missing:
- {
- MsgBox 48,Error,The "Entry IDs" directory was not found.`nThe script will now exit. ;Wait for confirmation
- Gosub Exit ;Stop the script (line 417)
- }
- Suspend ;Disable the pause key
- MsgBox 1,CrashEdit Multi-Export Script,Input can be paused by pressing the P key. ;Wait for confirmation
- IfMsgBox Cancel ;If the user clicks the "Cancel" button or closes the message box,
- Gosub Exit ;Stop the script (line 417)
- BlockInput On ;Disable input
- Input:=!Input ;Toggle the input status
- Suspend ;Enable the pause key
- FileCreateDir % "Archives" ;Create the "Archives" directory (if it does not already exist)
- If WinExist(CrashEdit) ;If any CrashEdit instances exist,
- Loop ;For each CrashEdit instance:
- Process Close,CrashEdit.exe ;Force close the most recent one,
- Until !WinExist(CrashEdit) ;Until none remain
- Gosub Start ;Start CrashEdit (line 301)
- Loop Files,%A_WorkingDir%\*.NSF,F ;For each archive:
- {
- Loop 3 ;For each game version:
- If SubStr(A_LoopFileName,3,3)="CB" . A_Index ;If the archive name contains the game,
- Game:=9-A_Index ;Set the appropriate game choice variable
- If Game=8 ;If the game is CB1,
- Loop Parse,% "Beta|Demo",| ;For each sub-version:
- If InStr(A_LoopFileName,A_LoopField) ;If the archive name contains a sub-version,
- Game:=6-A_Index ;Set the appropriate game choice variable
- If Game=7&&InStr(A_LoopFileName,"Beta") ;If the game is CB2 and the archive name contains the Beta sub-version,
- Game:=3 ;Set the appropriate game choice variable
- Gosub Open ;Open the current archive (line 317)
- Loop Parse,% "T1 Entry|Model Entry|Scenery Entry",| ;For each query:
- {
- Subsystem:=(A_LoopField="T1 Entry")?"SVTX":(A_LoopField="Model Entry")?"TGEO":(A_LoopField="Scenery Entry")?"WGEO": ;Set the subsystem according to the current query
- Type:=(Subsystem="SVTX")?"frame":"item" ;Depending on the subsystem, set the item type to "frame" or "item"
- startingEntry:=1 ;Reset the skipped entry count
- startingItem:=0 ;Reset the skipped item count
- Find:
- ControlClick x203 y32,,,,,NA ; Click CrashEdit's "Find" button
- DllCall("QueryPerformanceCounter","Int64*",Counter) ;Start the counter
- While ((currentCounter-Counter)/Frequency)*1000<(2000*Multiplier) ;For at least ~2s:
- {
- Check:=WinActive(CrashEdit,,CrashEdit) ;Check whether CrashEdit's find form is active
- If Check ;If CrashEdit's find form is active,
- Break ;Stop the loop
- If !WinExist("CrashEdit " . CrashEdit) ;If no CrashEdit instances exist:
- {
- Gosub Restart ;Restart CrashEdit (line 294)
- Goto Find ;Restart the query (line 54)
- }
- DllCall("QueryPerformanceCounter", "Int64*", currentCounter) ;Increment the counter
- }
- If !Check ;If CrashEdit's find form doesn't exist:
- {
- Gosub Restart ;Restart CrashEdit (line 294)
- Goto Find ;Restart the query (line 54)
- }
- WinWaitActive % CrashEdit,,,CrashEdit ;Wait for CrashEdit's find form to be active
- ControlSetText % "WindowsForms10.EDIT" . Instance . "1",% A_LoopField ;Set the current search query in CrashEdit's find form
- ControlSend,,{Enter} ;Send the search query
- DllCall("QueryPerformanceCounter","Int64*",Counter) ;Start the counter
- While ((currentCounter-Counter)/Frequency)*1000<(200*Multiplier) ;For at least ~200ms:
- {
- If !WinActive(CrashEdit,,"CrashEdit") ;If CrashEdit's find form isn't active,
- Break ;Stop the loop
- DllCall("QueryPerformanceCounter", "Int64*", currentCounter) ;Increment the counter
- }
- If startingEntry=1 ;If the skipped entry count isn't set:
- {
- DllCall("QueryPerformanceCounter","Int64*",Counter) ;Start the counter
- While ((currentCounter-Counter)/Frequency)*1000<(250*Multiplier) ;For at least ~250ms:
- {
- If WinActive(CrashEdit,,"CrashEdit") ;If the "No results found." message is active:
- {
- WinGetText Text ;Retrieve all visible text
- If !InStr(Text,"No results found.") ;If the specified string doesn't exist in the visible text:
- {
- Gosub Restart ;Restart CrashEdit (line 294)
- Goto Find ;Restart the query (line 54)
- }
- ControlSend,,{Enter} ;Close the "No results found." message
- WinWaitActive % "CrashEdit " . CrashEdit ;Wait for CrashEdit to be active
- Continue ;Move onto the next query
- }
- DllCall("QueryPerformanceCounter", "Int64*", currentCounter) ;Increment the counter
- }
- }
- WinWaitActive % "CrashEdit " . CrashEdit ;Wait for CrashEdit to be active
- Loop ;For each entry:
- {
- Entry:=A_Index ;Store the loop number for nested use
- If startingEntry>1&&Entry<startingEntry ;If the skipped entry count is set, and the current entry is lesser than the skipped entry count,
- Goto nextEntry ;Skip the entry (line 245)
- Else ;Otherwise,
- startingEntry:=1 ;Reset the skipped entry count
- Parent:=A_WorkingDir . "\Entries\" . SubStr(A_LoopFileName,1,-4) . "," . Subsystem . "," . Format("{:03}",Entry) ;Set the parent to a concatenation of the "Entries" folder in the script's directory, the archive's name, the current subsystem and current entry
- If FileExist(Parent . ",*") ;If the directory already exists and its name contains an Entry ID:
- {
- Loop Files,% Parent . ",*",D ;For the directory that contains that Entry ID:
- Parent:=A_LoopFilePath ;Set the parent to that directory
- If Subsystem="TGEO" ;If the subsystem is of a model entry,
- If FSO.GetFolder(Parent).Files.Count=6 ;If the file count matches the maximum of the model entry's directory's,
- Goto nextEntry ;Skip the entry (line 245)
- If Subsystem="WGEO" ;If the subsystem is of a scenery entry,
- If FSO.GetFolder(Parent).Files.Count=7 ;If the file count matches the complete scenery entry's directory's,
- Goto nextEntry ;Skip the entry (line 245)
- }
- Else ;Otherwise,
- FileCreateDir % Parent ;Create the current directory
- ControlSend % "WindowsForms10.SysTreeView32" . Instance . "1",{NumpadMult} ;Open the current entry
- Loop ;For each item:
- {
- Item:=A_Index-1 ;Store the loop number for nested use
- ;Start Special Cases - If the following conditions are met:
- If SubStr(A_LoopFileName,1,-4="1,CB3,NTSC,29,0D"&&Subsystem="SVTX"&&Entry=126&&Item=3) ;1,CB3,NTSC,29,0D,SVTX,126/frame3
- Break ;Move onto the next entry
- If SubStr(A_LoopFileName,1,-4="1,CB3,NTSC,39,21"&&Subsystem="SVTX"&&Entry=110&&Item=3) ;1,CB3,NTSC,39,21,SVTX,110/frame3
- Break ;Move onto the next entry
- If SubStr(A_LoopFileName,1,-4="1,CB3,NTSC,42,27"&&Subsystem="SVTX"&&Entry=115&&Item=3) ;1,CB3,NTSC,42,27,SVTX,115/frame3
- Break ;Move onto the next entry
- If SubStr(A_LoopFileName,1,-4="2,CB3,NTSC-J,42,27"&&Subsystem="SVTX"&&Entry=115&&Item=3) ;2,CB3,NTSC-J,42,27,SVTX,115/frame3
- Break ;Move onto the next entry
- If SubStr(A_LoopFileName,1,-4="3,CB3,PAL,29,0D"&&Subsystem="SVTX"&&Entry=126&&Item=7) ;3,CB3,PAL,29,0D,SVTX,126/frame7
- Break ;Move onto the next entry
- If SubStr(A_LoopFileName,1,-4="3,CB3,PAL,39,21"&&Subsystem="SVTX"&&Entry=110&&Item=7) ;3,CB3,PAL,39,21,SVTX,110/frame7
- Break ;Move onto the next entry
- If SubStr(A_LoopFileName,1,-4="3,CB3,PAL,42,27"&&Subsystem="SVTX"&&Entry=115&&Item=7) ;3,CB3,PAL,42,27,SVTX,115/frame7
- Break ;Move onto the next entry
- ;End Special Cases
- If Subsystem="TGEO"&&Item=6 ;If the maximum item count for the model entry has been met,
- Break ;Move onto the next entry
- If Subsystem="WGEO"&&Item=7 ;If the scenery entry is complete,
- Break ;Move onto the next entry
- ControlSend % "WindowsForms10.SysTreeView32" . Instance . "1",{Down} ;Select the current item
- Sleep (50*Multiplier) ;Wait at least ~50ms
- If startingItem>0&&Item<startingItem ;If the skipped item count is set, and the current item is lesser than the skipped item count,
- Continue ;Skip the item
- Else
- startingItem:=0 ;Reset the skipped item count
- If FileExist(Parent . "\" . Type . Item) ;If the current item in the current directory exists,
- Continue ;Skip the item
- MouseMove 228,92 ;Move the cursor onto the potential "Export" button
- DllCall("QueryPerformanceCounter","Int64*",Counter) ;Start the counter
- While ((currentCounter-Counter)/Frequency)*100<(50*Multiplier) ;For at least ~50ms:
- {
- ControlGet Check,Hwnd,,% "WindowsForms10.Window.8" . Instance . "7" ;Retrieve the potential export button container's identifier
- If Check ;If the potential export button container exists:
- {
- ControlGet Style,Style,,% "WindowsForms10.Window.8" . Instance . "7" ;Retrieve the potential export button container's style
- ControlGet ExStyle,ExStyle,,% "WindowsForms10.Window.8" . Instance . "7" ;Retrieve the potential export button container's additional style
- If Style="0x56010000"&&ExStyle="0x00000000" ;If the export button container exists:
- {
- PixelGetColor Color,228,92 ;Retrieve the "Export" button's colour
- If Color="0xD77800"||Color="0xFF9933" ;If the "Export" button is highlighted:
- {
- If WinActive("CrashEdit " . CrashEdit,"Unhandled exception") ;If an unhandled exception occured:
- {
- ControlSend,,{Tab}{Enter}, ;Ignore the unhandled exception
- WinWaitActive % "CrashEdit " . CrashEdit ;Wait for CrashEdit to become active
- }
- ControlClick x228 y92,,,,,NA ;Click the "Export" button
- MouseMove 227,92 ;Move the cursor off of the "Export" button
- DllCall("QueryPerformanceCounter","Int64*",Counter) ;Start the counter
- While ((currentCounter-Counter)/Frequency)*1000<(15000*Multiplier) ;For at least ~15s:
- {
- Check:=WinActive("Save As " . CrashEdit) ;Check whether the file export dialog is active
- If Check ;If the file export dialog is active,
- Break ;Stop the loop
- If !WinExist("CrashEdit " . CrashEdit) ;If no CrashEdit instances exist:
- {
- Gosub Restart ;Restart CrashEdit (line 294)
- Goto Find ;Restart the query (line 54)
- }
- DllCall("QueryPerformanceCounter", "Int64*", currentCounter) ;Increment the counter
- }
- If !Check ;If the find form doesn't exist:
- {
- Gosub Restart ;Restart CrashEdit (line 294)
- Goto Find ;Restart the query (line 54)
- }
- WinGetText Text ;Retrieve all visible text
- If !InStr(Text,"All Files") ;If the string is missing from the visible text:
- {
- Gosub Restart ;Restart CrashEdit (line 294)
- Goto Find ;Restart the query (line 54)
- }
- ControlSetText Edit1,% Parent . "\" . Type . Item ;Set the item export path
- ControlSend,,{Enter} ;Export the item
- ;FileAppend % Parent . "\" . Type . Item . "`n",_Exported.txt ;Record the item
- WinWaitActive % "CrashEdit " . CrashEdit ;Wait for CrashEdit to be active
- Loop ;Indefinitely:
- PixelGetColor Color,228,92 ;Retrieve the "Export" button's colour,
- Until (Color!="0xD77800"&&Color!="0xFF9933") ;Until it isn't highlighted
- Continue 2 ;Move onto the next item
- }
- }
- }
- DllCall("QueryPerformanceCounter", "Int64*", currentCounter) ;Increment the counter
- }
- PixelGetColor Color,228,92 ;Retrieve the potential entity viewer panel's colour,
- If Color="0xABABAB" ;If the entity viewer is loading,
- Loop ;Indefinitely:
- PixelGetColor Color,228,92 ;Retrieve the entity view panel's colour,
- Until Color!="0xABABAB" ;Until the entity viewer has loaded
- If Color="0x000000"||SubStr(Color,3,2)!=SubStr(Color,5,2)||SubStr(Color,3,2)!=SubStr(Color,7,2)||SubStr(Color,5,2)!=SubStr(Color,7,2) ;If the entity viewer has loaded,
- Break ;Move onto the next entry
- If !WinExist("CrashEdit " . CrashEdit) ;If no CrashEdit instances exist:
- {
- Item:=0 ;Reset the item count
- Gosub Restart ;Restart CrashEdit (line 294)
- Goto Find ;Restart the query (line 54)
- }
- WinGetText Text ;Retrieve all visible text
- Loop Parse,% "No options available|Monochrome 8",| ;For each sub-version:
- {
- If !InStr(Text,A_LoopField) ;If the current string is missing:
- {
- If A_Index=2 ;If all strings are missing:
- {
- Item:=0 ;Reset the item count
- Gosub Restart ;Restart CrashEdit (line 294)
- Goto Find ;Restart the query (line 54)
- }
- }
- Else ;Otherwise,
- Break 2 ;Move onto the next entry
- }
- }
- nextEntry:
- Item:=0 ;Reset the item count
- If Subsystem="SVTX"&&InStr(Parent,",",,,8)&&SubStr(Parent,InStr(Parent,",",,,8)-StrLen(Parent)+1)!=FSO.GetFolder(Parent).Files.Count ;If the animation entry directory name contains an incorrect frame count,
- FileMoveDir % Parent,% SubStr(Parent,1,InStr(Parent,",",,,8)) . FSO.GetFolder(Parent).Files.Count,R ;Rename the directory with the correct frame count
- ControlClick x237 y32,,,,,NA ;Click the "Find Next" button
- Sleep (50*Multiplier) ;Wait at least ~50ms
- If Entry>=startingEntry ;If the current entry is greater than or equal to the skipped entry count:
- {
- DllCall("QueryPerformanceCounter","Int64*",Counter) ;Start the counter
- While ((currentCounter-Counter)/Frequency)*1000<(250*Multiplier) ;For at least ~250ms:
- {
- If WinActive(CrashEdit,,"CrashEdit") ;If the "No results found." message is active:
- {
- WinGetText Text ;Retrieve all visible text
- If !InStr(Text,"No results found.") ;If the specified string doesn't exist in the visible text:
- {
- Gosub Restart ;Restart CrashEdit (line 294)
- Goto Find ;Restart the query (line 54)
- }
- ControlSend,,{Enter} ;Close the "No results found." message
- WinWaitActive % "CrashEdit " . CrashEdit ;Wait for CrashEdit to be active
- Entry:=1 ;Reset the entry count
- Loop Read,% "Entry IDs\" . SubStr(A_LoopFileName,1,-4) . "," . Subsystem . ".txt" ;For each entry ID of the current archive and subsystem:
- {
- Source:="Entries\" . SubStr(A_LoopFileName,1,-4) . "," . Subsystem . "," . Format("{:03}",A_Index) ;Set the source entry directory name
- If FileExist(Source) ;If the source entry folder exists:
- {
- If Subsystem="SVTX" ;If it is an animation entry,
- FileMoveDir % Source,% Source . "," . A_LoopReadLine . "," . FSO.GetFolder(Source).Files.Count,R ;Append the Entry ID and frame count to the directory name
- Else ;Otherwise,
- FileMoveDir % Source,% Source . "," . A_LoopReadLine,R ;Append the Entry ID to the directory name
- }
- }
- Break 2 ;Move onto the next query
- }
- DllCall("QueryPerformanceCounter", "Int64*", currentCounter) ;Increment the counter
- }
- }
- }
- }
- ControlClick x157 y32,,,,,NA ;Click the "Close" button
- Loop Parse,% ".NSF|.NSD",| ;For each archive's NSF and NSD file:
- FileMove % SubStr(A_LoopFileName,1,-4) . A_LoopField,% "Archives" ;Move that file to the "Archives" directory
- }
- BlockInput Off ;Enable input
- DllCall("kernel32\Beep",Int,800,Int,500) ;Audibly announce the script's completion
- MsgBox % "Complete!" ;Visually announce the script's completion
- Gosub Exit ;Stop the script (line 417)
- Restart:
- Process Close,CrashEdit.exe ;Force close the most recent CrashEdit instance
- WinWaitClose % "CrashEdit " . CrashEdit ;Wait for CrashEdit to close
- startingEntry:=Entry ;Store the current entry
- startingItem:=Item ;Store the current item
- Start:=2 ;Indicate the restart sub-routine has occured
- Start:
- Run CrashEdit.exe ;Start CrashEdit
- WinWaitActive % "CrashEdit " . CrashEdit ;Wait for CrashEdit to open
- Process Priority,CrashEdit.exe,H ;Set CrashEdit's priority to High
- WinGetPos,,,WindowWidth,WindowHeight ;Retrieve the CrashEdit window's width and height
- WinMove,,,(A_ScreenWidth/2)-(WindowWidth/2),(A_ScreenHeight/2)-(WindowHeight/2) ;Move the CrashEdit window to the centre of the screen
- WinGetClass Instance ;Retrieve the window's class
- Instance:=SubStr(Instance,-13) ;Retrieve the window's unique instance
- If Start=2 ;If the restart sub-routine has occurred:
- {
- Gosub Open ;Reopen the previous archive (line 317)
- Return ;Stop this sub-routine
- }
- Start:=1 ;Indicate the start sub-routine has occured
- Return ;Stop this sub-routine
- Open:
- ControlClick x15 y32,,,,,NA ;Click the "Open" button
- If !Start ;If the start sub-routine has already occurred:
- {
- DllCall("QueryPerformanceCounter","Int64*",Counter) ;Start the counter
- While ((currentCounter-Counter)/Frequency)*1000<(2000*Multiplier) ;For at least ~2s:
- {
- Check:=WinActive("Open " . CrashEdit) ;Check Whether CrashEdit's file open dialog is active
- If Check ;If CrashEdit's file open dialog is active,
- Break ;Stop the loop
- If !WinExist("CrashEdit " . CrashEdit) ;If no CrashEdit instances exist:
- {
- Gosub Restart ;Restart CrashEdit (line 294)
- Return ;Stop this sub-routine
- }
- DllCall("QueryPerformanceCounter", "Int64*", currentCounter) ;Increment the counter
- }
- }
- Else ;Otherwise,
- WinWaitActive % "Open " . CrashEdit ;Wait for CrashEdit's file open dialog to be active
- If !Start ;If the start sub-routine has already occurred:
- {
- WinGetText Text ;Retrieve all visible text
- If !InStr(Text,"NSF Files") ;If the string doesn't exist in the visible text:
- {
- Gosub Restart ;Restart CrashEdit (line 294)
- Return ;Stop this sub-routine
- }
- }
- ControlSetText Edit1,% A_LoopFileFullPath ;Input the current archive's path into CrashEdit's file open dialog
- ControlSend,,{Enter} ;Open the current archive
- If !Start ;If the start sub-routine has already occurred:
- {
- DllCall("QueryPerformanceCounter","Int64*",Counter) ;Start the counter
- While ((currentCounter-Counter)/Frequency)*1000<(2000*Multiplier) ;For at least ~2s:
- {
- If !WinExist("CrashEdit " . CrashEdit) ;If no CrashEdit instances exist:
- {
- Gosub Restart ;Restart CrashEdit (line 294)
- Return ;Stop this sub-routine
- }
- DllCall("QueryPerformanceCounter", "Int64*", currentCounter) ;Increment the counter
- }
- }
- WinWaitActive % "CrashEdit Game Version Selection " . CrashEdit ;Wait for CrashEdit's game version selection form to be active
- If !Start ;If the start sub-routine has already occurred:
- {
- WinGetText Text ;Retrieve all visible text
- If !InStr(Text,"OK") ;If the specified string doesn't exist in the visible text:
- {
- Gosub Restart ;Restart CrashEdit (line 294)
- Return ;Stop this sub-routine
- }
- }
- ControlClick,% "WindowsForms10.BUTTON" . Instance . Game,,,,,NA ;Select the current game option from CrashEdit's game version selection form
- ControlSend,,{Enter} ;Send the selection
- If SubStr(A_LoopFileName,InStr(A_LoopFileName,",",,,2)+1,InStr(A_LoopFileName,",",,,3)-1-InStr(A_LoopFileName,",",,,2))="NTSC-J" ;If the archive is of Japanese region:
- {
- DllCall("QueryPerformanceCounter","Int64*",Counter) ;Start the counter
- While ((currentCounter-Counter)/Frequency)*1000<(400*Multiplier) ;For at least ~400ms:
- {
- If WinActive("Error Reporter " . CrashEdit) ;If CrashEdit's error reporter window is active:
- {
- If !Start ;If the start sub-routine has already occurred:
- {
- WinGetText Text ;Retrieve all visible text
- If !InStr(Text,"OK") ;If the specified string doesn't exist in the visible text:
- {
- Gosub Restart ;Restart CrashEdit (line 294)
- Return ;Stop this sub-routine
- }
- }
- ControlSend,,{Enter} ;Close CrashEdit's error reporter window
- WinWaitClose ;Wait for CrashEdit's error reporter window to close
- DllCall("QueryPerformanceCounter","Int64*",Counter) ;Restart the counter
- }
- DllCall("QueryPerformanceCounter", "Int64*", currentCounter) ;Increment the counter
- }
- }
- If !Start ;If the start sub-routine has already occurred:
- {
- DllCall("QueryPerformanceCounter","Int64*",Counter) ;Start the counter
- While ((currentCounter-Counter)/Frequency)*1000<(2000*Multiplier) ;For at least ~2s:
- {
- If !WinExist("CrashEdit " . CrashEdit) ;If no CrashEdit instances exist:
- {
- Gosub Restart ;Restart CrashEdit (line 294)
- Return ;Stop this sub-routine
- }
- DllCall("QueryPerformanceCounter", "Int64*", currentCounter) ;Increment the counter
- }
- }
- WinActivate % "CrashEdit " . CrashEdit ;Activate the main CrashEdit window
- WinWaitActive % "CrashEdit " . CrashEdit ;Wait for the main CrashEdit window to be active
- Loop ;Indefinitely:
- ControlGet Check,Visible,,% "WindowsForms10.STATIC" . Instance . "1",% "CrashEdit " . CrashEdit ;Check the visibility of the last loaded control,
- Until Check ;Until it is visible
- If Start ;If the start sub-routine has occurred,
- Start:=0 ;Indicate the start sub-routine has finished
- Return ;Stop this sub-routine
- Exit:
- If A_Paused ;If the script is paused,
- Pause ;Resume the script
- If WinExist("CrashEdit " . CrashEdit) ;If any CrashEdit instances exist,
- Loop ;Indefinitely:
- Process Close,CrashEdit.exe ;Force close the most recent one,
- Until !WinExist("CrashEdit " . CrashEdit) ;Until none remain
- ExitApp ;Exit the script
- #UseHook ;Monitor the following keystrokes:
- p:: ;Upon pressing the 'P' key:
- BlockInput % (Input:=!Input)?"On":"Off" ;Toggle input blocking
- WinActivate % CrashEdit ;Activate CrashEdit
- Pause ;Pause the script
- Return ;Stop this sub-routine
- #UseHook Off ;Do not monitor the following keystrokes:
Advertisement
Add Comment
Please, Sign In to add comment