软件一:法环的理头布鲁酷马小软件

脚本一:减少艾尔登法环卡顿,设置小蓝熊的CPU亲和性、CPU优先级.ps1
function Set-ProcessCpuAffinity {
param(
[Diagnostics.Process]$Process,
[int[]]$Affinity
)
$handle = $Process.Handle
$processAffinityMask = 0
$systemAffinityMask = 0
for ($i = 0; $i -lt $Affinity.Length; $i++) {
$cpu = $Affinity[$i]
$processAffinityMask = $processAffinityMask -bor [int](1 -shl $cpu)
$systemAffinityMask = $systemAffinityMask -bor [int](1 -shl $cpu)
}
$success = [Kernel32]::SetProcessAffinityMask($handle, $processAffinityMask)
if (-not $success) {
Write-Error "Unable to set process affinity."
}
$success = [Kernel32]::SetProcessAffinityMask($handle, $systemAffinityMask)
if (-not $success) {
Write-Error "Unable to set system affinity."
}
}
Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;
public class Kernel32 {
[DllImport("kernel32.dll", SetLastError = true)]
public static extern bool SetProcessAffinityMask(IntPtr handle, IntPtr affinityMask);
}
"@
$cpuAffinity = 0
$eac = Get-Process -Name "EasyAntiCheat_EOS" -ErrorAction SilentlyContinue
if ($null -ne $eac) {
Set-ProcessCpuAffinity -Process $eac -Affinity $cpuAffinity
$priorityClass = [System.Diagnostics.ProcessPriorityClass]::Idle
$eac.PriorityClass = $priorityClass
if ($eac.PriorityClass -eq $priorityClass) {
Write-Host "EasyAntiCheat_EOS.exe is set to $($eac.PriorityClass)"
} else {
Write-Error "Failed to set the priority category for EasyAntiCheat_EOS.exe."
}
} else {
Write-Host "EasyAntiCheat_EOS.exe is not running. Please start the Elden Ring."
}
Write-Host ""
Write-Host "The script has completed."
Write-Host "If you want the script to automatically exit, add the '#' symbol before 'Read Host'"
Read-Host -Prompt "Press Enter to quit"
脚本二:设置艾尔登法环进程的CPU优先级.bat
REM 适用于Windows系统
REM @时间 : 2024-06-30
REM @作者 : 三巧(https://blog.csdn.net/qq_39124701)
REM @文章链接: https://blog.csdn.net/qq_39124701/article/details/140038965
REM @文件名 : 设置艾尔登法环进程的CPU优先级.bat
REM @使用方法: 打开记事本,将所有代码复制到记事本中,保存文件时修改文件后缀为".bat"(文件的编码方式选择UTF-8)。
REM 双击该文件后输入选项即可。
@echo off
:Menu
cls
echo Select an option:
echo 1. Set Registry Key(set the CPU priority of the EldenRing to high)
echo 2. Delete Registry Key(restore default)
echo 3. Exit
echo.
echo Enter your choice (1-3):
set /p choice=""
if "%choice%"=="1" goto SetRegistry
if "%choice%"=="2" goto DeleteRegistry
if "%choice%"=="3" goto End
echo. & echo Invalid choice. Please try again.
pause
goto Menu
:SetRegistry
cls
echo Setting registry key...
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\eldenring.exe\PerfOptions" /v "CpuPriorityClass" /t REG_DWORD /d 0x00000003 /f
if %errorlevel% == 0 (
echo Registry key added/modified successfully.
) else (
echo Failed to add/modify registry key.
)
echo.
pause
goto Menu
:DeleteRegistry
cls
echo Deleting registry key...
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\eldenring.exe\PerfOptions" /v "CpuPriorityClass" /f
if %errorlevel% == 0 (
echo Registry key deleted successfully.
) else (
echo Failed to delete registry key.
)
echo.
pause
goto Menu
:End
echo.
pause
exit
脚本三:设置艾尔登法环进程的CPU优先级.vbs
Option Explicit
Dim objShell
Set objShell = CreateObject("WScript.Shell")
Const strRegPath = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\eldenring.exe\PerfOptions"
On Error Resume Next
Dim strValue
strValue = objShell.RegRead(strRegPath & "\CpuPriorityClass")
If Err.Number <> 0 Then
Err.Clear
strValue = "未设置"
End If
On Error GoTo 0
Dim CpuPriorityClassValue
If strValue = "4" Then
CpuPriorityClassValue = "当前艾尔登法环进程的CPU优先级为'实时', 这是错误的设置, 建议设置为'正常'或者'高'。"
ElseIf strValue = "3" Then
CpuPriorityClassValue = "当前艾尔登法环进程的CPU优先级为'高', 建议保持不变或设置为'正常'。"
ElseIf strValue = "6" Then
CpuPriorityClassValue = "当前艾尔登法环进程的CPU优先级为'高于正常'。"
ElseIf strValue = "2" Then
CpuPriorityClassValue = "当前艾尔登法环进程的CPU优先级为'正常'。"
ElseIf strValue = "5" Then
CpuPriorityClassValue = "当前艾尔登法环进程的CPU优先级为'低于正常', 建议设置为'正常'或者'高'。"
ElseIf strValue = "1" Then
CpuPriorityClassValue = "当前艾尔登法环进程的CPU优先级为'低', 这是不建议的设置, 建议设置为'正常'或者'高'。"
Else
CpuPriorityClassValue = "未设置或获取失败, 建议保持不变或设置为'高'。strValue:" & strValue
End If
Dim userChoice
userChoice = MsgBox(CpuPriorityClassValue & vbCrLf & vbCrLf & "点击' 是 ', 设置艾尔登法环进程的CPU优先级为'高'。" & vbCrLf & "点击' 否 ', 恢复默认。" & vbCrLf & "点击'取消', 直接退出。", vbYesNoCancel, "设置注册表中艾尔登法环进程的CPU优先级")
If userChoice = vbYes Then
On Error Resume Next
objShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\eldenring.exe\PerfOptions" & "\" & "CpuPriorityClass", "3", "REG_DWORD"
If Err.Number <> 0 Then
MsgBox "无法设置注册表值。错误号: " & Err.Number & ", 描述: " & Err.Description, vbCritical, "错误"
Err.Clear
Else
MsgBox "已设置艾尔登法环进程的CPU优先级为'高'。", vbInformation, "成功"
End If
On Error GoTo 0
ElseIf userChoice = vbNo Then
On Error Resume Next
objShell.RegDelete strRegPath & "\CpuPriorityClass"
If Err.Number <> 0 Then
MsgBox "无法删除注册表值。错误号: " & Err.Number & ", 描述: " & Err.Description, vbCritical, "错误"
Err.Clear
Else
MsgBox "已恢复默认。", vbInformation, "成功"
End If
On Error GoTo 0
Else
WScript.Quit
End If
Set objShell = Nothing
