<# Watches the Windows clipboard and posts new Path of Exile 2 item dumps (Ctrl+C in-game) to the POE2 Tracker as they appear. Usage: powershell -ExecutionPolicy Bypass -File tools\watch-clipboard.ps1 powershell -ExecutionPolicy Bypass -File tools\watch-clipboard.ps1 -Url "http://poe2tracker.test/stash" Leave the window open while you play. Ctrl+C in this console to stop. #> param( [string]$Url = 'https://poe2tracker.app/stash', [int]$IntervalMs = 50 ) $lastClipboard = $null Write-Host "Watching clipboard for POE2 items..." -ForegroundColor Cyan Write-Host "Posting to: $Url" -ForegroundColor Cyan Write-Host "Press Ctrl+C to stop." -ForegroundColor DarkGray Write-Host '' while ($true) { $current = $null try { $current = Get-Clipboard -Raw -ErrorAction SilentlyContinue } catch { $current = $null } if ($current -and $current -ne $lastClipboard) { $lastClipboard = $current if ($current -match 'Item Class:') { try { $payload = @{ clipboard = $current } | ConvertTo-Json $response = Invoke-RestMethod -Uri $Url -Method Post ` -ContentType 'application/json; charset=utf-8' ` -Headers @{ Accept = 'application/json' } ` -Body $payload Write-Host "[+] $($response.message)" -ForegroundColor Green } catch { Write-Host "[!] Failed to add item: $($_.Exception.Message)" -ForegroundColor Red } } } Start-Sleep -Milliseconds $IntervalMs }