Kopion fix

This commit is contained in:
BubbaGumpShrump 2024-12-07 15:06:35 -05:00
parent b99965d245
commit 8d634dd20f

View file

@ -206,13 +206,21 @@ function Read-LogEntry {
$damageType = $matches['DamageType'] $damageType = $matches['DamageType']
$ship = $global:loadOut $ship = $global:loadOut
Try {
$page1 = Invoke-WebRequest -uri "https://robertsspaceindustries.com/citizens/$enemyPilot"
} Catch {
$page1 = $null
}
If ($null -ne $page1){
If ($enemyShip -eq $global:lastKill){ If ($enemyShip -eq $global:lastKill){
$enemyShip = "Passenger" $enemyShip = "Passenger"
} Else { } Else {
$global:lastKill = $enemyShip $global:lastKill = $enemyShip
} }
If (($player -eq $global:userName -and $enemyPilot -ne $global:userName) -and ($enemyPilot -notlike "PU_*" -and $enemyPilot -notlike "NPC_*")){ If ($player -eq $global:userName -and $enemyPilot -ne $global:userName){
If ($enemyShip -match $cleanupPattern){ If ($enemyShip -match $cleanupPattern){
$enemyShip = $matches[1] $enemyShip = $matches[1]
} }
@ -246,7 +254,7 @@ function Read-LogEntry {
} }
$KillTime = (Get-Date).ToUniversalTime().ToString("d MMM yyyy H:mm 'UTC'") $KillTime = (Get-Date).ToUniversalTime().ToString("d MMM yyyy H:mm 'UTC'")
$page1 = Invoke-WebRequest -uri "https://robertsspaceindustries.com/citizens/$enemyPilot"
# Get Enlisted Date # Get Enlisted Date
if ($($page1.content) -match $joinDatePattern) { if ($($page1.content) -match $joinDatePattern) {
@ -387,6 +395,7 @@ function Read-LogEntry {
Start-Sleep $sleeptimer Start-Sleep $sleeptimer
} }
} }
}
# Get Logged-in User # Get Logged-in User
If ($line -match $loginPattern) { If ($line -match $loginPattern) {