def move_money_to_alliance(amount=None): if not amount: page = get_request(ALLIANCE_PAGE) amount = get_amount_from_regex(AIRPORT_CASH_REGEX, page) if amount > 0: result = post_request(ALLIANCE_DEPOSIT_CASH_URL, {'cq': amount}) exception_if_not_contains(ALLIANCE_DEPOSIT_SUCCESSFUL, result)
def move_money_to_bank(amount=None): if not amount: page = get_request(BANK_PAGE) amount = get_amount_from_regex(AIRPORT_CASH_REGEX, page) else: get_request(BANK_PAGE) result = post_request(BANK_DEPOSIT_URL, {'cq': amount}) exception_if_not_contains(BANK_DEPOSIT_SUCCESSFUL, result)
def get_engines_supply(page): return { '5': get_amount_from_regex(STOCK_ENGINES_5_REGEX, page), '6': get_amount_from_regex(STOCK_ENGINES_6_REGEX, page) }
def get_kerosene_capacity(page): return get_amount_from_regex(FUEL_CAPACITY_REGEX, page)
def get_kerosene_supply(page): return get_amount_from_regex(FUEL_STOCK_REGEX, page)
def get_money(page): money_string = get_amount_from_regex(AIRPORT_CASH_REGEX, page) return money_string
def withdraw_from_alliance(amount=None): if not amount: page = get_request(ALLIANCE_PAGE) # TODO Put all the amounts regex in a constant amount = get_amount_from_regex(ALLIANCE_CASH_REGEX, page) post_request(ALLIANCE_WITHDRAW_CASH_URL, {'cq': amount})