求按键精灵后台鼠标连续点击窗口屏幕中央
求按键精灵后台鼠标连续点击窗口屏幕中央(就是我有个范围技能按下技能数字键有范围需要鼠标点下才可以施放能设置延迟和按键设置最好)跪谢这是我写的脚本一开始的是网上抄的计算窗口...
求按键精灵后台鼠标连续点击窗口屏幕中央(就是我有个范围技能按下技能数字键有范围 需要鼠标点下才可以施放 能设置延迟和按键设置最好 )跪谢
这是我写的脚本 一开始的是网上抄的计算窗口中心的东西。但切换到其他窗口后 那个游戏窗口就不正常了 不放技能
Hwnd = Plugin.Window.GetKeyFocusWnd() Call Plugin.Window.Active(Hwnd) Call Plugin.Window.Restore(Hwnd) sRect = Plugin.Window.GetClientRect(Hwnd) Dim sRect_Array //左上角XY坐标以及宽度高度 sRect_Array = Split(sRect, "|") sRect_TopLeftX = Clng(sRect_Array(0)) sRect_TopLeftY = Clng(sRect_Array(1)) sRect_Width = Clng(sRect_Array(2)) sRect_Height = Clng(sRect_Array(3)) //得到右上角坐标X右下角坐标X sRect_TopRightX = sRect_TopLeftX+sRect_Width sRect_BottomRightX = sRect_TopLeftX+sRect_Width sRect_BottomLeftX = sRect_TopLeftX //得到右上角坐标Y右下角坐标Y sRect_TopRightY = sRect_TopLeftY sRect_BottomRightY = sRect_TopLeftY+sRect_Height sRect_BottomLeftY = sRect_TopLeftY+sRect_Height //得到窗口中心点的坐标 sRect_MiddleX = sRect_TopLeftX + sRect_Width / 2 sRect_MiddleY = sRect_TopLeftY + sRect_Height / 2 //下面这句用于向后台窗口句柄(变量:Hwnd)发送一个鼠标移动到客户区域(坐标: 960, 560)处 Call Plugin.Bkgnd.MoveTo(Hwnd,sRect_MiddleX,sRect_MiddleY) Rem fjn KeyPress "F2", 1 //下面这句用于向后台窗口句柄(变量:Hwnd)的客户区域(坐标: 960, 560)处发送一个鼠标zuojian单击 Call Plugin.Bkgnd.LeftClick(Hwnd,sRect_MiddleX,sRect_MiddleY)
Delay 8500
Goto fjn
Rem a
还有有没有办法 同时对2个同一游戏的2个窗口进行运行脚本 展开
这是我写的脚本 一开始的是网上抄的计算窗口中心的东西。但切换到其他窗口后 那个游戏窗口就不正常了 不放技能
Hwnd = Plugin.Window.GetKeyFocusWnd() Call Plugin.Window.Active(Hwnd) Call Plugin.Window.Restore(Hwnd) sRect = Plugin.Window.GetClientRect(Hwnd) Dim sRect_Array //左上角XY坐标以及宽度高度 sRect_Array = Split(sRect, "|") sRect_TopLeftX = Clng(sRect_Array(0)) sRect_TopLeftY = Clng(sRect_Array(1)) sRect_Width = Clng(sRect_Array(2)) sRect_Height = Clng(sRect_Array(3)) //得到右上角坐标X右下角坐标X sRect_TopRightX = sRect_TopLeftX+sRect_Width sRect_BottomRightX = sRect_TopLeftX+sRect_Width sRect_BottomLeftX = sRect_TopLeftX //得到右上角坐标Y右下角坐标Y sRect_TopRightY = sRect_TopLeftY sRect_BottomRightY = sRect_TopLeftY+sRect_Height sRect_BottomLeftY = sRect_TopLeftY+sRect_Height //得到窗口中心点的坐标 sRect_MiddleX = sRect_TopLeftX + sRect_Width / 2 sRect_MiddleY = sRect_TopLeftY + sRect_Height / 2 //下面这句用于向后台窗口句柄(变量:Hwnd)发送一个鼠标移动到客户区域(坐标: 960, 560)处 Call Plugin.Bkgnd.MoveTo(Hwnd,sRect_MiddleX,sRect_MiddleY) Rem fjn KeyPress "F2", 1 //下面这句用于向后台窗口句柄(变量:Hwnd)的客户区域(坐标: 960, 560)处发送一个鼠标zuojian单击 Call Plugin.Bkgnd.LeftClick(Hwnd,sRect_MiddleX,sRect_MiddleY)
Delay 8500
Goto fjn
Rem a
还有有没有办法 同时对2个同一游戏的2个窗口进行运行脚本 展开
4个回答
展开全部
KeyPress "F2", 1 不是绑定窗口的按键,改成
Call Plugin.Bkgnd.KeyPress(Hwnd, 113)
至于多窗口,你试一下这样,"窗口标题" 改成你游戏窗口的标题,不必完全相同,但要详细点
//下面这句是遍历符合窗口标题("记事本")的句柄保存到数组(HwndEx)里
HwndEx = Plugin.Window.Search("窗口标题")
dim MyArray
MyArray = Split(HwndEx, "|")
Hwnd = Plugin.Window.GetKeyFocusWnd()
Call Plugin.Window.Active(Hwnd)
Call Plugin.Window.Restore(Hwnd)
sRect = Plugin.Window.GetClientRect(Hwnd)
Dim sRect_Array
//左上角XY坐标以及宽度高度
sRect_Array = Split(sRect, "|")
sRect_TopLeftX = Clng(sRect_Array(0))
sRect_TopLeftY = Clng(sRect_Array(1))
sRect_Width = Clng(sRect_Array(2))
sRect_Height = Clng(sRect_Array(3))
//得到右上角坐标X右下角坐标X
sRect_TopRightX = sRect_TopLeftX + sRect_Width
sRect_BottomRightX = sRect_TopLeftX + sRect_Width
sRect_BottomLeftX = sRect_TopLeftX
//得到右上角坐标Y右下角坐标Y
sRect_TopRightY = sRect_TopLeftY
sRect_BottomRightY = sRect_TopLeftY + sRect_Height
sRect_BottomLeftY = sRect_TopLeftY + sRect_Height
//得到窗口中心点的坐标
sRect_MiddleX = sRect_TopLeftX + sRect_Width / 2
sRect_MiddleY = sRect_TopLeftY + sRect_Height / 2
//下面这句用于向后台窗口句柄(变量:Hwnd)发送一个鼠标移动到客户区域(坐标: 960, 560)处
Call Plugin.Bkgnd.MoveTo(Hwnd, sRect_MiddleX, sRect_MiddleY)
HwndEx = Plugin.Window.Search("窗口标题")
MyArray = Split(HwndEx, "|")
Rem fjn
For i = 0 To UBound(MyArray) - 1
Call Plugin.Bkgnd.KeyPress(MyArray(i), 113)
Call Plugin.Bkgnd.LeftClick(MyArray(i), sRect_MiddleX, sRect_MiddleY)
Next
Delay 8500
Goto fjn
Call Plugin.Bkgnd.KeyPress(Hwnd, 113)
至于多窗口,你试一下这样,"窗口标题" 改成你游戏窗口的标题,不必完全相同,但要详细点
//下面这句是遍历符合窗口标题("记事本")的句柄保存到数组(HwndEx)里
HwndEx = Plugin.Window.Search("窗口标题")
dim MyArray
MyArray = Split(HwndEx, "|")
Hwnd = Plugin.Window.GetKeyFocusWnd()
Call Plugin.Window.Active(Hwnd)
Call Plugin.Window.Restore(Hwnd)
sRect = Plugin.Window.GetClientRect(Hwnd)
Dim sRect_Array
//左上角XY坐标以及宽度高度
sRect_Array = Split(sRect, "|")
sRect_TopLeftX = Clng(sRect_Array(0))
sRect_TopLeftY = Clng(sRect_Array(1))
sRect_Width = Clng(sRect_Array(2))
sRect_Height = Clng(sRect_Array(3))
//得到右上角坐标X右下角坐标X
sRect_TopRightX = sRect_TopLeftX + sRect_Width
sRect_BottomRightX = sRect_TopLeftX + sRect_Width
sRect_BottomLeftX = sRect_TopLeftX
//得到右上角坐标Y右下角坐标Y
sRect_TopRightY = sRect_TopLeftY
sRect_BottomRightY = sRect_TopLeftY + sRect_Height
sRect_BottomLeftY = sRect_TopLeftY + sRect_Height
//得到窗口中心点的坐标
sRect_MiddleX = sRect_TopLeftX + sRect_Width / 2
sRect_MiddleY = sRect_TopLeftY + sRect_Height / 2
//下面这句用于向后台窗口句柄(变量:Hwnd)发送一个鼠标移动到客户区域(坐标: 960, 560)处
Call Plugin.Bkgnd.MoveTo(Hwnd, sRect_MiddleX, sRect_MiddleY)
HwndEx = Plugin.Window.Search("窗口标题")
MyArray = Split(HwndEx, "|")
Rem fjn
For i = 0 To UBound(MyArray) - 1
Call Plugin.Bkgnd.KeyPress(MyArray(i), 113)
Call Plugin.Bkgnd.LeftClick(MyArray(i), sRect_MiddleX, sRect_MiddleY)
Next
Delay 8500
Goto fjn
2012-06-01
展开全部
前后台无比混乱。。。计算的窗口坐标前台的,按键和鼠标移动后台,点击又换前台去了。。。所以切换窗口肯定不行了,最后单击那一下不知道点哪去了。。。改成后台得连前面的计算都重新写
HwndEx = Plugin.Window.Search("窗口标题") //多窗口
Hwnd = Split(HwndEx, "|")
s = Clng(Hwnd(0))
sRect = Plugin.Window.GetClientRect(s) //算中心坐标
Dim sRect_Array
sRect_Array = Split(sRect, "|")
sRect_Width = Clng(sRect_Array(2))
sRect_Height = Clng(sRect_Array(3))
sRect_MiddleX = sRect_Width / 2
sRect_MiddleY = sRect_Height / 2
do //动作部分
For i = 0 To UBound(Hwnd) - 1
Call Plugin.Bkgnd.KeyPress(Hwnd(i), 113)
delay 200
Call Plugin.Bkgnd.LeftClick(Hwnd(i), sRect_MiddleX, sRect_MiddleY)
Next
Delay 8000 //前面是单线程,延时稍微改小了点
loop
HwndEx = Plugin.Window.Search("窗口标题") //多窗口
Hwnd = Split(HwndEx, "|")
s = Clng(Hwnd(0))
sRect = Plugin.Window.GetClientRect(s) //算中心坐标
Dim sRect_Array
sRect_Array = Split(sRect, "|")
sRect_Width = Clng(sRect_Array(2))
sRect_Height = Clng(sRect_Array(3))
sRect_MiddleX = sRect_Width / 2
sRect_MiddleY = sRect_Height / 2
do //动作部分
For i = 0 To UBound(Hwnd) - 1
Call Plugin.Bkgnd.KeyPress(Hwnd(i), 113)
delay 200
Call Plugin.Bkgnd.LeftClick(Hwnd(i), sRect_MiddleX, sRect_MiddleY)
Next
Delay 8000 //前面是单线程,延时稍微改小了点
loop
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
可以,
完全可以。
可是除了你自己学习外,你要现成成品代码的话,就要钱了。
完全可以。
可是除了你自己学习外,你要现成成品代码的话,就要钱了。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
按键精灵的语法太不规范了。
你用它做后台多费劲,为什么不直接用API?
你用它做后台多费劲,为什么不直接用API?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |