@@ -98,15 +98,13 @@ pause>NUL|echo Press any key to exit . . .
98
98
exit
99
99
100
100
101
-
102
101
:: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
103
102
:: ::
104
103
:: FUNCTIONS ::
105
104
:: ::
106
105
:: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
107
106
:function_banner
108
107
cls
109
- rem chcp 850> NUL
110
108
echo .
111
109
echo [44;4m [0m
112
110
echo [104m [0m
@@ -118,6 +116,7 @@ echo.
118
116
goto :EOF
119
117
120
118
:function_search_imput
119
+ set Search =
121
120
:: ImputTextBox / for multiline bypass characters like: ,;)=
122
121
for /f " tokens=1-9 delims=[]" %% 1 in ('^
123
122
powershell -Command^
@@ -174,17 +173,19 @@ for /f "tokens=1-9 delims=[]" %%1 in ('^
174
173
if " %Search% " == " TEXTBOX_IS_EMPTY" call :function_banner&call :function_search_imput
175
174
if " %Search% " == " PRESSED_X_TO_EXIT" exit
176
175
176
+
177
177
:SEARCH_GAME
178
178
echo .
179
179
echo [ ] Searching game . . .
180
- chcp 65001 > NUL
180
+ rem chcp 65001> NUL
181
+ set GameAppID = & set GameName=
181
182
set " Search = %Search:& =% "
182
- set " Search = %Search: = % "
183
183
set " Search = %Search:' =% "
184
+ set " Search = %Search: = % "
184
185
for /f " tokens=*" %%a in ('powershell -Command " '%Search% '.ToLower()" ') do set " game = %%a "
185
186
set " steamgame = %game: =+ % "
186
187
187
- set GameAppID = & set GameName=
188
+
188
189
Tools\CURL\curl.exe -s --config Tools/CURL/config/safari15_5.config --header @ Tools/CURL/config/safari15_5.header --url " https://www.google.com/search?q=%steamgame% +steamdb" -o google.html
189
190
powershell -Command " (gc -LiteralPath '%HOME% google.html') -replace '<div><span jscontroller', \" `r`n^ < GAME^ > ^ < \" -replace 'href=" " ', '><' -replace '" " " " data-', 'game><data' -replace \" '\" , '' -replace '\\', '' -replace '\|', '' -replace '\?', '' -replace '\*', '' -replace '" " ', '' -replace ''', '' -replace '&', '' -replace ''', '' | Out-File -LiteralPath '%HOME% google.html' -NoNewline -encoding Default" > NUL
190
191
for /f " tokens=1-9 delims=<>" %% 1 in (google.html) do (
@@ -215,6 +216,8 @@ set "GameName=%GameName:<=%"
215
216
set " GameName = %GameName:> =% "
216
217
set " GameName = %GameName:/ =% "
217
218
set " GameName = %GameName:: =% "
219
+ set " GameName = %GameName: = % "
220
+ echo [90m%GameName% (%GameAppID% )[0m
218
221
219
222
:SHOW_IMAGE
220
223
Tools\CURL\curl.exe -s " https://cdn.akamai.steamstatic.com/steam/apps/%GameAppID% /header.jpg" -o " %GameAppID% .jpg"
@@ -317,7 +320,7 @@ if "%searchAnswer%"=="6" goto :ONLINE
317
320
if " %searchAnswer% " == " 7" (
318
321
if exist " configs.app.ini" del " configs.app.ini" > NUL
319
322
if not " %total% " == " 0" echo [app::dlcs]> configs.app.ini& >> configs.app.ini echo unlock_all=0
320
- for /f " tokens=* skip=1 " %%a in ( Database\%GameAppID% .ini) do echo " %%a " | powershell -Command " $input.substring(1) - replace '.{2}$' -replace ' = ', '='" >> configs.app.ini
323
+ powershell -Command " (gc -LiteralPath ' %HOME% Database\%GameAppID% .ini') - replace ' = ', '=' | Select-Object -Skip 1 " >> configs.app.ini
321
324
if exist " %GameAppID% .json" del " %GameAppID% .json" > NUL
322
325
if exist " configs.app.ini" move " configs.app.ini" " %GameName% \steam_settings\configs.app.ini" > NUL
323
326
echo [x] Done!
@@ -515,21 +518,11 @@ echo [ ] Searching achievements . . .
515
518
for /f " tokens=*" %%a in ('mshta.exe " %HOME% Tools\GSE_achievements_language.hta" " %GameName% \steam_settings\supported_languages.txt" ') do set AchievementsLanguage = %%a
516
519
:: get achievements from steam
517
520
Tools\CURL\curl.exe -s -H " Accept-Language: %AchievementsLanguage% " -XGET " https://steamcommunity.com/stats/%GameAppID% /achievements/" > steamachievements.html
518
- rem powershell -Command "(gc -LiteralPath '%HOME%steamachievements.html') -replace ''', \"'\" -replace '&', '&' -replace '"', 'lee.aspas' -replace ' ', '' -replace '< div class=\"achieveImgHolder\"> ', \"`r`n^< ACHIEVEMENT^> \" | Out-File -LiteralPath '%HOME%steamachievements.html' -NoNewline -encoding Default"> NUL
519
- rem powershell -Command "(gc -LiteralPath '%HOME%steamachievements.html') -replace '< img src=.+/%GameAppID%/', '< ' -replace '"" width=.+ class=\"achievePercent\"> ', '>< ' | Out-File -LiteralPath '%HOME%steamachievements.html' -encoding Default"> NUL
520
- rem powershell -Command "(gc -LiteralPath '%HOME%steamachievements.html') -replace '< /div>< div class=\"achieveTxt\">< h3> ', '>< ' -replace '< h5>< /h5> .+achieveRow ""> ', '< > ' -replace '< /h3>< h5> ', '>< ' -replace '< /h3> ', '> ' -replace '< /h5> .+ class=\"achieveRow \"', '' -replace '< /h5> .+< /html> ', '> ' | Out-File -LiteralPath '%HOME%steamachievements.html' -encoding Default"> NUL
521
- rem powershell -Command "(gc -LiteralPath '%HOME%steamachievements.html' | Select-Object -Skip 1) | Out-File -LiteralPath '%HOME%steamachievements.html' -encoding Default"> NUL
522
521
powershell -Command " (gc -LiteralPath '%HOME% steamachievements.html') -replace ''', \" '\" -replace '&', '&' -replace '"', 'lee.aspas' -replace ' ', '' | Out-File -LiteralPath '%HOME% steamachievements.html' -NoNewline -encoding Default" > NUL
523
522
powershell -Command " (gc -LiteralPath '%HOME% steamachievements.html') -replace 'images/apps/%GameAppID% /', \" `r`n^ < ACHIEVEMENT^ > ^ < \" -replace '(.jpg)(.*)(\" achievePercent\" >)', '.jpg><' -replace '(</div>)(.*)(<h3>)', '><' -replace '</h3><h5>', '><' -replace '<</h5>.*', '< >' -replace '</h5>.*', '>' | Out-File -LiteralPath '%HOME% steamachievements.html' -encoding Default"
524
523
powershell -Command " (gc -LiteralPath '%HOME% steamachievements.html' | Select-Object -Skip 1) | Out-File -LiteralPath '%HOME% steamachievements.html' -encoding Default" > NUL
525
-
526
-
527
524
:: get achievements from steamdb
528
525
Tools\CURL\curl.exe -s --config Tools/CURL/config/safari15_5.config --header @ Tools/CURL/config/safari15_5.header --url " https://steamdb.info/app/%GameAppID% /stats/" -o steamdbachievements.html
529
- rem powershell -Command "(gc -LiteralPath '%HOME%steamdbachievements.html') -replace ''', \"'\" -replace '&', '&' -replace '"', 'lee.aspas' -replace '< tr id=""achievement-.+""> ', \"`r`n^< ACHIEVEMENT^> \" | Out-File -LiteralPath '%HOME%steamdbachievements.html' -NoNewline -encoding Default"> NUL
530
- rem powershell -Command "(gc -LiteralPath '%HOME%steamdbachievements.html') -replace '< /td>< td> ', '>< ' -replace '< td> ', '< ' -replace '< p class=\"i\"> ', '>< ' -replace '< /p>><< img src=\"/static/img/appicon.svg\" data-name=""', '>< ' -replace '< svg .+ Hidden.', ' ' | Out-File -LiteralPath '%HOME%steamdbachievements.html' -encoding Default"> NUL
531
- rem powershell -Command "(gc -LiteralPath '%HOME%steamdbachievements.html') -replace '\" width=.+ data-name=\"', '>< ' -replace '"" width=.+ alt>< /td>< /tr> ', '> ' -replace '< /tbody> .+< /html> ', '' | Out-File -LiteralPath '%HOME%steamdbachievements.html' -encoding Default"> NUL
532
- rem powershell -Command "(gc -LiteralPath '%HOME%steamdbachievements.html' | Select-Object -Skip 1) | Out-File -LiteralPath '%HOME%steamdbachievements.html' -encoding Default"> NUL
533
526
powershell -Command " (gc -LiteralPath '%HOME% steamdbachievements.html') -replace ''', \" '\" -replace '&', '&' -replace '"', 'lee.aspas' -replace '<tr id=" " achievement-.+" " >', \" `r`n^ < ACHIEVEMENT^ > \" | Out-File -LiteralPath '%HOME% steamdbachievements.html' -NoNewline -encoding Default" > NUL
534
527
powershell -Command " (gc -LiteralPath '%HOME% steamdbachievements.html') -replace '<ACHIEVEMENT><td>', '<ACHIEVEMENT><' -replace '</td><td>', '><' -replace '<p class=\" i\" >', '><' | Out-File -LiteralPath '%HOME% steamdbachievements.html' -encoding Default" > NUL
535
528
powershell -Command " (gc -LiteralPath '%HOME% steamdbachievements.html') -replace '.jpg\" width.* data-name=\" ', '.jpg><' -replace '<<svg width.* data-name=" " ', '< ><' -replace '</p>><<.* data-name=" " " " ', '><' -replace '.jpg" " width.*', '.jpg>' | Out-File -LiteralPath '%HOME% steamdbachievements.html' -encoding Default" > NUL
@@ -549,6 +542,8 @@ set NEW_ACHIEVEMENT=
549
542
set /a count = 0
550
543
for /f " tokens=1-9 delims=<>" %% 1 in (steamdbachievements.html) do (
551
544
if " %% 1" == " ACHIEVEMENT" (
545
+ set LANG_description =
546
+ set LANG_displayName =
552
547
if " !count! " == " 0" (
553
548
if exist " %GameName% \steam_settings\achievements.json" del " %GameName% \steam_settings\achievements.json" > NUL
554
549
powershell -Command " Add-Content '[' -LiteralPath '%HOME%%G ameName% \steam_settings\achievements.json' -encoding UTF8"
@@ -579,6 +574,8 @@ for /f "tokens=1-9 delims=<>" %%1 in (steamdbachievements.html) do (
579
574
set " LANG_Echoachdesc = !LANG_achdesc:& =lee.and ! "
580
575
)
581
576
)
577
+ if " !LANG_description! " == " " set LANG_description = !ENG_description!
578
+ if " !LANG_displayName! " == " " set LANG_displayName = !ENG_displayName!
582
579
set /a count += 1
583
580
call :function_progress " [90m[!count! /!total! ] [94m!globalstatistics! [92m!ENG_EchoachName! "
584
581
>> " %GameName% \steam_settings\achievements.json" (
@@ -590,9 +587,9 @@ for /f "tokens=1-9 delims=<>" %%1 in (steamdbachievements.html) do (
590
587
echo " icongray" : " images/!icongray! " ,
591
588
echo " name" : " !name! "
592
589
)
593
- if not exist " %GameName% \steam_settings\images" mkdir " %GameName% \steam_settings\images"
594
- if not exist " %GameName% \steam_settings\images\!icon! " Tools\CURL\curl.exe -s " https://cdn.akamai.steamstatic.com/steamcommunity/public/images/apps/%GameAppID% /!icon! " -o " %GameName% \steam_settings\images\!icon! "
595
- if not exist " %GameName% \steam_settings\images\!icongray! " Tools\CURL\curl.exe -s " https://cdn.akamai.steamstatic.com/steamcommunity/public/images/apps/%GameAppID% /!icongray! " -o " %GameName% \steam_settings\images\!icongray! "
590
+ if not exist " %GameName% \steam_settings\images" mkdir " %GameName% \steam_settings\images" > NUL
591
+ if not exist " %GameName% \steam_settings\images\!icon! " Tools\CURL\curl.exe -s " https://cdn.akamai.steamstatic.com/steamcommunity/public/images/apps/%GameAppID% /!icon! " -o " !icon! " & move " !icon! " " %GameName% \steam_settings\images\" > NUL
592
+ if not exist " %GameName% \steam_settings\images\!icongray! " Tools\CURL\curl.exe -s " https://cdn.akamai.steamstatic.com/steamcommunity/public/images/apps/%GameAppID% /!icongray! " -o " !icongray! " & move " !icongray! " " %GameName% \steam_settings\images\" > NUL
596
593
if " !count! " == " !total! " (echo }>> " %GameName% \steam_settings\achievements.json" ) else (echo },>> " %GameName% \steam_settings\achievements.json" )
597
594
)
598
595
)
@@ -631,10 +628,10 @@ powershell -Command "[Console]::CursorTop=%PROGRESSBACKTOLINE%"
631
628
goto :EOF
632
629
633
630
:function_script_toast
634
- chcp 65001 > NUL
631
+ rem chcp 65001> NUL
635
632
for /f " tokens=*" %%a in ('powershell -Command " (gc -LiteralPath '%HOME% Tools\ACHIVEMENTS\achievements.json' | ConvertFrom-Json).%TOASTNAME% .earned" ') do set " AchivementEarned = %%a "
636
633
if " %AchivementEarned% " == " False" (
637
- chcp 1252 > NUL
634
+ rem chcp 1252> NUL
638
635
for /f " tokens=*" %%a in ('powershell -Command " (gc -LiteralPath '%HOME% Tools\ACHIVEMENTS\achievements.json' | ConvertFrom-Json).%TOASTNAME% .displayName" ') do set " AchivementName = %%a "
639
636
for /f " tokens=*" %%a in ('powershell -Command " (gc -LiteralPath '%HOME% Tools\ACHIVEMENTS\achievements.json' | ConvertFrom-Json).%TOASTNAME% .description" ') do set " AchivementDescription = %%a "
640
637
for /f " tokens=*" %%a in ('powershell -Command " (gc -LiteralPath '%HOME% Tools\ACHIVEMENTS\achievements.json' | ConvertFrom-Json).%TOASTNAME% .icon" ') do set " AchivementImage = %HOME% Tools\ACHIVEMENTS\%%a "
@@ -647,7 +644,7 @@ goto :EOF
647
644
:function_test_achievements_file
648
645
echo .
649
646
echo [ ] Showing achievements . . .
650
- chcp 65001 > NUL
647
+ rem chcp 65001> NUL
651
648
set /a total = 0
652
649
for /f " tokens=1-9 delims= : usebackq" %%a in (" %FileDir% achievements.json" ) do if " %%a " == " " name" " (set /a total+=1)
653
650
setlocal enabledelayedexpansion
0 commit comments