~txtsd/neobots

d1826f7ea0e2531cd1643b79f439514cd54810b5 — txtsd 7 years ago 8faa8d1 py3
Add Bank
2 files changed, 54 insertions(+), 1 deletions(-)

A classes/bank.py
M classes/dailies.py
A classes/bank.py => classes/bank.py +39 -0
@@ 0,0 1,39 @@
# ---------------------------------------------------------------------
# ---------------------------- neobots --------------------------------
# ------------------------------txtsd----------------------------------
# ---------------------------------------------------------------------

import re


class Bank:
    """Handles bank operations"""

    def __init__(self, accounturbator, configurator):
        self.accounturbator = accounturbator
        self.configurator = configurator

    def make_account(self):
        result = self.accounturbator.get(
            '/bank.phtml'
        )
        html = result.content
        if re.search('Create a Bank Account', html):
            result = self.accounturbator.post(
                'process_bank.phtml',
                data={
                    'type': 'new_account',
                    'name': self.acc.un,    # max_char: 30
                    'add1': '',             # max_char: 30
                    'add2': '',             # max_char: 30
                    'add3': '',             # max_char: 30
                    'employment': 'Chia Custodian',
                    'salary': '10,000 NP and below',
                    'account_type': '0',
                    'initial_deposit': '1',
                },
                referer='/bank.phtml'
            )

    def deposit(self, np=None):
        pass

M classes/dailies.py => classes/dailies.py +15 -1
@@ 79,7 79,21 @@ class Dailies:
            print('Unforeseen result. Check logs.')

    def process_bankInterest(self):
        pass
        result = self.accounturbator.get(
            '/bank.phtml'
        )
        html = result.content
        if re.search('You have already collected your interest today', html):
            print('You\'ve already collected today\'s interest.')
            return
        result = self.accounturbator.post(
            '/process_bank.phtml',
            data={
                'type': 'interest',
            },
            referer='/bank.phtml'
        )
        print('Collected interest.')

    def process_coltzanShrine(self):
        result = self.accounturbator.get(