Code Monkey home page Code Monkey logo

pydamo's People

Contributors

bode135 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pydamo's Issues

ModuleNotFoundError: No module named 'win32com'

我运行项目的时候,会报错
内容如下
pydev debugger: process 9036 is connecting

Connected to pydev debugger (build 193.6911.25)
注册dm.dll
Traceback (most recent call last):
File "D:\Project\Python\Exercice\pydamo\damo.py", line 7, in init
from win32com.client import Dispatch
ModuleNotFoundError: No module named 'win32com'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\Program\SDK\Pycharm\PyCharm 2019.3.4\plugins\python\helpers\pydev\pydevd.py", line 1434, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "D:\Program\SDK\Pycharm\PyCharm 2019.3.4\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "D:/Project/Python/Exercice/pydamo/简单案例.py", line 11, in
dm = DM()
File "D:\Project\Python\Exercice\pydamo\damo.py", line 14, in init
self.dm = Dispatch('dm.dmsoft') # 调用大漠插件
UnboundLocalError: local variable 'Dispatch' referenced before assignment

但是找不到win32com这个依赖,要怎么解决呢

关于大漠插件的点击

我发现一个很诡异的事情,不同的机器上的反应都不一样
不管是左键还是右键都会失效,

os.system('regsvr32 dm.dll /s')
dm = Dispatch('dm.dmsoft')

time.sleep(10)

moveToX = 100
moveToY = 100
while moveToX <= 1000:
print("当前位置",moveToX)
print("开始移动")
dm.MoveTo(moveToX,moveToY)
print("移动结束")
print("开始点击")
dm.RightDown()
time.sleep(0.1)
dm.LeftUp()
#dm.RightClick()
print("点击结束")
print('开始睡眠')
time.sleep(2)
print("睡眠结束")
moveToX+=30

这是我的测试代码,我发现如果再桌面上,很多次都不会右键点击,但是move 会成功,如果我把鼠标放到sublmie 编辑器的前面,右键触发就会精准很多,但是还是会失效,但是一旦他右键,我这边用鼠标操作左键一次,他就会右键,然后我左键,他就继续右键,不会失败

注释是乱码

你好,来自于你的知乎回答
在demo 里面,注释和字符串是乱码,于是我加了utf-8 编码,还是乱码
class DM:
def init(self):
try:
from win32com.client import Dispatch
#dm = Dispatch('dm.dmsoft') # 璋冪敤澶ф紶鎻掍欢
self.dm = Dispatch('dm.dmsoft') # 璋冪敤澶ф紶鎻掍欢
except:
import os
os.system('regsvr32 dm.dll /s')
print('娉ㄥ唽dm.dll')
self.dm = Dispatch('dm.dmsoft') # 璋冪敤澶ф紶鎻掍欢

    print('鐗堟湰锛�, self.ver(),'锛孖D锛�,self.GetID())

无法绑定句柄

当我想使用后台操作,绑定窗口时,它就会自动退出,请问如何调用api来绑定窗口。

import win32api, win32con, win32gui

from pydamo_0 import Time
from pydamo_0 import DM
from pydamo_0 import Mouse

hwnd = win32gui.FindWindow(None, 'FLYFF')
dm = DM() # 可指定dm.dll路径DM(path), 若无法使用某些函数dm.f(), 则使用dm.dm.f()来调用.
dm. reg()
ms = Mouse(dm)
tt = Time()

dm_ret = dm.dm.BindWindow(hwnd, 'dx', 'dx', 'dx', 4)
到这自动退出了,这是为什么呢

Process finished with exit code -1073741819 (0xC0000005)

按键不同步

例如代码是

        k.KeyDown(VK.a)
        k.KeyUp(VK.a)

        k.KeyDown(VK.b)
        k.KeyUp(VK.b)

        k.KeyDown(VK.c)
        k.KeyUp(VK.c)

打开记事本 按键顺序为 acb bbaa ccc 这种

如何新增命令到文件中

老兄,有很多大漠的命令不能调用,是需要在demo.py里面自己添加后保存吗吗?比如SendString发送文本。
if(1) :
def SendString(self, hwnd, text):
return self.dm.SendString(hwnd,text)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.