RobertRautenbach / Open-Source-Battle-Bot

A project to make farming in Dokkan Battle available to anyone.
GNU General Public License v3.0
84 stars 67 forks source link

Selecting how many times to expand the capacity #97

Open Simopich opened 5 years ago

Simopich commented 5 years ago

Just added these few lines to select how many times do you want to increase the capacity, with a check of the input.

Changes:

Checking if the input is valid

    valid = False
    while not valid:
        try:
            increase_times = int(input("How many times do you want to increase the capacity? (" + Fore.YELLOW + Style.BRIGHT + "+5 per time" + Style.RESET_ALL + "): "))
            valid = True
        except ValueError:
            print(Fore.RED + Style.BRIGHT + "That's not a valid number.")
    ### Checking if you have enough Dragon Stones
    if increase_times > get_user()['user']['stone']:
        print(Fore.RED + Style.BRIGHT+ "You don't have enough Dragon Stones.")
        pass
    ### Increasing the capacity
    else:
        for _ in range(increase_times):
            increase_capacity()
Simopich commented 5 years ago

@GOKU-SA Thanks for the idea.

GOKU-SA commented 5 years ago

No problem, glad to help.