mrmin123 / kancolle-auto

Kantai Collection (Kancolle) bot/automation tool - DEPERECATED - see kcauto-kai:
https://github.com/mrmin123/kcauto-kai
54 stars 22 forks source link

ScheduledStop bug fixes #329

Closed waicool20 closed 7 years ago

waicool20 commented 7 years ago

Some copy pasta derps in this section:

if settings['scheduled_stop_mode'] == 'time':
                now_time = datetime.datetime.now()
                if now_time > settings['scheduled_stop_time']:
                    log_success("kancolle-auto has ran for the desired %s hours! Shutting down now!" % settings['scheduled_stop_count'])
                    stop_flag = True
            elif settings['scheduled_stop_mode'] == 'expedition':
                if done_expeditions >= settings['scheduled_stop_count']:
                    log_success("kancolle-auto has ran the desired %s expeditions! Shutting down now!" % settings['scheduled_stop_count'])
                    stop_flag = True
            elif settings['scheduled_stop_mode'] == 'sortie':
                if done_expeditions >= settings['scheduled_stop_count']:
                    log_success("kancolle-auto has ran for the desired %s sorties! Shutting down now!" % settings['scheduled_stop_count'])
                    stop_flag = True
            elif settings['scheduled_stop_mode'] == 'pvp':
                if done_expeditions >= settings['scheduled_stop_count']:
                    log_success("kancolle-auto has ran for the desired %s pvps! Shutting down now!" % settings['scheduled_stop_count'])
                    stop_flag = True

done_expeditions for expedition, sortie and pvp mode?

waicool20 commented 7 years ago

Also should be noted that since you put kancolle_auto_wrapper() in a while True: loop, even when it stops via ScheduledStop it just gets rebooted immediately so a sys.exit(0) needs to be put in

waicool20 commented 7 years ago

And also when ScheduledStopCount and mode is set to something other than time it only stops when the done_<mode> is settings['scheduled_stop_count'] + 1

So eg. I set it to stop after 1 sortie it only does so after 2 sorties

mrmin123 commented 7 years ago

Merged #330. Thanks for catching and fixing this!