mirror of
https://github.com/BubbaGumpShrump/AutoTrackR2.git
synced 2025-05-15 22:05:31 +00:00
Bugfix + Theme
This commit is contained in:
parent
3bc70b77fd
commit
2d5d1f9f99
3 changed files with 19 additions and 4 deletions
|
@ -92,7 +92,7 @@
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</Resource>
|
</Resource>
|
||||||
<EmbeddedResource Include="KillTrackR_MainScript.ps1">
|
<EmbeddedResource Include="KillTrackR_MainScript.ps1">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,12 @@ namespace AutoTrackR2
|
||||||
public HomePage()
|
public HomePage()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
// Get the current month
|
||||||
|
string currentMonth = DateTime.Now.ToString("MMMM", CultureInfo.InvariantCulture);
|
||||||
|
|
||||||
|
// Set the TextBlock text
|
||||||
|
KillTallyTitle.Text = $"Kill Tally - {currentMonth}";
|
||||||
}
|
}
|
||||||
|
|
||||||
private Process runningProcess; // Field to store the running process
|
private Process runningProcess; // Field to store the running process
|
||||||
|
|
|
@ -108,11 +108,19 @@ $global:killTally = 0
|
||||||
# Load historic kills from csv
|
# Load historic kills from csv
|
||||||
if (Test-Path "$scriptFolder\Kill-Log.csv") {
|
if (Test-Path "$scriptFolder\Kill-Log.csv") {
|
||||||
$historicKills = Import-CSV "$scriptFolder\Kill-log.csv"
|
$historicKills = Import-CSV "$scriptFolder\Kill-log.csv"
|
||||||
|
$currentDate = Get-Date
|
||||||
|
$dateFormat = "dd MMM yyyy HH:mm UTC"
|
||||||
foreach ($kill in $historicKills) {
|
foreach ($kill in $historicKills) {
|
||||||
|
$killDate = [datetime]::parseExact($kill.KillTime, $dateFormat, $null)
|
||||||
|
If ($killdate.year -eq $currentDate.Year -and $killdate.month -eq $currentDate.Month) {
|
||||||
|
$global:killTally++
|
||||||
|
|
||||||
|
}
|
||||||
Try {
|
Try {
|
||||||
Write-Output "NewKill=throwaway,$($kill.EnemyPilot),$($kill.EnemyShip),$($kill.OrgAffiliation),$($kill.Enlisted),$($kill.RecordNumber),$($kill.KillTime), $($kill.PFP)"
|
Write-Output "NewKill=throwaway,$($kill.EnemyPilot),$($kill.EnemyShip),$($kill.OrgAffiliation),$($kill.Enlisted),$($kill.RecordNumber),$($kill.KillTime), $($kill.PFP)"
|
||||||
$global:killTally++
|
} Catch {
|
||||||
} Catch {Write-Output "Error Loading Kill: $($kill.EnemyPilot)"}
|
Write-Output "Error Loading Kill: $($kill.EnemyPilot)"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Write-Output "KillTally=$global:killTally"
|
Write-Output "KillTally=$global:killTally"
|
||||||
|
@ -198,7 +206,7 @@ function Read-LogEntry {
|
||||||
Stop-Process -Id $PID -Force
|
Stop-Process -Id $PID -Force
|
||||||
}
|
}
|
||||||
|
|
||||||
If ($enemyShip -eq $global:lastKill){
|
If ($enemyShip -eq $global:lastKill -and $global:lastKill -ne "Player"){
|
||||||
$enemyShip = "Passenger"
|
$enemyShip = "Passenger"
|
||||||
} Else {
|
} Else {
|
||||||
$global:lastKill = $enemyShip
|
$global:lastKill = $enemyShip
|
||||||
|
@ -217,6 +225,7 @@ function Read-LogEntry {
|
||||||
}
|
}
|
||||||
if ($damageType -like "*bullet*") {
|
if ($damageType -like "*bullet*") {
|
||||||
$ship = "Player"
|
$ship = "Player"
|
||||||
|
$enemyShip = "Player"
|
||||||
}
|
}
|
||||||
If ($ship -match $cleanupPattern){
|
If ($ship -match $cleanupPattern){
|
||||||
$ship = $matches[1]
|
$ship = $matches[1]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue