コード例 #1
0
ファイル: test.py プロジェクト: EyeOfPython/EvilTravianBot
account = Account(server, name)

logger.log_name = name
logger.log_note("start", "Started the bot")

#db.users.remove({}) # wipe users
#db.states.remove({})

jobs_from_db = True

if account.get_db() is None or account.get_db()['activated'] == False:
    
    logger.log_info("register account", "need to register this account first: ensure the mailserver is running")
    if account.get_db() is None:
        account.init_db(email, password, nation, proxies)
        account.load_db()
        action.action_register(account)
        jobs_from_db = False
    
    logger.log_info("wait for email", "wait for activation email to receive...")
    user_db = account.get_db()
    while 'activation_code' not in user_db:
        time.sleep(1)
        user_db = account.get_db()
    
    account.perform_activation("so")
    
account.loadup()

first_village = next(iter(account.villages.values()))