From 51b7ea59143eb8668c7572720566a4a1923d4cea Mon Sep 17 00:00:00 2001 From: lonelywolf <13281126@qq.com> Date: Sun, 5 Oct 2025 11:15:41 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20builder/createfilters.bat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- builder/createfilters.bat | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/builder/createfilters.bat b/builder/createfilters.bat index aff31fb..e78e850 100644 --- a/builder/createfilters.bat +++ b/builder/createfilters.bat @@ -1,5 +1,32 @@ -"..\Loong_Li_icon.txt" -type 00-Top-Version.txt 01-Aliases.txt 02-rename_D2R_icon.txt 03-tag_general_icon.txt 04-nmag_bases.txt 05-nmag_stuffmod.txt 06-nmag_runeword.txt 07-nmag_sockets.txt 08-note_uni.txt 09-note_set.txt 10-note_RW.txt 11-note_MagRare.txt 12-note_nofreezing.txt 13-!nmag_corrupt.txt 14-!nmag_Skilleffects.txt 15-!nmag_sockets.txt 16-!nmag_upgrade.txt 17-tag_weapon_range.txt 18-tag_setfoots_kickdmg.txt 19-tag_craft_alvl.txt 20-tag_PD2misc.txt 21-tag_maps.txt 22-tag_ubermats.txt 23-tag_EssencesToken.txt 24-tag_Craft_Infusion.txt 25-note_shopping.txt 26-note_events_gamble.txt 27-note_reroll_jewels.txt 28-filter_misc.txt 29-filter_RuneGem.txt 30-filter_cham.txt 31-filter_Uni.txt 32-filter_set.txt 33-filter_rare.txt 34-filter_mag.txt 35-filter_bases_CraftInfusion.txt 36-filter_bases_RW.txt 37-filter_leveling.txt 38-footers.txt> "..\Loong_Li_icon.txt" -"..\Loong_Li_legacy.txt" -type 00-Top-Version.txt 01-Aliases.txt 02-rename_Legacy.txt 03-tag_general_Legacy.txt 04-nmag_bases.txt 05-nmag_stuffmod.txt 06-nmag_runeword.txt 07-nmag_sockets.txt 08-note_uni.txt 09-note_set.txt 10-note_RW.txt 11-note_MagRare.txt 12-note_nofreezing.txt 13-!nmag_corrupt.txt 14-!nmag_Skilleffects.txt 15-!nmag_sockets.txt 16-!nmag_upgrade.txt 17-tag_weapon_range.txt 18-tag_setfoots_kickdmg.txt 19-tag_craft_alvl.txt 20-tag_PD2misc.txt 21-tag_maps.txt 22-tag_ubermats.txt 23-tag_EssencesToken.txt 24-tag_Craft_Infusion.txt 25-note_shopping.txt 26-note_events_gamble.txt 27-note_reroll_jewels.txt 28-filter_misc.txt 29-filter_RuneGem.txt 30-filter_cham.txt 31-filter_Uni.txt 32-filter_set.txt 33-filter_rare.txt 34-filter_mag.txt 35-filter_bases_CraftInfusion.txt 36-filter_bases_RW.txt 37-filter_leveling.txt 38-footers.txt> "..\Loong_Li_legacy.txt" +type 00-Top-Version.txt 01-Aliases.txt 02-rename_D2R_icon.txt 03-tag_general_icon.txt 04-nmag_bases.txt 05-nmag_stuffmod.txt 06-nmag_runeword.txt 07-nmag_sockets.txt 08-note_uni.txt 09-note_set.txt 11-note_MagRare.txt 12-note_nofreezing.txt 13-!nmag_corrupt.txt 14-!nmag_Skilleffects.txt 15-!nmag_sockets.txt 16-!nmag_upgrade.txt 17-tag_weapon_range.txt 18-tag_setfoots_kickdmg.txt 19-tag_craft_alvl.txt 20-tag_PD2misc.txt 21-tag_maps.txt 22-tag_ubermats.txt 23-tag_EssencesToken.txt 24-tag_Craft_Infusion.txt 25-note_shopping.txt 26-note_events_gamble.txt 27-note_reroll_jewels.txt 28-filter_misc.txt 29-filter_RuneGem.txt 30-filter_cham.txt 31-filter_Uni.txt 32-filter_set.txt 33-filter_rare.txt 34-filter_mag.txt 35-filter_bases_CraftInfusion.txt 36-filter_bases_RW.txt 37-filter_leveling.txt 38-footers.txt> "..\Loong_Li_icon.txt" +type 00-Top-Version.txt 01-Aliases.txt 02-rename_Legacy.txt 03-tag_general_Legacy.txt 04-nmag_bases.txt 05-nmag_stuffmod.txt 06-nmag_runeword.txt 07-nmag_sockets.txt 08-note_uni.txt 09-note_set.txt 11-note_MagRare.txt 12-note_nofreezing.txt 13-!nmag_corrupt.txt 14-!nmag_Skilleffects.txt 15-!nmag_sockets.txt 16-!nmag_upgrade.txt 17-tag_weapon_range.txt 18-tag_setfoots_kickdmg.txt 19-tag_craft_alvl.txt 20-tag_PD2misc.txt 21-tag_maps.txt 22-tag_ubermats.txt 23-tag_EssencesToken.txt 24-tag_Craft_Infusion.txt 25-note_shopping.txt 26-note_events_gamble.txt 27-note_reroll_jewels.txt 28-filter_misc.txt 29-filter_RuneGem.txt 30-filter_cham.txt 31-filter_Uni.txt 32-filter_set.txt 33-filter_rare.txt 34-filter_mag.txt 35-filter_bases_CraftInfusion.txt 36-filter_bases_RW.txt 37-filter_leveling.txt 38-footers.txt> "..\Loong_Li_legacy.txt" +@echo off +setlocal enabledelayedexpansion + +:: === Configuration === +set "sourceFile=README.md" +set "keyword={{REPLACE_ME}}" +set "replacementFile=01-Version.filter" +set "finalFile=..\README.md" + +:: === Read the replacement text into a variable === +set "replacementText=" +for /f "usebackq delims=" %%A in ("%replacementFile%") do ( + set "line=%%A" + set "line=!line:%%CL%%= !" + set "replacementText=!replacementText!!line!\n" +) + +:: Remove trailing newline +set "replacementText=!replacementText:~0,-2!" + +:: === Replace keyword with replacement text === +> "%finalFile%" ( + for /f "usebackq delims=" %%A in ("%sourceFile%") do ( + set "line=%%A" + set "line=!line:%keyword%=%replacementText%!" + echo(!line! + ) +) +echo Done. "%keyword%" replaced in "%sourceFile%".