Revert "Merge branch 'dev' into master"

This reverts commit 56d2df66b9, reversing
changes made to 159304cdd0.
This commit is contained in:
whoamikyo 2020-06-16 15:54:44 -03:00
parent 56d2df66b9
commit ce3b0be361
5 changed files with 12 additions and 72 deletions

13
alas.py
View File

@ -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():

View File

@ -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)

View File

@ -22,7 +22,6 @@ class AzurLaneConfig:
config = configparser.ConfigParser(interpolation=None)
start_time = datetime.now()
UPDATE = True
SERVER = server.server
logger.attr('Server', SERVER)

View File

@ -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']
}

View File

@ -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