import string
import random


def get_new_reascript_code(ini_file):
    """Return new ReaScript code for reaper-kb.ini.

    Parameters
    ----------
    ini_file : str
        Path to ``reaper-kb.ini`` configuration file.

    Returns
    -------
    code : str
        ReaScript code.
    """
    def get_random_code():
        chars = string.ascii_letters + string.digits
        return "".join(random.choice(chars) for _ in range(40))
    with open(ini_file) as f:
        content = f.read()
    code = get_random_code()
    while code in content:
        code = get_random_code()
    return "RS" + code