跳至内容
LTCTM的游戏wiki
用户工具
注册
登录
站点工具
搜索
工具
显示页面
过去修订
反向链接
最近更改
媒体管理器
网站地图
注册
登录
>
最近更改
媒体管理器
网站地图
您在这里:
LTCTM的游戏wiki主页
»
塔防
»
Kingdom Rush
塔防:kingdom-rush
本页面只读。您可以查看源文件,但不能更改它。如果您觉得这是系统错误,请联系管理员。
======Kingdom Rush====== =====2~4代一键满经验值===== 用python运行如下代码,注意需先安装''lxml''库 <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, encoding="utf-8", parser=None): """text: 可以是str或bytes。如果text是str类型,则encoding会被忽略""" if isinstance(text, bytes): text = text.decode(encoding, "replace") text = text.replace("\r", "").encode("utf-8") return lxml.etree.XML(text, parser) def kr23(): root_dir2 = Path(ENVIRON["APPDATA"], "kingdom_rush_frontiers") root_dir2.mkdir(parents=True, exist_ok=True) root_dir3 = Path(ENVIRON["APPDATA"], "kingdom_rush_origins") root_dir3.mkdir(parents=True, exist_ok=True) save_file_pattern = "slot_*.lua" for path in chain( root_dir2.glob(save_file_pattern), root_dir3.glob(save_file_pattern) ): text = path.read_text("utf-8") text = re.sub(r"\[\"xp\"\] = \d+", '["xp"] = 145000', text) path.write_text(text, "utf-8") def kr4(): root_dir = Path(ENVIRON["LOCALAPPDATA"], "Kingdom Rush Vengeance") root_dir.mkdir(parents=True, exist_ok=True) for path in root_dir.glob("slot_*.plist"): root = new_document(path.read_text("utf-8")) all_exps_nodes = root.xpath( '//key[text() = "heroes"]/following-sibling::*[1]/dict/integer[1]' ) for node in all_exps_nodes: node.text = "400000" path.write_bytes(lxml.etree.tostring(root, encoding="utf-8", method="xml")) kr23() kr4() </code>
塔防/kingdom-rush.txt
· 最后更改:
2024/06/29 09:51
由
bluequilt
页面工具
显示页面
过去修订
反向链接
回到顶部