From ce3b0be361ebe08d78a402d710ab621f7093c90b Mon Sep 17 00:00:00 2001 From: whoamikyo Date: Tue, 16 Jun 2020 15:54:44 -0300 Subject: [PATCH] Revert "Merge branch 'dev' into master" This reverts commit 56d2df66b91293989253958ae5580d59fa4c3c47, reversing changes made to 159304cdd096b331fbf00ea7d095613c2ce5d87c. --- alas.py | 13 ----------- dev_tools/relative_crop.py | 4 ++-- module/config/config.py | 1 - module/reward/commission.py | 21 +++++++++-------- module/updater.py | 45 ------------------------------------- 5 files changed, 12 insertions(+), 72 deletions(-) delete mode 100644 module/updater.py diff --git a/alas.py b/alas.py index ac35d7f76..2b69f5b61 100644 --- a/alas.py +++ b/alas.py @@ -5,12 +5,8 @@ from datetime import datetime from module.config.config import AzurLaneConfig from module.logger import logger, pyw_name, log_file - from module.device.device import Device -from module.updater import Update - - class AzurLaneAutoScript: def __init__(self, ini_name=''): @@ -49,35 +45,26 @@ class AzurLaneAutoScript: from module.reward.reward import Reward az = Reward(self.config, device=self.device) az.reward_loop() - self.update_check() def setting(self): for key, value in self.config.config['Setting'].items(): print(f'{key} = {value}') logger.hr('Settings saved') - self.update_check() self.config.config_check() - def update_check(self): - self.config.UPDATE = Update(self.config) - if self.config.UPDATE.check_update(): - logger.warning('A new update is available, please run updater.bat or check github.') - def reward(self): for key, value in self.config.config['Reward'].items(): print(f'{key} = {value}') logger.hr('Reward Settings saved') self.reward_when_finished() - self.update_check() def emulator(self): for key, value in self.config.config['Emulator'].items(): print(f'{key} = {value}') logger.hr('Emulator saved') - self.update_check() from module.handler.login import LoginHandler az = LoginHandler(self.config, device=self.device) if az.app_ensure_start(): diff --git a/dev_tools/relative_crop.py b/dev_tools/relative_crop.py index c253eb4f9..02fee4e92 100644 --- a/dev_tools/relative_crop.py +++ b/dev_tools/relative_crop.py @@ -21,9 +21,9 @@ class Config: cfg = AzurLaneConfig().merge(Config()) # Folder to save temp images -folder = './screenshots/temp/' +folder = '' # Put Screenshot here -file = './screenshots/TEMPLATE_AMBUSH_EVADE_FAILED.png' +file = '' i = Image.open(file).convert('RGB') grids = Grids(i, cfg) diff --git a/module/config/config.py b/module/config/config.py index 7f4e0cb42..828a8bcfe 100644 --- a/module/config/config.py +++ b/module/config/config.py @@ -22,7 +22,6 @@ class AzurLaneConfig: config = configparser.ConfigParser(interpolation=None) start_time = datetime.now() - UPDATE = True SERVER = server.server logger.attr('Server', SERVER) diff --git a/module/reward/commission.py b/module/reward/commission.py index b6c9b638a..d02218816 100644 --- a/module/reward/commission.py +++ b/module/reward/commission.py @@ -16,7 +16,6 @@ from module.reward.assets import * from module.ui.page import page_reward, page_commission, CAMPAIGN_CHECK from module.ui.ui import UI - dictionary_cn = { 'major_comm': ['自主训练', '对抗演习', '科研任务', '工具整备', '战术课程', '货物运输'], 'daily_comm': ['日常资源开发', '高阶战术研发'], @@ -34,19 +33,19 @@ dictionary_cn = { 'urgent_ship': ['观舰'] } dictionary_en = { - 'major_comm': ['SelfTraining', 'DefenseExercise', 'ResearchMission', 'Prep', 'Class'], - 'daily_comm': ['Daily', 'Awakening', 'paily'], - 'extra_drill': ['Sailing', 'Buoy', 'saingTraining', 'shortrangesailingTraining', 'MidrangesailingTraining', 'FrontierDefensePatrol'], - 'extra_part': ['Protection', 'Forestprtectioncommisionl', 'veinprotectoncommisionl', 'veinprtectioncommision', 'Forestprotectncommisionll', 'veinprotectncommision', 'Forestprtectoncommisionl', 'Forestprtectioncommisonl', 'veinprotectoncommisonl', 'veinprotecioncommisionl', 'Forestprotectoncommisionll'], - 'extra_cube': ['FleetExercise', 'EscortExercise', 'FleetCargo', 'CombatExercise', 'FleetCargoTransport'], - 'extra_oil': ['oil', 'smallscaleoiExtractionll', 'smal.scaleoiExtractionll', 'smalscaleoiExtraction'], - 'extra_book': ['MerchantEscort', 'SmalIMerchantEscor'], - 'urgent_drill': ['CargoDefense', 'Destroy', 'CoastalDefensePatrol'], + 'major_comm': ['SelfTraining', 'DefenseExercise', 'ResearchMission', 'Prep', 'Class', 'CargoTransport'], + 'daily_comm': ['Daily', 'Awakening'], + 'extra_drill': ['Sailing', 'DefensePatrol', 'Buoy', 'saingTraining'], + 'extra_part': ['Protection', 'Forestprtectioncommisionl', 'veinprotectoncommisionl', 'veinprtectioncommision', 'Forestprotectncommisionll', 'veinprotectncommision'], + 'extra_cube': ['FleetExercise', 'EscortExercise', 'FleetCargo', 'CombatExercise'], + 'extra_oil': ['oil', 'smallscaleoiExtractionll', 'smal.scaleoiExtractionll'], + 'extra_book': ['MerchantEscort'], + 'urgent_drill': ['CargoDefense', 'Destroy'], 'urgent_part': ['Lavella', 'Maui', 'Rendova', 'banna', 'Mannelsland'], 'urgent_book': ['Tyrant', 'Poro', 'Makira', 'Kapolo', 'Mary', 'Isle', 'Kotlin', 'AidingWapolo'], 'urgent_box': ['Gear', 'Handover'], - 'urgent_cube': ['MerchantRescue', 'Attack', 'EnemyAtack'], - 'urgent_gem': ['VIP ', 'Holiday', 'PatrolEscort', 'BIWWIPEscort', 'BIWVIPEscort', 'NYBWIPEscort'], + 'urgent_cube': ['MerchantRescue', 'Attack'], + 'urgent_gem': ['VIP ', 'Holiday', 'PatrolEscort', 'BIWWIPEscort', 'BIWVIPEscort'], 'urgent_ship': ['Launch'] } diff --git a/module/updater.py b/module/updater.py deleted file mode 100644 index 8c24b2665..000000000 --- a/module/updater.py +++ /dev/null @@ -1,45 +0,0 @@ -from urllib import error, request -from module.logger import logger -from module.config.config import AzurLaneConfig - -class Update(object): - - def __init__(self, config): - """ - Args: - config(AzurLaneConfig): - """ - self.config = config - - def check_update(self): - version = '' - latest_version = '' - _file = open('version.txt', 'r') - - if self.config.UPDATE: - version = _file.readline() - - try: - with request.urlopen("https://raw.githubusercontent.com/whoamikyo/AzurLaneAutoScript/master/version.txt") as f: - _f = f.read().decode('utf-8') - latest_version = _f.splitlines()[1] - except error.HTTPError as e: - logger.info("Couldn't check for updates, {}.".format(e)) - - else: - version = _file.readlines()[1] - - try: - with request.urlopen("https://raw.githubusercontent.com/whoamikyo/AzurLaneAutoScript/master/version.txt") as f: - _f = f.read().decode('utf-8') - latest_version = _f.splitlines()[1] - except error.HTTPError as e: - logger.info("Couldn't check for updates, {}.".format(e)) - - _file.close() - - if version != latest_version: - logger.info("Current version: " + version) - logger.info("Latest version: " + latest_version) - - return True \ No newline at end of file