Fix passenger and videorecord

This commit is contained in:
BubbaGumpShrump 2024-12-10 00:13:25 -05:00
parent ea0f18f919
commit 23bee3925f
4 changed files with 5 additions and 7 deletions

View file

@ -23,7 +23,6 @@
<None Remove="config.ini" />
<None Remove="Fonts\Orbitron-Bold.ttf" />
<None Remove="Fonts\Roboto-Regular.ttf" />
<None Remove="kill-log.csv" />
<None Remove="KillTrackR_MainScript.ps1" />
</ItemGroup>
@ -69,7 +68,6 @@
<Resource Include="Fonts\Roboto-Regular.ttf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="kill-log.csv" />
<EmbeddedResource Include="KillTrackR_MainScript.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>

View file

@ -219,7 +219,7 @@ function Read-LogEntry {
if ($ship -notmatch $shipManPattern){
$ship = "Player"
}
If ($enemyShip -notmatch $shipManPattern) {
If ($enemyShip -notmatch $shipManPattern -or $enemyShip -notlike "Passenger" ) {
$enemyShip = "Player"
}
@ -359,7 +359,7 @@ function Read-LogEntry {
}
# Record video
if ($recording -eq $true -and $enemyShip -ne "Passenger"){
if ($videoRecord -eq $true -and $enemyShip -ne "Passenger"){
# send keybind for windows game bar recording
Start-Sleep 2
$sleeptimer = $sleeptimer -9
@ -367,10 +367,10 @@ function Read-LogEntry {
Start-Sleep 7
$latestFile = Get-ChildItem -Path $videoPath | Where-Object { -not $_.PSIsContainer } | Sort-Object CreationTime -Descending | Select-Object -First 1
# Check if the latest file is no more than 10 seconds old
# Check if the latest file is no more than 30 seconds old
if ($latestFile) {
$fileAgeInSeconds = (New-TimeSpan -Start $latestFile.CreationTime -End (Get-Date)).TotalSeconds
if ($fileAgeInSeconds -le 10) {
if ($fileAgeInSeconds -le 30) {
# Generate a timestamp in ddMMMyyyy-HH:mm format
$timestamp = (Get-Date).ToString("ddMMMyyyy-HHmm")

View file

@ -189,7 +189,7 @@ namespace AutoTrackR2
var processStartInfo = new System.Diagnostics.ProcessStartInfo
{
FileName = "msiexec",
Arguments = $"/i \"{installerPath}\" /norestart", // Silent install with no restart
Arguments = $"/i \"{installerPath}\" /norestart REINSTALLMODE=amus", // Silent install with no restart
UseShellExecute = true, // Ensures that the process runs in the background
CreateNoWindow = true // Hides the command prompt window
};