找回密码
 加入
搜索
查看: 5958|回复: 7

[交流] 請教 3個有兩個以上條件成立,該如何敘述?

[复制链接]
发表于 2011-5-30 19:03:00 | 显示全部楼层 |阅读模式
底下這樣 第3種錯誤:有沒有別的方法?
-------------------------------------------
$y1 = PixelGetColor(960,179)
$y2 = PixelGetColor(960,197)
$y3 = PixelGetColor(960,215)
Select
Case ($y1=32768 and $y2=32768) or ($y1=32768 and $y3=32768) or ($y2=32768 and $y3=32168)
Sleep(1000)
MsgBox(0, "", "3次勝2次以上向前進",1)
endSelect
发表于 2011-5-30 22:41:16 | 显示全部楼层
$y1 = PixelGetColor(960,179)
$y2 = PixelGetColor(960,197)
$y3 = PixelGetColor(960,215)
if  ($y1=32768 and $y2=32768) or ($y1=32768 and $y3=32768) or ($y2=32768 and $y3=32168) then
Sleep(1000)
MsgBox(0, "", "3次勝2次以上向前進",1)
endif
发表于 2011-5-31 08:29:12 | 显示全部楼层
本帖最后由 netegg 于 2011-5-31 08:44 编辑
$i1 = PixelGetColor(960,179)
$i2 = PixelGetColor(960,197)
$i3 = PixelGetColor(960,215)
Select
        Case $i1 = 32768
                If $i2 = 32768 Then
                        MsgBox(0,0,'ok')
                Else 
                        If $i3= 32768 Then
                                MsgBox(0,0,'ok')
                        EndIf
                EndIf
        Case Else 
                If $i2= $i3 Then
                        MsgBox(0,0,'ok')
                EndIf
EndSelect                
Local $i1 = PixelGetColor(960,179)
Local $i2 = PixelGetColor(960,197)
Local $i3 = PixelGetColor(960,215)
Switch True
        Case ($i1 = $i2 = 32768) Or ($i1 = $i3 = 32768) Or ($i2 = $i3 = 32768)
                        MsgBox(0,0,'ok')
        Case Else 
                        MsgBox(0,0,'no')
EndSwitch                
另外,LZ到底要干什么,目的或想要的结果到底是什么也不说明白了,是就要判断还是要什么
 楼主| 发表于 2011-5-31 08:57:54 | 显示全部楼层
2樓錯 第3種無效  是不是不能 太多 or
3樓的第2種 錯
发表于 2011-5-31 09:55:13 | 显示全部楼层
本帖最后由 netegg 于 2011-5-31 10:02 编辑

回复 4# tcpuuu
说半天你也不说明白到底是什么问题,错了?是什么错了?你怎么确定是错了?
Local $i1 = 32768
Local $i2 = 32768
Local $i3 = 32718
;--------------------
;Local $i1 = 32768
;Local $i2 = 32718
;Local $i3 = 32768
;---------------------
;Local $i1 = 32718
;Local $i2 = 32768
;Local $i3 = 32768
;---------------------
;Local $i1 = 32738
;Local $i2 = 32768
;Local $i3 = 32718
Switch True
        Case ($i1 = $i2 = 32768) Or ($i1 = $i3 = 32768) Or ($i2 = $i3 = 32768)
                        MsgBox(0,0,'ok')
        Case Else 
                        MsgBox(0,0,'no')
EndSwitch                
你给定数值自己去测试呀
 楼主| 发表于 2011-5-31 11:28:07 | 显示全部楼层
本帖最后由 tcpuuu 于 2011-5-31 11:33 编辑

Local $i1 = PixelGetColor(960,179)
Local $i2 = PixelGetColor(960,197)
Local $i3 = PixelGetColor(960,215)
Switch True
        Case ($i1 = $i2 = 32768) Or ($i1 = $i3 = 32768) Or ($i2 = $i3 = 32768)
                        MsgBox(0,0,'ok')
        Case Else
                        MsgBox(0,0,'no')
EndSwitch               
==========================================
要 2個座標點都是32718顏色 才是OK(12 or 13 or 23)
只有1個 顏色對 它也說OK
------------------------------------------------------------
--------------------------------------------------------
底下這個是可以   是否有更簡化的?
$y1 = PixelGetColor(960,179)
$y2 = PixelGetColor(960,197)
$y3 = PixelGetColor(960,215)
IF $y1=32768 and $y2=32768  then   ;12都對   3 不管是對錯 都 ok
MsgBox(0,0,'ok')
Elseif $y3=32768 then                         ;12沒有都對  3一定要對 才 ok
MsgBox(0,0,'ok')
Else
MsgBox(0,0,'NO')
Endif
------------------------------------------;
发表于 2011-5-31 12:30:08 | 显示全部楼层
回复 6# tcpuuu
Local $i1 = 32718
Local $i2 = 32768
Local $i3 = 32718
Switch $i1
        Case 32768
                If ($i2 = 32768) Or ($i3 = 32768) Then MsgBox(0, 0, 'ok')
        Case Else
                If ($i2 = 32768) And ($i3 = 32768) Then
                        MsgBox(0, 0, 'ok')
                Else
                        MsgBox(0, 0, 'no')
                EndIf
EndSwitch
发表于 2011-5-31 12:50:43 | 显示全部楼层
本帖最后由 netegg 于 2011-5-31 13:34 编辑
Local $i1 = 32718
Local $i2 = 32768
Local $i3 = 32718
If BitOR(BitAND($i1, $i2,32768), BitAND($i2, $i3, 32768), BitAND($i1, $i3, 32768)) = 32768 Then MsgBox(0,0, 'ok')
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-3-29 19:03 , Processed in 0.073689 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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