按键精灵有关于后台找色的循环语句? 看看我的对吗?
Hwnd=Plugin.Window.MousePoint()CallPlugin.Bkgnd.LeftClick(Hwnd,869,561)Delay1000XY=Pl...
Hwnd = Plugin.Window.MousePoint()
Call Plugin.Bkgnd.LeftClick(Hwnd, 869, 561)
Delay 1000
XY = Plugin.Bkgnd.FindColor(Hwnd, 0, 0, 949, 599, "87AEC5")
Dim MyArray
MyArray = Split(XY, "|")
X = Clng(MyArray(0)): Y = Clng(MyArray(1))
While X > 0
Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, x, y)
Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, 402, 356)
Delay 1000
Call Plugin.Bkgnd.KeyUp(Hwnd, 38)
Delay 60000
Call Plugin.Bkgnd.KeyUp(Hwnd, 40)
Delay 10000
Call Plugin.Bkgnd.LeftClick(Hwnd, 869, 561)
Else
Call Plugin.Bkgnd.LeftClick(Hwnd, 876, 515)
Wend
意思就是先点开869, 561 然后在点开后 找色87AEC5 然后如果找到了 就执行Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, x, y)
Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, 402, 356)
Delay 1000
Call Plugin.Bkgnd.KeyUp(Hwnd, 38)
Delay 60000
Call Plugin.Bkgnd.KeyUp(Hwnd, 40)
Delay 10000
Call Plugin.Bkgnd.LeftClick(Hwnd, 869, 561)
找不到就执行Call Plugin.Bkgnd.LeftClick(Hwnd, 876, 515)
然后在执行了上一步后 再进行找色 Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, x, y)
Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, 402, 356)
Delay 1000
Call Plugin.Bkgnd.KeyUp(Hwnd, 38)
Delay 60000
Call Plugin.Bkgnd.KeyUp(Hwnd, 40)
Delay 10000
就这样循环!
大体就是 先找色 再判断找到与否 (找到了执行A套 找不到了 执行B套 )找不到了 执行B套后 再循环括号中的语句 展开
Call Plugin.Bkgnd.LeftClick(Hwnd, 869, 561)
Delay 1000
XY = Plugin.Bkgnd.FindColor(Hwnd, 0, 0, 949, 599, "87AEC5")
Dim MyArray
MyArray = Split(XY, "|")
X = Clng(MyArray(0)): Y = Clng(MyArray(1))
While X > 0
Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, x, y)
Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, 402, 356)
Delay 1000
Call Plugin.Bkgnd.KeyUp(Hwnd, 38)
Delay 60000
Call Plugin.Bkgnd.KeyUp(Hwnd, 40)
Delay 10000
Call Plugin.Bkgnd.LeftClick(Hwnd, 869, 561)
Else
Call Plugin.Bkgnd.LeftClick(Hwnd, 876, 515)
Wend
意思就是先点开869, 561 然后在点开后 找色87AEC5 然后如果找到了 就执行Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, x, y)
Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, 402, 356)
Delay 1000
Call Plugin.Bkgnd.KeyUp(Hwnd, 38)
Delay 60000
Call Plugin.Bkgnd.KeyUp(Hwnd, 40)
Delay 10000
Call Plugin.Bkgnd.LeftClick(Hwnd, 869, 561)
找不到就执行Call Plugin.Bkgnd.LeftClick(Hwnd, 876, 515)
然后在执行了上一步后 再进行找色 Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, x, y)
Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, 402, 356)
Delay 1000
Call Plugin.Bkgnd.KeyUp(Hwnd, 38)
Delay 60000
Call Plugin.Bkgnd.KeyUp(Hwnd, 40)
Delay 10000
就这样循环!
大体就是 先找色 再判断找到与否 (找到了执行A套 找不到了 执行B套 )找不到了 执行B套后 再循环括号中的语句 展开
展开全部
Hwnd = Plugin.Window.MousePoint()
rem a
Call Plugin.Bkgnd.LeftClick(Hwnd, 869, 561)
Delay 1000
XY = Plugin.Bkgnd.FindColor(Hwnd, 0, 0, 949, 599, "87AEC5")
Dim MyArray
MyArray = Split(XY, "|")
X = Clng(MyArray(0)): Y = Clng(MyArray(1))
If X > 0 and y > 0 Then
Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, x, y)
Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, 402, 356)
Delay 1000
Call Plugin.Bkgnd.KeyUp(Hwnd, 38)
Delay 60000
Call Plugin.Bkgnd.KeyUp(Hwnd, 40)
Delay 10000
Call Plugin.Bkgnd.LeftClick(Hwnd, 869, 561)
Else
Call Plugin.Bkgnd.LeftClick(Hwnd, 876, 515)
goto a
End If
rem a
Call Plugin.Bkgnd.LeftClick(Hwnd, 869, 561)
Delay 1000
XY = Plugin.Bkgnd.FindColor(Hwnd, 0, 0, 949, 599, "87AEC5")
Dim MyArray
MyArray = Split(XY, "|")
X = Clng(MyArray(0)): Y = Clng(MyArray(1))
If X > 0 and y > 0 Then
Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, x, y)
Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, 402, 356)
Delay 1000
Call Plugin.Bkgnd.KeyUp(Hwnd, 38)
Delay 60000
Call Plugin.Bkgnd.KeyUp(Hwnd, 40)
Delay 10000
Call Plugin.Bkgnd.LeftClick(Hwnd, 869, 561)
Else
Call Plugin.Bkgnd.LeftClick(Hwnd, 876, 515)
goto a
End If
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
展开全部
你这坐标是怎么取的
找色不需要绑定窗口的吗?
找色不需要绑定窗口的吗?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询