找回密码
 加入
搜索
查看: 3506|回复: 6

[GUI管理] [已解決]等待 顏色出現 then.... (這要如何敘述?)

  [复制链接]
发表于 2010-8-16 03:30:25 | 显示全部楼层 |阅读模式
本帖最后由 tcpuuu 于 2010-8-19 05:39 编辑

等待  200,100座標  顏色出現0xFF0000 then
MsgBox(0, 0,紅色已經出現)
end
等待 200,100座標  顏色出現0xFF0000(設定等待時間10秒)
------------------------
拜託請教我..謝謝
发表于 2010-8-16 03:52:14 | 显示全部楼层
Local $Count = 0, $EL = 10 * 1000
While 1
        If $Count = $EL / 100 Then ExitLoop
        $var = PixelGetColor(200, 100)
        If Hex($var, 6) = 'FF0000' Then
                MsgBox(0, 0, '紅色已經出現')
                ExitLoop
        EndIf
        Sleep(100)
        $Count += 1
WEnd
发表于 2010-8-16 06:11:50 | 显示全部楼层
Local $begin=TimerInit()
While TimerDiff($begin)<10000 And PixelGetColor(200,100)<>16711680
        Sleep(100)
WEnd
If TimerDiff($begin)<10000 Then MsgBox(0,"","紅色已經出現")
发表于 2010-8-16 07:01:12 | 显示全部楼层
do
msgbox('','','ok')
sleep(100)
until PixelGetColor(200,100) = 16711680
 楼主| 发表于 2010-8-16 10:39:29 | 显示全部楼层
謝謝大家解答!尤其特別 感謝afan 版主
另外 請問 Duvet    16711680 是代表紅色嗎?    如果其他色是什麼?
-----------------------------------------------------
還有 如果   等待PixelGetColor(200,100,紅色)  and  PixelGetColor(190,100,紅色) then
                  MsgBox(0,"","兩個地方的指定顏色皆出現")

                 PixelGetColor(200,100,紅色)  or  PixelGetColor(190,100,紅色) then
                 MsgBox(0,"","其中1個指定顏色已出現")
這又該如何?
发表于 2010-8-16 13:14:32 | 显示全部楼层
回复 5# tcpuuu
MsgBox(0,"",Hex(16711680,6))
Local $begin=TimerInit(),$flag1=false,$flag2=false

Do
        If PixelGetColor(190,100)=16711680 Then $flag1=True
        If PixelGetColor(200,100)=16711680 Then $flag2=True
        Sleep(100)
Until TimerDiff($begin)>10000 Or $flag1 Or $flag2
Msgbox(0,TimerDiff($begin)>10000,"(190,100)的位置是否為紅色:"&$flag1&@CRLF&"(200,100)的位置是否為紅色:"&$flag2)
发表于 2010-8-18 14:56:26 | 显示全部楼层
高手还真不少
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-6-9 04:49 , Processed in 0.077851 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表