Skip to content

Commit 1b7897b

Browse files
committed
Output more information
1 parent a7ca71e commit 1b7897b

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

‎TarkovSpawnNotifier.ps1‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ $eft = "D:\Battlestate Games\eft\Logs"
66

77
##################################################
88

9-
Write-Host "Escape From Tarkov Spawn Notifier`r`n © 2021 advanced_bear" -ForegroundColor Cyan
9+
Write-Host "Escape From Tarkov Spawn Notifier`r`n © 2021-2023 advanced_bear" -ForegroundColor Cyan
1010

1111
if(-not(Test-Path $eft)) {
1212
Write-Host "------------- ERROR -------------" -ForegroundColor White -BackgroundColor Red
@@ -26,6 +26,7 @@ $notify.visible = $true
2626
## Define Target Log File (Latest "trace.log")
2727
$latest = (Get-ChildItem $eft | Sort-Object LastWriteTime -Descending)[0].FullName
2828
$target = (Get-ChildItem $latest\*traces*.log | Sort-Object LastWriteTime -Descending)[0].FullName
29+
2930
## Reading Tail line for Monitoring
3031
Write-Host "----------- Activated -----------" -ForegroundColor White -BackgroundColor DarkCyan
3132
Get-Content -Wait -Tail 10 -Path $target | ForEach-Object {
@@ -37,9 +38,19 @@ Get-Content -Wait -Tail 10 -Path $target | ForEach-Object {
3738
Write-Host "$now`tGame Starting!"
3839
$notify.showballoontip(10,'Tarkov Spawn Notifier','Game Starting!',[system.windows.forms.tooltipicon]::None)
3940
} elseif ($_ -like "*profileStatus*") {
40-
$_ -match "(Location: .*?)," > $null
41+
$_ -match "Location: (.*?)," > $null
4142
$Location = $Matches[1]
42-
Write-Host "$now`t$Location"
43+
Write-Host "$now`tLocation : $($Location)"
44+
$_ -match "Ip: (\d+\.\d+\.\d+\.\d+)" > $null
45+
$ProgressPreference = "SilentlyContinue"
46+
$TestResult = $(ping -w 500 -n 10 $Matches[1] | Select-Object -Last 4)
47+
$WhoisResult = Invoke-RestMethod "http://rdap.db.ripe.net/ip/$($Matches[1])"
48+
$Registrant = $WhoisResult.entities | Where-Object {$_.roles -match "registrant"}
49+
Write-Host "$now`t-------Tarkov Server Information-------"
50+
Write-Host "`t`t`tServer IPaddr : $($Matches[1])"
51+
Write-Host "`t`t`tServer Country: $($WhoisResult.country)"
52+
Write-Host "`t`t`tRatency (Ping): $($TestResult[3].Trim())"
53+
Write-Host "`t`t`tPacket Loss : $($TestResult[1].Trim())"
4354
} elseif ($_ -like "*ClientMetricsEvents*") {
4455
Write-Host "$now`tStart Match Making!"
4556
} elseif ($_ -like "*PlayerSpawnEvent*") {

0 commit comments

Comments
 (0)