# A Python script to allow you to 'clone' a customized set of recommended items.

# This code is intended to work with Enigma's Recommended Items Changer. I am

# in no way affiliated with Enigma and any errors here are entirely my own.

# If you have League installed in a different directory, edit the variables

# dirOrig and dirNew accordingly.

# The inputs are (1) a string of the champion whose build you want to clone;

# (2) a vector of strings of the champions to which you want to clone the build;

# and (3) a string denoting which mode: 'sr' for Summoner's Rift, 'dom' for

# Dominion, 'tt' for Twisted Treeline, or 'pg' for Proving Grounds ARAM.

# This code is only somewhat tested, so make sure you create a backup before using it.

import os

def cloneBuild ( orig , new , mode ) :

folderOrig = orig

if mode == "dom" :

modekey = "8_ODIN"

elif mode == "sr" :

modekey = "1_CLASSIC"

elif mode == "tt" :

modekey = "10_CLASSIC"

elif mode == "pg" :

modekey = "3_ARAM"

filename = "EnigmaItem_" + modekey + "-0.json"

dirOrig = 'C:/Riot Games/League of Legends/Config/Champions/' + orig + '/Recommended/'

fOrig = dirOrig + filename

f1 = open ( fOrig , 'r' )

s = f1. readline ( )

f1. close ( )

for champ in new :

dirNew = 'C:/Riot Games/League of Legends/Config/Champions/' + champ + '/Recommended/'

if not os . path . exists ( dirNew ) :

os . makedirs ( dirNew )

fNew = dirNew + filename

f2 = open ( fNew , 'w' )

f2. write ( s. replace ( orig , champ ) )