<# [License] This script is licensed under the GNU General Public License v3.0 (GPL-3.0). Copyright (C) 2026 Luzefiru #> Add-Type -AssemblyName System.Web $gamePath = $null $urlFound = $false $logFound = $false $folderFound = $false $err = "" $checkedDirectories = [System.Collections.Generic.HashSet[string]]::new([System.StringComparer]::OrdinalIgnoreCase) $originalErrorPreference = $ErrorActionPreference $IsAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) if ($IsAdmin) { Write-Host "Running as Administrator" -ForegroundColor DarkMagenta } else { Write-Host "Running as Normal User" -ForegroundColor DarkMagenta } $ErrorActionPreference = "SilentlyContinue" Write-Output "Attempting to find URL automatically..." $Script:collectedLogFiles = [System.Collections.Generic.List[PSCustomObject]]::new() function LogCheck { if (!(Test-Path $args[0])) { $folderFound = $false $logFound = $false return $folderFound, $logFound } else { $folderFound = $true } $gachaLogPath = $args[0] + '\Client\Saved\Logs\Client.log' $debugLogPath = $args[0] + '\Client\Binaries\Win64\ThirdParty\KrPcSdk_Global\KRSDKRes\KRSDKWebView\debug.log' $engineIniPath = $args[0] + '\Client\Saved\Config\WindowsNoEditor\Engine.ini' if (Test-Path $engineIniPath) { $engineIniContent = Get-Content $engineIniPath -Raw if ($engineIniContent -match '\[Core\.Log\][\r\n]+Global=(off|none)') { Write-Host "`nERROR: Logging disabled in Engine.ini." -ForegroundColor Red $confirmation = Read-Host "Attempt auto-fix? (Y/N)" if ($confirmation -notmatch '^[Yy]$') { exit } if (-NOT $IsAdmin) { Write-Warning "Administrator required." # --- REMOTE DOWNLOAD & EXECUTION DISABLED --- # $elevatedCommand = '-NoProfile -Command "iwr ... | iex"' # Start-Process powershell.exe -ArgumentList $elevatedCommand -Verb RunAs # exit # -------------------------------------------- Write-Host "Please restart PowerShell as Administrator and run THIS local script again." exit } Copy-Item $engineIniPath "$engineIniPath.backup" -Force $newContent = $engineIniContent -replace '\[Core\.Log\][^\[]*', '' Set-Content -Path $engineIniPath -Value $newContent Write-Host "Engine.ini fixed. Restart game and re-run script." exit } } if (Test-Path $gachaLogPath) { $logFound = $true $fileInfo = Get-Item $gachaLogPath $Script:collectedLogFiles.Add([PSCustomObject]@{ Path=$gachaLogPath Type='client' LastWriteTime=$fileInfo.LastWriteTime }) } if (Test-Path $debugLogPath) { $logFound = $true $fileInfo = Get-Item $debugLogPath $Script:collectedLogFiles.Add([PSCustomObject]@{ Path=$debugLogPath Type='debug' LastWriteTime=$fileInfo.LastWriteTime }) } return $folderFound, $logFound } function ExtractUrlFromLog { param([PSCustomObject]$logFile) $urlToCopy = $null if ($logFile.Type -eq 'client') { $gachaUrlEntry = Select-String -Path $logFile.Path -Pattern "https://aki-gm-resources(-oversea)?\.aki-game\.(net|com)/aki/gacha/index\.html#/record*" | Select-Object -Last 1 if ($gachaUrlEntry) { $urlToCopy = $gachaUrlEntry -replace '.*?(https://aki-gm-resources(-oversea)?\.aki-game\.(net|com)[^"]*).*','$1' } } elseif ($logFile.Type -eq 'debug') { $debugUrlEntry = Select-String -Path $logFile.Path -Pattern '"#url": "(https://aki-gm-resources(-oversea)?\.aki-game\.(net|com)/aki/gacha/index\.html#/record[^"]*)"' | Select-Object -Last 1 if ($debugUrlEntry) { $urlToCopy = $debugUrlEntry.Matches.Groups[1].Value } } return $urlToCopy } function SearchAllDiskLetters { $availableDrives = Get-PSDrive -PSProvider FileSystem | Select-Object -ExpandProperty Name foreach ($driveLetter in [char[]](65..90)) { if ($driveLetter -notin $availableDrives) { continue } $drive = "$($driveLetter):" $paths = @( "$drive\SteamLibrary\steamapps\common\Wuthering Waves", "$drive\Program Files\Epic Games\WutheringWavesj3oFh", "$drive\Wuthering Waves Game" ) foreach ($path in $paths) { if (!(Test-Path $path)) { continue } if ($checkedDirectories.Contains($path)) { continue } $checkedDirectories.Add($path) | Out-Null $folderFound, $logFound = LogCheck $path } } } SearchAllDiskLetters if ($Script:collectedLogFiles.Count -gt 0) { $sortedLogs = $Script:collectedLogFiles | Sort-Object LastWriteTime -Descending foreach ($logFile in $sortedLogs) { $urlToCopy = ExtractUrlFromLog $logFile if ($urlToCopy) { $urlFound = $true Write-Host "`nConvene Record URL: $urlToCopy" Set-Clipboard $urlToCopy Write-Host "Link copied to clipboard." break } } } if (!$urlFound -and !$IsAdmin) { Write-Host "Automatic detection failed." $retry = Read-Host "Retry as Administrator? (Y/N)" if ($retry -match '^[Yy]$') { # --- REMOTE DOWNLOAD & EXECUTION DISABLED --- # $elevatedCommand = '-NoProfile -Command "iwr ... | iex"' # Start-Process powershell.exe -ArgumentList $elevatedCommand -Verb RunAs # exit # -------------------------------------------- Write-Host "Please manually restart PowerShell as Administrator" Write-Host "and run THIS local script file again." exit } } $ErrorActionPreference = $originalErrorPreference if (!$urlFound) { Write-Host "URL not found. Make sure you opened Convene History in-game." }