misakamikodo / mhxy_script

梦幻西游手游脚本(基于pyautogui、opencv,在python环境下运行文件)
168 stars 62 forks source link

我设置了对应分辨率,好像它移动不到0,0 #4

Closed rainsdf closed 1 year ago

rainsdf commented 1 year ago

PS D:\mhxy_script-master> python game_process.py <Win32Window left="36", top="239", width="648", height="513", title="梦幻西游:时空"> 处理后: <Win32Window left="71", top="0", width="907", height="707", title="梦幻西游:时空"> <Win32Window left="-32000", top="-32000", width="160", height="28", title="梦幻西游:时空"> Traceback (most recent call last): File "D:\mhxy_script-master\game_process.py", line 84, in resize.moveZhuomianban() File "D:\mhxy_script-master\game_process.py", line 29, in moveZhuomianban self.moveZhuomianbanFunc(niceSize) File "D:\mhxy_script-master\game_process.py", line 16, in moveZhuomianbanFunc pyautogui.moveTo(item.right - resizeOffset[0], item.bottom - resizeOffset[1]) File "C:\Users\WF\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyautogui__init.py", line 598, in wrapper returnVal = wrappedFunction(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\WF\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyautogui__init__.py", line 1283, in moveTo _mouseMoveDrag("move", x, y, 0, 0, duration, tween) File "C:\Users\WF\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyautogui__init__.py", line 1509, in _mouseMoveDrag failSafeCheck() File "C:\Users\WF\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyautogui\init__.py", line 1722, in failSafeCheck raise FailSafeException( pyautogui.FailSafeException: PyAutoGUI fail-safe triggered from mouse moving to a corner of the screen. To disable this fail-safe, set pyautogui.FAILSAFE to False. DISABLING FAIL-SAFE IS NOT RECOMMENDED. PS D:\mhxy_script-master>

rainsdf commented 1 year ago

是双屏导致的问题吗?

misakamikodo commented 1 year ago

是双屏导致的问题吗?

出问题的手动点一下窗口(获取一下焦点)再运行就没这个问题了,为什么会这样我就不知道了

rainsdf commented 1 year ago

谢谢大佬,我再研究一下