|
@@ -13,8 +13,8 @@ from app.app import need_refill, max_refill_seconds, print_resources
|
|
def job_check_resources(state_id, capital_id, resource_id, do_refill):
|
|
def job_check_resources(state_id, capital_id, resource_id, do_refill):
|
|
"""Check resources and refill if necessary"""
|
|
"""Check resources and refill if necessary"""
|
|
regions = download_resources(state_id, resource_id)
|
|
regions = download_resources(state_id, resource_id)
|
|
- save_resources(state_id, regions, resource_id)
|
|
|
|
print_resources(regions)
|
|
print_resources(regions)
|
|
|
|
+ save_resources(state_id, regions, resource_id)
|
|
if do_refill and need_refill(regions, 25):
|
|
if do_refill and need_refill(regions, 25):
|
|
max_seconds = max_refill_seconds(regions, 25, 900)
|
|
max_seconds = max_refill_seconds(regions, 25, 900)
|
|
random_seconds = random.randint(0, max_seconds)
|
|
random_seconds = random.randint(0, max_seconds)
|
|
@@ -53,15 +53,22 @@ def add_check_resources(state_id, capital_id, resource_id, do_refill, minute):
|
|
)
|
|
)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|
|
- # jobs
|
|
|
|
# job_refill_resource(2788, 4002, 0)
|
|
# job_refill_resource(2788, 4002, 0)
|
|
- # job_check_resources(2788, 4002, 0, True)
|
|
|
|
|
|
+ # job_check_resources(2788, 4002, 0, False) # VN
|
|
|
|
+ # job_check_resources(2620, 4002, 0, False) # Zeelandiae
|
|
|
|
+
|
|
|
|
+ # VN
|
|
add_check_resources(2788, 4003, 0, True, '0,15,30,45')
|
|
add_check_resources(2788, 4003, 0, True, '0,15,30,45')
|
|
add_check_resources(2788, 4003, 11, True, '0')
|
|
add_check_resources(2788, 4003, 11, True, '0')
|
|
|
|
+ # Zeelandiae
|
|
|
|
+ add_check_resources(2620, 0, 0, False, '50')
|
|
|
|
+ # Belgium
|
|
|
|
+ add_check_resources(2604, 0, 0, False, '40')
|
|
|
|
|
|
try:
|
|
try:
|
|
while True:
|
|
while True:
|
|
time.sleep(100)
|
|
time.sleep(100)
|
|
except KeyboardInterrupt:
|
|
except KeyboardInterrupt:
|
|
LOGGER.info('Exiting application')
|
|
LOGGER.info('Exiting application')
|
|
|
|
+ SCHEDULER.shutdown()
|
|
exit()
|
|
exit()
|