forked from LandSandBoat/UpdateExtractor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate_extractor.py
123 lines (108 loc) · 3.42 KB
/
update_extractor.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
############################
#
# MIT License
#
# update_extractor.py
# Copyright (c) 2021 Zach Toogood
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
############################
#
# The following files from POLUtils should be in the directory next to this script
# when you run it (https://github.com/Windower/POLUtils):
# - MassExtractor.exe
# - PlayOnline.Core.dll
# - PlayOnline.FFXI.dll
#
############################
############################
# Python Imports
############################
import re
import xml.etree.ElementTree as ET
import os
import subprocess
import glob
############################
# pip Imports
############################
try:
import xmltodict
except:
print("Failed to import xmltodict, please install with `pip install xmltodict`")
exit(-1)
############################
# own Imports
############################
from utils import *
from config import *
from client_ver import *
from titles import *
from status_effects import *
from items import *
from zone_texts import *
from entity_ids import *
from misc import *
############################
# Config
############################
check_config()
############################
# Setup
############################
print("Looking for exes")
if not os.path.exists('./MassExtractor.exe') and not os.path.exists('./PlayOnline.Core.dll') and not os.path.exists('./PlayOnline.FFXI.dll'):
print("Could not find one or all of: MassExtractor.exe, PlayOnline.Core.dll, PlayOnline.FFXI.dll")
exit(-1)
print("Creating folder layout")
if not os.path.exists("out"):
os.makedirs("out")
if not os.path.exists("out/conf"):
os.makedirs("out/conf")
if not os.path.exists("out/conf/default"):
os.makedirs("out/conf/default")
if not os.path.exists("out/scripts"):
os.makedirs("out/scripts")
if not os.path.exists("out/scripts/globals"):
os.makedirs("out/scripts/globals")
if not os.path.exists("out/scripts/zones"):
os.makedirs("out/scripts/zones")
if not os.path.exists("out/sql"):
os.makedirs("out/sql")
############################
# MassExtractor
############################
if not os.path.exists("res"):
print("Running MassExtractor.exe -> ./res/")
os.makedirs("res")
subprocess.run(["MassExtractor.exe", "res"])
else:
print("Did not need to run MassExtractor.exe")
############################
# Extract Stages
############################
client_ver()
titles()
status_effects()
items()
zone_texts()
#entity_ids()
#misc()
print("Done")