Advertisement
SoMeGoD

CS2 Teleport Script - teleport_script_read_log.ps1

Dec 9th, 2023 (edited)
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # CS2 teleport script by SoMeGoD
  2. # Version 1.00
  3.  
  4. # Please refer to the installation guide where you found this file if you're having trouble
  5.  
  6. # CHANGE IF NEEDED - The path to YOUR "console.log" file
  7. $logFile = "C:\Steam\steamapps\common\Counter-Strike Global Offensive\game\csgo\console.log"
  8.  
  9. # CHANGE IF NEEDED - The path for the cfg file that will receive the "setpos" output. It's the same path as the path above + \cfg\ folder + file name
  10. $outFile = "C:\Steam\steamapps\common\Counter-Strike Global Offensive\game\csgo\cfg\teleport_script_setpos.cfg"
  11.  
  12. # DO NOT CHANGE!!! - Read the "console.log" file and get the last line that contains "setpos"
  13. $lastSetPosLine = Get-Content $logFile | Select-String "setpos" | Select-Object -Last 1
  14.  
  15. # DO NOT CHANGE!!! - Remove the date and time entries that is added by default from the "setpos" line
  16. $lastSetPosLine = $lastSetPosLine -replace '^\d{2}/\d{2} \d{2}:\d{2}:\d{2} ', ''
  17.  
  18. # DO NOT CHANGE!!! - Creates the cfg file (or replace if it already exists) and write the "setpos" value in it
  19. $lastSetPosLine | Set-Content $outFile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement