按键精灵多线程后台找色的问题
自己写的脚本,单独运行3个子程序时正常但整合到一起就没反应了子程序a:找色执行鼠标点击(点击后画面会有变化)子程序b:如果10秒内某点颜色无变化(10秒内子程序a找不到颜...
自己写的脚本,单独运行3个子程序时正常
但整合到一起就没反应了
子程序a:找色执行鼠标点击(点击后画面会有变化)
子程序b:如果10秒内某点颜色无变化(10秒内子程序a找不到颜色时),跳转至c
子程序c:效果同a,但是a找到颜色时优先执行a
求高手指教~~
Hwnd = Plugin.Window.MousePoint()
BeginThread a : BeginThread b
While 1
Wend
While 2
Wend
Sub a
While 1
XY = Plugin.Bkgnd.FindColor(Hwnd, 634, 368, 814, 447, "00FFFF")
ZB = InStr(XY, "|")
intX = Clng(Left(XY, ZB - 1)) : intY = Clng(Right(XY, Len(XY) - ZB))
If intX > 0 And intY > 0 Then
Call Plugin.Bkgnd.LeftClick(Hwnd, intX, intY)
Delay 1000
End If
Wend
End Sub
Sub b
While 2
d = Plugin.Bkgnd.GetPixelColor(Hwnd, 330, 221)
Delay 10000
f = Plugin.Bkgnd.GetPixelColor(Hwnd, 330, 221)
If d = f Then
Call c
End If
Wend
End Sub
Sub c
XY = Plugin.Bkgnd.FindColor(Hwnd, 1251, 476, 1343, 489, "00FFFF")
ZB = InStr(XY, "|")
intX2 = Clng(Left(XY, ZB - 1)) : intY2 = Clng(Right(XY, Len(XY) - ZB))
If intX2 > 0 And intY2 > 0 Then
Call Plugin.Bkgnd.LeftClick(Hwnd, intX2, intY2)
Delay 1000
End If
End Sub 展开
但整合到一起就没反应了
子程序a:找色执行鼠标点击(点击后画面会有变化)
子程序b:如果10秒内某点颜色无变化(10秒内子程序a找不到颜色时),跳转至c
子程序c:效果同a,但是a找到颜色时优先执行a
求高手指教~~
Hwnd = Plugin.Window.MousePoint()
BeginThread a : BeginThread b
While 1
Wend
While 2
Wend
Sub a
While 1
XY = Plugin.Bkgnd.FindColor(Hwnd, 634, 368, 814, 447, "00FFFF")
ZB = InStr(XY, "|")
intX = Clng(Left(XY, ZB - 1)) : intY = Clng(Right(XY, Len(XY) - ZB))
If intX > 0 And intY > 0 Then
Call Plugin.Bkgnd.LeftClick(Hwnd, intX, intY)
Delay 1000
End If
Wend
End Sub
Sub b
While 2
d = Plugin.Bkgnd.GetPixelColor(Hwnd, 330, 221)
Delay 10000
f = Plugin.Bkgnd.GetPixelColor(Hwnd, 330, 221)
If d = f Then
Call c
End If
Wend
End Sub
Sub c
XY = Plugin.Bkgnd.FindColor(Hwnd, 1251, 476, 1343, 489, "00FFFF")
ZB = InStr(XY, "|")
intX2 = Clng(Left(XY, ZB - 1)) : intY2 = Clng(Right(XY, Len(XY) - ZB))
If intX2 > 0 And intY2 > 0 Then
Call Plugin.Bkgnd.LeftClick(Hwnd, intX2, intY2)
Delay 1000
End If
End Sub 展开
1个回答
展开全部
Hwnd = Plugin.Window.MousePoint()
dimenv av
dim b2(0)
b2(0)=Hwnd
av=join(b2,"|")
BeginThread a : BeginThread b
While 1
Wend
While 2
Wend
Sub a
While 1
XY = Plugin.Bkgnd.FindColor(av, 634, 368, 814, 447, "00FFFF")
ZB = InStr(XY, "|")
intX = Clng(Left(XY, ZB - 1)) : intY = Clng(Right(XY, Len(XY) - ZB))
If intX > 0 And intY > 0 Then
Call Plugin.Bkgnd.LeftClick(av, intX, intY)
Delay 1000
End If
Wend
End Sub
Sub b
While 2
d = Plugin.Bkgnd.GetPixelColor(av, 330, 221)
Delay 10000
f = Plugin.Bkgnd.GetPixelColor(av, 330, 221)
If d = f Then
Call c
End If
Wend
End Sub
Sub c
XY = Plugin.Bkgnd.FindColor(av, 1251, 476, 1343, 489, "00FFFF")
ZB = InStr(XY, "|")
intX2 = Clng(Left(XY, ZB - 1)) : intY2 = Clng(Right(XY, Len(XY) - ZB))
If intX2 > 0 And intY2 > 0 Then
Call Plugin.Bkgnd.LeftClick(av, intX2, intY2)
Delay 1000
End If
End Sub
dimenv av
dim b2(0)
b2(0)=Hwnd
av=join(b2,"|")
BeginThread a : BeginThread b
While 1
Wend
While 2
Wend
Sub a
While 1
XY = Plugin.Bkgnd.FindColor(av, 634, 368, 814, 447, "00FFFF")
ZB = InStr(XY, "|")
intX = Clng(Left(XY, ZB - 1)) : intY = Clng(Right(XY, Len(XY) - ZB))
If intX > 0 And intY > 0 Then
Call Plugin.Bkgnd.LeftClick(av, intX, intY)
Delay 1000
End If
Wend
End Sub
Sub b
While 2
d = Plugin.Bkgnd.GetPixelColor(av, 330, 221)
Delay 10000
f = Plugin.Bkgnd.GetPixelColor(av, 330, 221)
If d = f Then
Call c
End If
Wend
End Sub
Sub c
XY = Plugin.Bkgnd.FindColor(av, 1251, 476, 1343, 489, "00FFFF")
ZB = InStr(XY, "|")
intX2 = Clng(Left(XY, ZB - 1)) : intY2 = Clng(Right(XY, Len(XY) - ZB))
If intX2 > 0 And intY2 > 0 Then
Call Plugin.Bkgnd.LeftClick(av, intX2, intY2)
Delay 1000
End If
End Sub
追问
方便留个QQ么?
或者加我的119107298
中智咨询
2024-08-28 广告
2024-08-28 广告
在当今竞争激烈的商业环境中,企业需要不断提高自身的竞争力,以保持市场份额和增加利润。通过人效提升,企业可以更有效地利用有限的资源,提高生产力和效益,从而实现盈利目标。中智咨询提供全方位的组织人效评价与诊断、人效提升方案等数据和管理咨询服务。...
点击进入详情页
本回答由中智咨询提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询