Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import shutil
- def doubleBanditMax():
- with open("Modules/SandBox/ModuleData/partyTemplates.xml") as f:
- party_templates = [_ for _ in f.readlines()]
- if "<!-- DOUBLED BANDIT COUNTS -->" in "".join(party_templates):
- print "Already doubled."
- return
- bandits = [
- "looter",
- "bandit",
- "raider",
- "trader",
- "caravan"
- ]
- out_lines = []
- added_comment = False
- for line in party_templates:
- if "max_value" in line and 'max_value="1"' not in line:
- for b in bandits:
- if b in line:
- parts = line.split("max_value=")
- num_parts = parts[1].split('"')
- num = int(num_parts[1]) * 2
- num_parts[1] = str(num)
- num_part = '"'.join(num_parts)
- parts[1] = num_part
- line = "max_value=".join(parts)
- if not added_comment:
- line += "<!-- DOUBLED BANDIT COUNTS -->"
- added_comment = True
- break
- out_lines.append(line)
- with open("Modules/SandBox/ModuleData/partyTemplates.xml", "w") as f:
- f.write("".join(out_lines).replace("\r", ""))
- def propogate():
- shutil.copy("StoryMode_modded.dll", "Modules/StoryMode/bin/Win64_Shipping_Client/StoryMode.dll")
- shutil.copy("SandBox_modded.dll", "Modules/SandBox/bin/Win64_Shipping_Client/SandBox.dll")
- shutil.copy("TaleWorlds.CampaignSystem_modded.dll", "bin/Win64_Shipping_Client/TaleWorlds.CampaignSystem.dll")
- def backup():
- shutil.copy("Modules/StoryMode/bin/Win64_Shipping_Client/StoryMode.dll", "StoryMode.dll")
- shutil.copy("Modules/SandBox/bin/Win64_Shipping_Client/SandBox.dll", "SandBox.dll")
- shutil.copy("bin/Win64_Shipping_Client/TaleWorlds.CampaignSystem.dll", "TaleWorlds.CampaignSystem.dll")
- # Do the things
- propogate()
- doubleBanditMax()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement