塔防:kingdom-rush
差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录前一修订版后一修订版 | 前一修订版 | ||
塔防:kingdom-rush [2024/06/29 09:50] – 移除 - 外部编辑 (未知日期) 127.0.0.1 | 塔防:kingdom-rush [2024/06/29 09:51] (当前版本) – [2~4代一键满经验值] bluequilt | ||
---|---|---|---|
行 1: | 行 1: | ||
+ | ======Kingdom Rush====== | ||
+ | =====2~4代一键满经验值===== | ||
+ | 用python运行如下代码,注意需先安装'' | ||
+ | <code python> | ||
+ | import lxml.etree | ||
+ | import re | ||
+ | from pathlib import Path | ||
+ | from os import environ as ENVIRON | ||
+ | from itertools import chain | ||
+ | |||
+ | |||
+ | def new_document(text, | ||
+ | """ | ||
+ | if isinstance(text, | ||
+ | text = text.decode(encoding, | ||
+ | text = text.replace(" | ||
+ | return lxml.etree.XML(text, | ||
+ | |||
+ | |||
+ | def kr23(): | ||
+ | root_dir2 = Path(ENVIRON[" | ||
+ | root_dir2.mkdir(parents=True, | ||
+ | root_dir3 = Path(ENVIRON[" | ||
+ | root_dir3.mkdir(parents=True, | ||
+ | save_file_pattern = " | ||
+ | for path in chain( | ||
+ | root_dir2.glob(save_file_pattern), | ||
+ | ): | ||
+ | text = path.read_text(" | ||
+ | text = re.sub(r" | ||
+ | path.write_text(text, | ||
+ | |||
+ | |||
+ | def kr4(): | ||
+ | root_dir = Path(ENVIRON[" | ||
+ | root_dir.mkdir(parents=True, | ||
+ | for path in root_dir.glob(" | ||
+ | root = new_document(path.read_text(" | ||
+ | all_exps_nodes = root.xpath( | ||
+ | '// | ||
+ | ) | ||
+ | for node in all_exps_nodes: | ||
+ | node.text = " | ||
+ | path.write_bytes(lxml.etree.tostring(root, | ||
+ | |||
+ | |||
+ | kr23() | ||
+ | kr4() | ||
+ | </ |