如何想编一个每隔一段时间鼠标自动点击的脚本?(不用按键精灵)

2024-11-27 22:43:56
推荐回答(4个)
回答1:

以下是用VB写的,窗体上加个timer
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Const MOUSEEVENTF_LEFTDOWN = &H2
Const MOUSEEVENTF_LEFTUP = &H4
Const MOUSEEVENTF_ABSOLUTE = &H8000
Dim xx As Long, yy As Long

Private Sub Form_Load()
Timer1.interval=180000
Form1.Visible = False
xx = Screen.Width / 2
yy = Screen.Height / 2
End Sub

Private Sub Timer1_Timer()
Call mouse_event(MOUSEEVENTF_ABSOLUTE Or MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, xx, yy, 0, 0)
End Sub

回答2:

如题,这样的脚本有可能制作吗?只用按键精灵可以制作吗? 如果可以制作,请//确定按钮坐标 LeftClick 1 //隔一段时间 Delay 10000 Goto 开始 ,jsqadD

回答3:

Python 的 win32api 试过没有?如果没有屏蔽api,那么很容易做成后台。SendInput,要先装一个pywin32

回答4:

……直接用按键精灵不就得了么……