Esempio n. 1
0
def use_osbot(charname, charpass, proxy=None):
    """Launches OSBot CLI with supplies information"""
    # Grab all of our settings
    use_proxies = get_user_settings()[0]
    osbot_username = get_osbot_settings()[1]
    osbot_password = get_osbot_settings()[2]
    osbot_script = get_osbot_settings()[3]
    script_args = get_osbot_settings()[4]
    client = find_osbot()

    if use_proxies:  # Format CLI with proxy param
        cli_cmd = (f'java -jar "{client}" '
                   f'-proxy {format_current_proxy(proxy)} '
                   f'-login {osbot_username}:{osbot_password} '
                   f'-bot {charname}:{charpass}:0000 '
                   f'-script {osbot_script}:{script_args} '
                   f'-world 433')
    else:  # Format without a proxy param
        cli_cmd = (f'java -jar "{client}" '
                   f'-login {osbot_username}:{osbot_password} '
                   f'-bot {charname}:{charpass}:0000 '
                   f'-script {osbot_script}:{script_args} '
                   f'-world 433')

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

    # Run the OSBot 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)
Esempio n. 2
0
    '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:
    """