Ejemplo n.º 1
0
    'User-Agent':
    'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5)'
    ' AppleWebKit/537.36 (KHTML, like Gecko)'
    ' Chrome/58.0.3029.110 Safari/537.36'
}
try:
    PROXY_LIST = open("settings/proxy_list.txt", "r")
except FileNotFoundError:
    sys.exit("proxy_list.txt wasn't found. "
             "Make sure it's in the same directory.")

# Settings pulled from utility.py -> settings.ini file
USE_PROXIES = get_user_settings()[0]
NUM_OF_ACCS = get_user_settings()[4]
SITE_URL = get_site_settings()[1]
TRIBOT_ACTIVE = get_tribot_settings()[0]
OSBOT_ACTIVE = get_osbot_settings()[0]


def get_ip() -> str:
    """
    Gets the user's external IP that will be used to create the account.
    Because of external dependency, we have a backup site to pull from if needed
    """
    users_ip = requests.get('https://api.ipify.org').text
    if not users_ip:
        users_ip = requests.get('http://ip.42.pl/raw').text
    return users_ip


def get_proxy() -> dict:
Ejemplo n.º 2
0
def use_tribot(charname, charpass, proxy=None):
    """Gets settings and runs Tribot CLI"""
    # Storing all of our settings while we're in the correct directory
    use_proxies = get_user_settings()[0]
    proxy_auth_type = get_user_settings()[1]
    tribot_username = get_tribot_settings()[1]
    tribot_password = get_tribot_settings()[2]
    tribot_script = get_tribot_settings()[3]
    script_args = get_tribot_settings()[4]

    if use_proxies:
        if proxy_auth_type == 1:
            proxy_username = format_current_proxy(proxy)[0]
            proxy_password = format_current_proxy(proxy)[1]
            proxy_host = format_current_proxy(proxy)[2]
            proxy_port = format_current_proxy(proxy)[3]
        else:
            proxy_host = format_current_proxy(proxy)[0]
            proxy_port = format_current_proxy(proxy)[1]

    original_path = os.getcwd()
    client = find_tribot()

    # Create our CLI command according to if we're using proxies or not
    if use_proxies:
        if proxy_auth_type == 1: # Using proxies with user:pass authentication
            cli_cmd = (f'java -jar {client} '
                       f'--username "{tribot_username}" --password "{tribot_password}" '
                       f'--charusername "{charname}" --charpassword "{charpass}" '
                       f'--script "{tribot_script}" --scriptargs "{script_args} " '
                       f'--charworld "433" '
                       f'--proxyhost "{proxy_host}" '
                       f'--proxyport "{proxy_port}" '
                       f'--proxyusername "{proxy_username}" '
                       f'--proxypassword "{proxy_password}" ')
        else: # Using proxies with IP based authentication
            cli_cmd = (f'java -jar {client} '
                       f'--username "{tribot_username}" --password "{tribot_password}" '
                       f'--charusername "{charname}" --charpassword "{charpass}" '
                       f'--script "{tribot_script}" --scriptargs "{script_args} " '
                       f'--charworld "433" '
                       f'--proxyhost "{proxy_host}" '
                       f'--proxyport "{proxy_port}" ')
    else: # Not using proxies
        cli_cmd = (f'java -jar {client} '
                   f'--username "{tribot_username}" --password "{tribot_password}" '
                   f'--charusername "{charname}" --charpassword "{charpass}" '
                   f'--script "{tribot_script}" --scriptargs "{script_args} " '
                   f'--charworld "433" ')

    print("")
    print("\nLoading tribot with the following settings...")
    print(cli_cmd)

    # Run the Tribot CLI in a separate, hidden shell to decrease clutter
    create_no_window = 0x08000000
    subprocess.Popen(f"start /B start cmd.exe @cmd /k {cli_cmd}", shell=True,
                     creationflags=create_no_window)

    # Changing back to the account creator directory
    # So we can see the settings.ini file for the next account.
    print(f"Changing our directory back to {original_path}")
    os.chdir(original_path)