From 76932cf0712c778f103fbf521d7c446c510efb95 Mon Sep 17 00:00:00 2001 From: YangHu Date: Tue, 25 Feb 2020 15:00:07 +0800 Subject: [PATCH] 1.0.1.0224 --- CHANGELOG.md | 7 +++++++ conf_example.ini | 4 ++++ explore/explore.py | 3 +++ gameLib/fighter.py | 22 ++++++++++++++++++++++ gameLib/game_ctl.py | 4 ++-- goryou/single_fight.py | 3 +++ gui/tkui.py | 31 ++++++++++++++++++++++++++++--- img/icon/OnmyojiBot.ico | Bin 0 -> 16958 bytes mitama/fighter_driver.py | 3 +++ mitama/fighter_passenger.py | 3 +++ mitama/single_fight.py | 4 ++++ onmyoji.py | 8 ++++++++ ui.py | 16 ++++++++++++++++ 13 files changed, 103 insertions(+), 5 deletions(-) create mode 100644 img/icon/OnmyojiBot.ico diff --git a/CHANGELOG.md b/CHANGELOG.md index 92d8664..794599c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # CHANGELOG +## v1.0.1.0224 +#### New features: +* 系统缩放自适应。 +* 增加了游戏次数的选项。 +* 增加了游戏结束后的选项。 +* 为本程序增加了图标。 + ## v1.0.1.0221 #### New features: * 采用了新的算法,大幅度提高了图片识别的准确性,目前在部分场景有应用。 diff --git a/conf_example.ini b/conf_example.ini index af7c728..e531bb9 100644 --- a/conf_example.ini +++ b/conf_example.ini @@ -4,6 +4,10 @@ run_section = 0 #run_mode 运行模式:对于御魂0-单刷;1-司机;2-乘客;3-双开 run_mode = 0 +#max_times 最大游戏次数:0-无数次;其他-其他次 +max_times = 0 +#end_operation 结束后操作:0-结束后关闭脚本;1-结束后关闭脚本和游戏 +end_operation = 0 [mitama] ######御魂参数##### diff --git a/explore/explore.py b/explore/explore.py index 8df75dd..e9ab32a 100644 --- a/explore/explore.py +++ b/explore/explore.py @@ -222,3 +222,6 @@ def start(self): self.switch_to_scene(3) self.log.writeinfo('结束本轮探索') time.sleep(0.5) + + # 检查游戏次数 + self.check_times() diff --git a/gameLib/fighter.py b/gameLib/fighter.py index 468467f..82bed0d 100644 --- a/gameLib/fighter.py +++ b/gameLib/fighter.py @@ -5,6 +5,7 @@ import configparser import logging +import os import random import threading import time @@ -32,6 +33,9 @@ def __init__(self, name='', emyc=0, hwnd=0): self.max_op_time = conf.getint('watchdog', 'max_op_time') self.max_win_time = conf.getint('watchdog', 'max_win_time') self.mitama_team_mark = conf.getint('mitama', 'mitama_team_mark') + self.max_times = conf.getint('DEFAULT', 'max_times') + self.end_operation = conf.getint('DEFAULT', 'end_operation') + self.run_times = 0 # 启动日志 self.log = WriteLog() @@ -68,6 +72,24 @@ def check_end(self): self.yys.wait_game_img('img\\JIE-SU.png', self.max_win_time) self.log.writeinfo(self.name + "战斗结束") + def check_times(self): + ''' + 监测游戏次数是否达到最大次数 + ''' + self.run_times = self.run_times + 1 + logging.info('游戏已运行'+str(self.run_times)+'次') + if(self.run_times == self.max_times): + if(self.end_operation == 0): + logging.warning('关闭脚本(次数已满)...') + self.run = False + os._exit(0) + elif(self.end_operation == 1): + logging.warning('关闭游戏(次数已满)...') + self.yys.quit_game() + logging.warning('关闭脚本(次数已满)...') + self.run = False + os._exit(0) + def mitama_team_click(self): ''' 御魂标记己方式神 diff --git a/gameLib/game_ctl.py b/gameLib/game_ctl.py index dd0d644..73f9751 100644 --- a/gameLib/game_ctl.py +++ b/gameLib/game_ctl.py @@ -24,10 +24,10 @@ def __init__(self, hwnd, quit_game_enable=1): self.hwnd = hwnd self.quit_game_enable = quit_game_enable self.debug_enable = False - #user32 = ctypes.windll.user32 - # user32.SetProcessDPIAware() l1, t1, r1, b1 = win32gui.GetWindowRect(self.hwnd) + #print(l1,t1, r1,b1) l2, t2, r2, b2 = win32gui.GetClientRect(self.hwnd) + #print(l2,t2,r2,b2) self._client_h = b2 - t2 self._client_w = r2 - l2 self._border_l = ((r1 - l1) - (r2 - l2)) // 2 diff --git a/goryou/single_fight.py b/goryou/single_fight.py index c451c92..8233dde 100644 --- a/goryou/single_fight.py +++ b/goryou/single_fight.py @@ -41,3 +41,6 @@ def start(self): self.click_until_knn('结算', 'img\\TIAO-ZHAN.png', *CommonPos.second_position, mood3.get1mood()/1000, thread=20) logging.info("回到选择界面") + + # 检查游戏次数 + self.check_times() diff --git a/gui/tkui.py b/gui/tkui.py index 08ba91c..463ac05 100644 --- a/gui/tkui.py +++ b/gui/tkui.py @@ -7,6 +7,7 @@ class Application(tk.Frame): def __init__(self, master=None): super().__init__(master) self.master = master + self.master.iconbitmap('img/icon/OnmyojiBot.ico') self.master.wm_title('OnmyojiBot') self.pack() @@ -14,6 +15,7 @@ def __init__(self, master=None): self.run_section = 0 self.run_mode = tk.IntVar() self.run_submode = tk.IntVar() + self.max_times = tk.IntVar() self.watchdog_enable = tk.BooleanVar() self.max_win_time = tk.IntVar() @@ -29,6 +31,7 @@ def __init__(self, master=None): self.run_mode.set(0) self.run_submode.set(0) + self.max_times.set(0) self.watchdog_enable.set(True) self.max_win_time.set(100) self.max_op_time.set(20) @@ -53,6 +56,9 @@ def __init__(self, master=None): self.create_frame2() self.create_frame3() + # 创建次数菜单 + self.create_times() + # 创建高级菜单 self.create_advance() @@ -113,7 +119,7 @@ def create_section(self): self.frame3 = tk.Frame(self.section) self.section.add(self.frame3, text='关于') - self.section.pack(fill=tk.BOTH) + self.section.pack(fill=tk.BOTH, expand=True) def create_frame0(self): ''' @@ -169,11 +175,11 @@ def create_frame2(self): ''' # 提示文本 textframe = tk.Frame(self.frame2) - textframe.pack(expand=True, fill=tk.X) + textframe.pack(expand=True, fill=tk.BOTH) s = tk.Scrollbar(textframe) s.pack(side=tk.RIGHT) text = tk.Text(textframe, height=5, width=21) - text.pack(side=tk.LEFT, expand=True, fill=tk.X) + text.pack(side=tk.LEFT, expand=True, fill=tk.BOTH) text.insert(tk.INSERT, '把狗粮队长放在最左边,点开需要打的章节,然后开始。\n') text.insert(tk.INSERT, '支持自动换狗粮,只打经验怪。\n') text.insert(tk.END, '最好把“合并相同式神”选项关闭。\n') @@ -212,6 +218,22 @@ def create_frame3(self): tk.END, '网址:https://github.com/AcademicDog/onmyoji_bot\n\n交流Q群:592055060') text.config(state=tk.DISABLED) + def create_times(self): + ''' + 游戏次数 + ''' + times = tk.LabelFrame(self.main_frame1, text='次数设置') + times.pack(padx=5, fill=tk.X, anchor=tk.W) + timeframe1 = tk.Frame(times) + timeframe1.pack(anchor=tk.W) + tk.Label(timeframe1, text='游戏次数(0=无数次):').pack(side=tk.LEFT) + tk.Entry(timeframe1, width=6, textvariable=self.max_times).pack() + self.end_operation = ttk.Combobox(times) + self.end_operation['value'] = ('结束后关闭脚本', '结束后关闭脚本和游戏') + self.end_operation.pack(fill=tk.X, padx=2, pady=2) + self.end_operation.current(0) + self.end_operation.config(state='readonly') + def create_advance(self): ''' 高级菜单 @@ -260,6 +282,9 @@ def show_params(self): self.params.insert(tk.END, '\nrun_mode: '+str(self.run_mode.get())) self.params.insert(tk.END, '\nrun_submode: ' + str(self.run_submode.get())) + self.params.insert(tk.END, '\nmax_times: ' + str(self.max_times.get())) + self.params.insert(tk.END, '\nend_operation: ' + + str(self.end_operation.current())) self.params.insert(tk.END, '\nwatchdog_enable: ' + str(self.watchdog_enable.get())) self.params.insert(tk.END, '\nmax_win_time: ' + diff --git a/img/icon/OnmyojiBot.ico b/img/icon/OnmyojiBot.ico new file mode 100644 index 0000000000000000000000000000000000000000..3a49ad467626290e8b86ffe7a7ca89583a07f075 GIT binary patch literal 16958 zcmeIZcU;r^wl?UUJ9FQA&n@TdbN10~??{o}NeCecNl56uH|ZFVDgr8E0Xu@C+lsyS zg1tBF6$_}S*iex~?B$u~7x%ui?>q0j@BBNT&**3IOCw}`S9{j8R=Rcj2mY5zyYc6M zZl;wdygr@Q`k# z_om9t-bYIA`fSbWES|cwYu@oqZ?`pFF`Pd8$nd7U&2V7rQiIw-Zjjr>7(8V!_un_hC`>H84jL%Wmt9jv|&_xsbR{M zYD4a>sRr4>1cTM_AcN$pkD<0IfMrT=iR^vIcR6=e&1D8#BP>9E09=g%zuH092Wu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@@ -62,3 +62,6 @@ def start(self): time.sleep(0.2) self.yys.mouse_click_bg((674, 384)) self.log.writeinfo('Driver: 自动邀请') + + # 检查游戏次数 + self.check_times() diff --git a/mitama/fighter_passenger.py b/mitama/fighter_passenger.py index 66195dc..cd9406f 100644 --- a/mitama/fighter_passenger.py +++ b/mitama/fighter_passenger.py @@ -63,3 +63,6 @@ def start(self): elif self.yys.find_game_img('img\\JIE-SHOU.png'): self.yys.mouse_click_bg((125, yuhun_loc[1])) self.log.writeinfo('Passenger: 接受邀请') + + # 检查游戏次数 + self.check_times() diff --git a/mitama/single_fight.py b/mitama/single_fight.py index 7322a0a..fdf0586 100644 --- a/mitama/single_fight.py +++ b/mitama/single_fight.py @@ -3,6 +3,7 @@ import tools.utilities as ut import configparser +import logging class SingleFight(Fighter): @@ -54,3 +55,6 @@ def start(self): self.click_until_knn('结算', 'img\\TIAO-ZHAN.png', *CommonPos.second_position, mood3.get1mood()/1000, thread=20) self.log.writeinfo("回到选择界面") + + # 检查游戏次数 + self.check_times() diff --git a/onmyoji.py b/onmyoji.py index 3bc08b1..a756ff6 100644 --- a/onmyoji.py +++ b/onmyoji.py @@ -83,6 +83,14 @@ def my_excepthook(exc_type, exc_value, tb): sys.excepthook = my_excepthook logging.info('UAC pass') + # Query DPI Awareness (Windows 10 and 8) + awareness = ctypes.c_int() + errorCode = ctypes.windll.shcore.GetProcessDpiAwareness( + 0, ctypes.byref(awareness)) + + # Set DPI Awareness (Windows 10 and 8) + errorCode = ctypes.windll.shcore.SetProcessDpiAwareness(0) + # 设置战斗参数 init() diff --git a/ui.py b/ui.py index 6a9b775..84df08b 100644 --- a/ui.py +++ b/ui.py @@ -43,6 +43,8 @@ def set_conf(self): # 御魂参数 self.conf.set('DEFAULT', 'run_mode', str(self.run_mode.get())) + self.conf.set('DEFAULT', 'max_times', str(self.max_times.get())) + self.conf.set('DEFAULT', 'end_operation', str(self.end_operation.current())) self.conf.set('mitama', 'run_submode', str(self.run_submode.get())) self.conf.set('mitama', 'mitama_team_mark', str(self.mitama_team_mark.current())) @@ -111,6 +113,20 @@ def my_excepthook(exc_type, exc_value, tb): if is_admin(): sys.excepthook = my_excepthook + # Query DPI Awareness (Windows 10 and 8) + awareness = ctypes.c_int() + errorCode = ctypes.windll.shcore.GetProcessDpiAwareness( + 0, ctypes.byref(awareness)) + + # Set DPI Awareness (Windows 10 and 8) + errorCode = ctypes.windll.shcore.SetProcessDpiAwareness(1) + # the argument is the awareness level, which can be 0, 1 or 2: + # for 1-to-1 pixel control I seem to need it to be non-zero (I'm using level 2) + + # Set DPI Awareness (Windows 7 and Vista) + success = ctypes.windll.user32.SetProcessDPIAware() + # behaviour on later OSes is undefined, although when I run it on my Windows 10 machine, it seems to work with effects identical to SetProcessDpiAwareness(1) + # 设置战斗参数 root = tk.Tk() app = MyBattle(root)