[Plugin] xAutoConfig


#1

This plugin will load default configuration that you wish to your new created character (or any other with no configuration previously).

How to use:

  • Rename the config that you want by default to “default”

Example: Default.json

xAutoConfig
from phBot import *
import shutil
import os

log('Plugin: xAutoConfig successfully loaded.')

# Called when the user successfully selects a character. No character data has been loaded yet.
def joined_game():
	# JSON config not found
	if not os.path.exists(get_config_path()):
		# Looking for JSON default configs
		defaultConfig = get_config_dir()+"Default.json"
		# Loading JSON default configs
		if os.path.exists(defaultConfig):
			shutil.copyfile(defaultConfig,get_config_path())
			log("Plugin: Default JSON configurations successfully loaded (xAutoConfig)")