Add AutoHotkey utility scripts
Adds four AutoHotkey scripts: DeadCells Auto Save (AHK v2) — F6 runs an elevated robocopy backup of the Steam userdata save folder to a Desktop "Dead Cells Backup" with timestamped folders and retention keeping the 7 newest backups; shows success/failure. EldenRingNIGHTREIGN fix — when nightreign.exe is active remaps Tab to sc032 (M) while allowing Shift+Tab and Alt+Tab to pass through. Idle Auto Playing — F8 starts an infinite loop sending 'w' and 'd' with 100ms delay; F9 hotkey is present but does not currently stop the loop. SmallKeyboardFix — maps Ctrl+Up and Ctrl+Shift+Up to vkBF (unshifted and shifted).
This commit is contained in:
56
DeadCells Auto Save.ahk
Normal file
56
DeadCells Auto Save.ahk
Normal file
@@ -0,0 +1,56 @@
|
||||
#Requires AutoHotkey v2.0
|
||||
; --- Admin Elevation Logic ---
|
||||
if !A_IsAdmin {
|
||||
try
|
||||
{
|
||||
Run('*RunAs "' A_AhkPath '" "' A_ScriptFullPath '"')
|
||||
}
|
||||
ExitApp
|
||||
}
|
||||
; -----------------------------
|
||||
F6::
|
||||
{
|
||||
source := "C:\Program Files (x86)\Steam\userdata\462943940\588650\remote"
|
||||
userProfile := EnvGet("USERPROFILE")
|
||||
baseDest := userProfile "\Desktop\Dead Cells Backup"
|
||||
|
||||
; Create timestamp
|
||||
now := A_Now
|
||||
ts := SubStr(now, 1, 4) "-" SubStr(now, 5, 2) "-" SubStr(now, 7, 2) "_" SubStr(now, 9, 2) "-" SubStr(now, 11, 2) "-" SubStr(
|
||||
now, 13, 2)
|
||||
dest := baseDest "\Save Backup [" ts "]"
|
||||
|
||||
; Ensure directories exist
|
||||
DirCreate(baseDest)
|
||||
|
||||
; Run Robocopy
|
||||
cmd := 'robocopy "' source '" "' dest '" /E /COPYALL /R:2 /W:2'
|
||||
rc := RunWait(cmd, , "Hide")
|
||||
|
||||
if (rc <= 7) {
|
||||
; --- Cleanup Logic Starts Here ---
|
||||
backups := []
|
||||
|
||||
; 1. Loop through all folders starting with "Save Backup ["
|
||||
loop files, baseDest "\Save Backup [*", "D" {
|
||||
backups.Push(A_LoopFilePath)
|
||||
}
|
||||
|
||||
; 2. If we have more than 7, delete the oldest ones
|
||||
; Note: Because the names are timestamped, they sort naturally by time.
|
||||
if (backups.Length > 7) {
|
||||
; The folders are pushed in chronological order by the OS.
|
||||
; We delete from the start of the array until only 7 remain.
|
||||
while (backups.Length > 7) {
|
||||
oldestBackup := backups.RemoveAt(1)
|
||||
DirDelete(oldestBackup, 1) ; 1 = recurse (delete contents)
|
||||
}
|
||||
}
|
||||
; --- Cleanup Logic Ends Here ---
|
||||
|
||||
MsgBox "Backup completed successfully.`nOld backups cleaned. Total kept: 7`n`nNewest: " dest
|
||||
}
|
||||
else {
|
||||
MsgBox "Backup may have failed.`nRobocopy exit code: " rc
|
||||
}
|
||||
}
|
||||
24
EldenRingNIGHTREIGN fix.ahk
Normal file
24
EldenRingNIGHTREIGN fix.ahk
Normal file
@@ -0,0 +1,24 @@
|
||||
#SingleInstance Force
|
||||
#UseHook
|
||||
SendMode Input
|
||||
SetKeyDelay -1, -1
|
||||
|
||||
#IfWinActive ahk_exe nightreign.exe
|
||||
|
||||
; Fully ignore Shift+Tab so Steam sees it
|
||||
$Tab::
|
||||
if GetKeyState("Shift", "P") {
|
||||
SendInput {Blind}{Tab} ; Let Steam handle it — no override
|
||||
return
|
||||
}
|
||||
if GetKeyState("Alt", "P") {
|
||||
SendInput {Blind}{Tab} ; Let Alt+Tab work normally
|
||||
return
|
||||
}
|
||||
; Otherwise, remap Tab to M
|
||||
SendInput {sc032 down}
|
||||
Sleep 30
|
||||
SendInput {sc032 up}
|
||||
return
|
||||
|
||||
#IfWinActive
|
||||
20
Idle Auto Playing.ahk
Normal file
20
Idle Auto Playing.ahk
Normal file
@@ -0,0 +1,20 @@
|
||||
; This line sets the hotkey. You can change "F8" to any key you prefer.
|
||||
F8:: ; activates the script when F8 is pressed
|
||||
|
||||
; Loop to keep pressing the keys
|
||||
Loop {
|
||||
|
||||
; Send W key press
|
||||
Send, w
|
||||
|
||||
; Set delay between presses (adjust in milliseconds, 100ms is very fast)
|
||||
Sleep, 100
|
||||
|
||||
; Send D key press
|
||||
Send, d
|
||||
|
||||
; Set delay between presses (adjust in milliseconds)
|
||||
}
|
||||
|
||||
; Create a new hotkey to deactivate the script using F9
|
||||
F9:: return
|
||||
7
SmallKeyboardFix.ahk
Normal file
7
SmallKeyboardFix.ahk
Normal file
@@ -0,0 +1,7 @@
|
||||
^Up:: ; Ctrl + Up = base vkBF (e.g., / or ظ)
|
||||
Send {vkBF}
|
||||
return
|
||||
|
||||
^+Up:: ; Ctrl + Shift + Up = shifted vkBF (e.g., ? or ؟)
|
||||
Send +{vkBF}
|
||||
return
|
||||
Reference in New Issue
Block a user