Utility scripts for a TES3MP server administrator.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

73 lines
2.0 KiB

#!/usr/bin/env python3
import json
import sys
try:
path_to_world_json = sys.argv[1]
except IndexError:
sys.stderr.write("Please provide the path to world.json as an arg.\n")
sys.exit(1)
with open(path_to_world_json, "r") as _world:
jsonfile = _world.readlines()
jsonstring = " ".join(jsonfile)
data_to_add = {
"customVariables": {
"serverWarp": {
"suran": {
"posX": 53410.890625,
"posZ": 160.99998474121,
"posY": -50788.109375,
"rotZ": 1.8222477436066,
"rotX": -0.1796875,
"cell": "6, -7",
},
"seydaneen": {
"posX": -10903.904296875,
"posZ": 241.57553100586,
"posY": -70653.21875,
"rotZ": -2.1034977436066,
"rotX": 0.015625,
"cell": "-2, -9",
},
"balmora": {
"posX": -20177.23046875,
"posZ": 155.98025512695,
"posY": -12792.276367188,
"rotZ": 2.5248892307281,
"rotX": -0.15625,
"cell": "-3, -2",
},
"pelagiad": {
"posX": 3813.9409179688,
"posZ": 1629.9704589844,
"posY": -56168.99609375,
"rotZ": -1.7753727436066,
"rotX": -0.03125,
"cell": "0, -7",
},
# "stirk": {
# "posX": -1109933,
# "posZ": 48.160125732422,
# "posY": -422896.125,
# "rotZ": -0.56250023841858,
# "rotX": -0.31640625,
# "cell": "-136, -52",
# },
}
}
}
world_dict = json.loads(jsonstring)
world_with_warps = world_dict.update(**data_to_add)
new_world_string = json.dumps(world_dict, sort_keys=True, indent=4)
with open(path_to_world_json, "w") as _world:
for line in new_world_string:
_world.write(line)
print("Warps added to world!")