按键精灵后台鼠标移动和点击脚本怎么制作。 20
我想用按键精灵制作一个,可以在后台(就是窗口最小化或者隐藏窗口)对指定窗口移动鼠标左键和点击鼠标左键的脚本,但看了很多贴后制作出的脚本,但作用窗口在最前面时非常好用,但切...
我想用按键精灵制作一个,可以在后台(就是窗口最小化或者隐藏窗口)对指定窗口移动鼠标左键和点击鼠标左键的脚本,但看了很多贴后制作出的脚本,但作用窗口在最前面时非常好用,但切换到其他窗口就不行了,怎么办?高手指点下呀。脚本如下
Dim hwnd
Plugin hwnd=Window.MousePoint()
Delay 1000
Rem star
Plugin BGKM5.MMove(hwnd,668,297)//移动左键到“军事行动”
Delay 400
Plugin BGKM5.LClick(hwnd,668,297)//左键单击“军事行动”
Delay 400
Plugin BGKM5.MMove(hwnd,573,199)//移动左键到“第一舰队”
Delay 400
Plugin BGKM5.LClick(hwnd,573,199)//左键单击“第一舰队”
Delay 400
Plugin BGKM5.MMove(hwnd,727,377)//移动左键到“急速”
Delay 400
Plugin BGKM5.LClick(hwnd,727,377)//左键单击“急速“
Delay 400
Plugin BGKM5.MMove(hwnd, 808,405)//左键移动到“确定出击”
Delay 400
Plugin BGKM5.LClick(hwnd,808,405)//左键单击“确定出击”
Delay 400
Plugin BGKM5.MMove(hwnd,758,300)//左键移动到“确定”
Delay 400
Plugin BGKM5.LClick(hwnd,758,300)//左键单击“确定”
Delay 500
Plugin BGKM5.MMove(hwnd,1062,57)//左键移动到“关闭窗口”
Delay 400
Plugin BGKM5.LClick(hwnd,1062,57)//左键单击“关闭窗口”
Delay 400//以上为一个出征循环,多次出征可复制以上内容
Plugin BGKM5.MMove(hwnd,668,297)//移动左键到“军事行动”
Delay 400
Plugin BGKM5.LClick(hwnd,668,297)//左键单击“军事行动”
Delay 400
Plugin BGKM5.MMove(hwnd,573,199)//移动左键到“第一舰队”
Delay 400
Plugin BGKM5.LClick(hwnd,573,199)//左键单击“第一舰队”
Delay 400
Plugin BGKM5.MMove(hwnd,727,377)//移动左键到“急速”
Delay 400
Plugin BGKM5.LClick(hwnd,727,377)//左键单击“急速“
Delay 400
Plugin BGKM5.MMove(hwnd, 808,405)//左键移动到“确定出击”
Delay 400
Plugin BGKM5.LClick(hwnd,808,405)//左键单击“确定出击”
Delay 400
Plugin BGKM5.MMove(hwnd,758,300)//左键移动到“确定”
Delay 400
Plugin BGKM5.LClick(hwnd,758,300)//左键单击“确定”
Delay 500
Plugin BGKM5.MMove(hwnd,1062,57)//左键移动到“关闭窗口”
Delay 400
Plugin BGKM5.LClick(hwnd,1062,57)//左键单击“关闭窗口”
Delay 400
Plugin BGKM5.MMove(hwnd,668,297)//移动左键到“军事行动”
Delay 120000
问题已经找到,自己动手进行了解决 展开
Dim hwnd
Plugin hwnd=Window.MousePoint()
Delay 1000
Rem star
Plugin BGKM5.MMove(hwnd,668,297)//移动左键到“军事行动”
Delay 400
Plugin BGKM5.LClick(hwnd,668,297)//左键单击“军事行动”
Delay 400
Plugin BGKM5.MMove(hwnd,573,199)//移动左键到“第一舰队”
Delay 400
Plugin BGKM5.LClick(hwnd,573,199)//左键单击“第一舰队”
Delay 400
Plugin BGKM5.MMove(hwnd,727,377)//移动左键到“急速”
Delay 400
Plugin BGKM5.LClick(hwnd,727,377)//左键单击“急速“
Delay 400
Plugin BGKM5.MMove(hwnd, 808,405)//左键移动到“确定出击”
Delay 400
Plugin BGKM5.LClick(hwnd,808,405)//左键单击“确定出击”
Delay 400
Plugin BGKM5.MMove(hwnd,758,300)//左键移动到“确定”
Delay 400
Plugin BGKM5.LClick(hwnd,758,300)//左键单击“确定”
Delay 500
Plugin BGKM5.MMove(hwnd,1062,57)//左键移动到“关闭窗口”
Delay 400
Plugin BGKM5.LClick(hwnd,1062,57)//左键单击“关闭窗口”
Delay 400//以上为一个出征循环,多次出征可复制以上内容
Plugin BGKM5.MMove(hwnd,668,297)//移动左键到“军事行动”
Delay 400
Plugin BGKM5.LClick(hwnd,668,297)//左键单击“军事行动”
Delay 400
Plugin BGKM5.MMove(hwnd,573,199)//移动左键到“第一舰队”
Delay 400
Plugin BGKM5.LClick(hwnd,573,199)//左键单击“第一舰队”
Delay 400
Plugin BGKM5.MMove(hwnd,727,377)//移动左键到“急速”
Delay 400
Plugin BGKM5.LClick(hwnd,727,377)//左键单击“急速“
Delay 400
Plugin BGKM5.MMove(hwnd, 808,405)//左键移动到“确定出击”
Delay 400
Plugin BGKM5.LClick(hwnd,808,405)//左键单击“确定出击”
Delay 400
Plugin BGKM5.MMove(hwnd,758,300)//左键移动到“确定”
Delay 400
Plugin BGKM5.LClick(hwnd,758,300)//左键单击“确定”
Delay 500
Plugin BGKM5.MMove(hwnd,1062,57)//左键移动到“关闭窗口”
Delay 400
Plugin BGKM5.LClick(hwnd,1062,57)//左键单击“关闭窗口”
Delay 400
Plugin BGKM5.MMove(hwnd,668,297)//移动左键到“军事行动”
Delay 120000
问题已经找到,自己动手进行了解决 展开
3个回答
展开全部
具体代码如下:
PutAttachment "d:\p", "*.*"
//获取窗口句柄
Hwnd = Plugin.Window.MousePoint()
//获取窗口客户区左上角坐标
sRect = Plugin.Window.GetClientRect(Hwnd)
xyArray = Split(sRect, "|", - 1 , 1)
dx = xyArray(0)
dy = xyArray(1)
//转移窗口
KMData = Plugin.bgkms6_10.KMTransform(hwnd, 0)
//Plugin.BGCP2_02.TransformWindow 参数1
//加载图片
tu = Plugin.BGCP2_02.LoadBMP("d:\p\4.bmp")
tu1 = Plugin.BGCP2_02.LoadBMP("d:\p\12.bmp")
Do
Call Plugin.Bkgnd.KeyPress(Hwnd, 9)
Delay 100
Call Plugin.Bkgnd.KeyPress(Hwnd, 49)
Delay 3000
For 60
Call Plugin.BGCP2_02.FindPicture(hwnd, 0, 0, 1024, 768 ,tu(0), 30, 0.9, ipX, ipY)
If ipX > 0 And ipY > 0 Then
Call Plugin.Bkgnd.KeyPress(Hwnd, 51)
Delay 1000
Call Plugin.BGCP2_02.FindPicture(hwnd, 0, 0, 1024, 768 ,tu1(0), 30, 0.9, intX, intY)
If intX > 0 And intY > 0 Then
Call Plugin.bgkms6_10.MoveTo(KMData, intX, intY) //
Delay 1000
call Plugin.bgkms6_10.LeftClick (KMData) //这里后台点击鼠标左击没反应,是不是那地方写错了?
Delay 200
End If
End If
//End If
Next
Delay 100
Loop
Sub OnScriptExit
//释放转移窗口
Call Plugin.BGCP2_02.UnTransformWindow(Hwnd)
call Plugin.bgkms6_10.KMUntransform (KMData)
End Sub
PutAttachment "d:\p", "*.*"
//获取窗口句柄
Hwnd = Plugin.Window.MousePoint()
//获取窗口客户区左上角坐标
sRect = Plugin.Window.GetClientRect(Hwnd)
xyArray = Split(sRect, "|", - 1 , 1)
dx = xyArray(0)
dy = xyArray(1)
//转移窗口
KMData = Plugin.bgkms6_10.KMTransform(hwnd, 0)
//Plugin.BGCP2_02.TransformWindow 参数1
//加载图片
tu = Plugin.BGCP2_02.LoadBMP("d:\p\4.bmp")
tu1 = Plugin.BGCP2_02.LoadBMP("d:\p\12.bmp")
Do
Call Plugin.Bkgnd.KeyPress(Hwnd, 9)
Delay 100
Call Plugin.Bkgnd.KeyPress(Hwnd, 49)
Delay 3000
For 60
Call Plugin.BGCP2_02.FindPicture(hwnd, 0, 0, 1024, 768 ,tu(0), 30, 0.9, ipX, ipY)
If ipX > 0 And ipY > 0 Then
Call Plugin.Bkgnd.KeyPress(Hwnd, 51)
Delay 1000
Call Plugin.BGCP2_02.FindPicture(hwnd, 0, 0, 1024, 768 ,tu1(0), 30, 0.9, intX, intY)
If intX > 0 And intY > 0 Then
Call Plugin.bgkms6_10.MoveTo(KMData, intX, intY) //
Delay 1000
call Plugin.bgkms6_10.LeftClick (KMData) //这里后台点击鼠标左击没反应,是不是那地方写错了?
Delay 200
End If
End If
//End If
Next
Delay 100
Loop
Sub OnScriptExit
//释放转移窗口
Call Plugin.BGCP2_02.UnTransformWindow(Hwnd)
call Plugin.bgkms6_10.KMUntransform (KMData)
End Sub
展开全部
脚本如下
Dim hwnd
Plugin hwnd=Window.MousePoint()
Delay 1000
Rem star
Plugin BGKM5.MMove(hwnd,668,297)//移动左键到“军事行动”
Delay 400
Plugin BGKM5.LClick(hwnd,668,297)//左键单击“军事行动”
Delay 400
Plugin BGKM5.MMove(hwnd,573,199)//移动左键到“第一舰队”
Delay 400
Plugin BGKM5.LClick(hwnd,573,199)//左键单击“第一舰队”
Delay 400
Plugin BGKM5.MMove(hwnd,727,377)//移动左键到“急速”
Delay 400
Plugin BGKM5.LClick(hwnd,727,377)//左键单击“急速“
Delay 400
Plugin BGKM5.MMove(hwnd, 808,405)//左键移动到“确定出击”
Delay 400
Plugin BGKM5.LClick(hwnd,808,405)//左键单击“确定出击”
Delay 400
Plugin BGKM5.MMove(hwnd,758,300)//左键移动到“确定”
Delay 400
Plugin BGKM5.LClick(hwnd,758,300)//左键单击“确定”
Delay 500
Plugin BGKM5.MMove(hwnd,1062,57)//左键移动到“关闭窗口”
Delay 400
Plugin BGKM5.LClick(hwnd,1062,57)//左键单击“关闭窗口”
Delay 400//以上为一个出征循环,多次出征可复制以上内容
Plugin BGKM5.MMove(hwnd,668,297)//移动左键到“军事行动”
Delay 400
Plugin BGKM5.LClick(hwnd,668,297)//左键单击“军事行动”
Delay 400
Plugin BGKM5.MMove(hwnd,573,199)//移动左键到“第一舰队”
Delay 400
Plugin BGKM5.LClick(hwnd,573,199)//左键单击“第一舰队”
Delay 400
Plugin BGKM5.MMove(hwnd,727,377)//移动左键到“急速”
Delay 400
Plugin BGKM5.LClick(hwnd,727,377)//左键单击“急速“
Delay 400
Plugin BGKM5.MMove(hwnd, 808,405)//左键移动到“确定出击”
Delay 400
Plugin BGKM5.LClick(hwnd,808,405)//左键单击“确定出击”
Delay 400
Plugin BGKM5.MMove(hwnd,758,300)//左键移动到“确定”
Delay 400
Plugin BGKM5.LClick(hwnd,758,300)//左键单击“确定”
Delay 500
Plugin BGKM5.MMove(hwnd,1062,57)//左键移动到“关闭窗口”
Delay 400
Plugin BGKM5.LClick(hwnd,1062,57)//左键单击“关闭窗口”
Delay 400
Plugin BGKM5.MMove(hwnd,668,297)//移动左键到“军事行动”
Delay 120000
Dim hwnd
Plugin hwnd=Window.MousePoint()
Delay 1000
Rem star
Plugin BGKM5.MMove(hwnd,668,297)//移动左键到“军事行动”
Delay 400
Plugin BGKM5.LClick(hwnd,668,297)//左键单击“军事行动”
Delay 400
Plugin BGKM5.MMove(hwnd,573,199)//移动左键到“第一舰队”
Delay 400
Plugin BGKM5.LClick(hwnd,573,199)//左键单击“第一舰队”
Delay 400
Plugin BGKM5.MMove(hwnd,727,377)//移动左键到“急速”
Delay 400
Plugin BGKM5.LClick(hwnd,727,377)//左键单击“急速“
Delay 400
Plugin BGKM5.MMove(hwnd, 808,405)//左键移动到“确定出击”
Delay 400
Plugin BGKM5.LClick(hwnd,808,405)//左键单击“确定出击”
Delay 400
Plugin BGKM5.MMove(hwnd,758,300)//左键移动到“确定”
Delay 400
Plugin BGKM5.LClick(hwnd,758,300)//左键单击“确定”
Delay 500
Plugin BGKM5.MMove(hwnd,1062,57)//左键移动到“关闭窗口”
Delay 400
Plugin BGKM5.LClick(hwnd,1062,57)//左键单击“关闭窗口”
Delay 400//以上为一个出征循环,多次出征可复制以上内容
Plugin BGKM5.MMove(hwnd,668,297)//移动左键到“军事行动”
Delay 400
Plugin BGKM5.LClick(hwnd,668,297)//左键单击“军事行动”
Delay 400
Plugin BGKM5.MMove(hwnd,573,199)//移动左键到“第一舰队”
Delay 400
Plugin BGKM5.LClick(hwnd,573,199)//左键单击“第一舰队”
Delay 400
Plugin BGKM5.MMove(hwnd,727,377)//移动左键到“急速”
Delay 400
Plugin BGKM5.LClick(hwnd,727,377)//左键单击“急速“
Delay 400
Plugin BGKM5.MMove(hwnd, 808,405)//左键移动到“确定出击”
Delay 400
Plugin BGKM5.LClick(hwnd,808,405)//左键单击“确定出击”
Delay 400
Plugin BGKM5.MMove(hwnd,758,300)//左键移动到“确定”
Delay 400
Plugin BGKM5.LClick(hwnd,758,300)//左键单击“确定”
Delay 500
Plugin BGKM5.MMove(hwnd,1062,57)//左键移动到“关闭窗口”
Delay 400
Plugin BGKM5.LClick(hwnd,1062,57)//左键单击“关闭窗口”
Delay 400
Plugin BGKM5.MMove(hwnd,668,297)//移动左键到“军事行动”
Delay 120000
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
呵呵
缺少goto star
缺少goto star
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询