//读取txt
word = Plugin.File.ReadFileEx("C:\1.txt")
//分割为行
Dim hang
hang = split(word, "|")
//循环打出每一行
For i = 0 To UBound(hang)
FindPic 0,0,4000,2500,"Attachment:\1.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intx+6, inty+2
LeftClick 1
End If
Delay 2000
FindPic 0,0,4000,2500,"Attachment:\2.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intx, inty
LeftClick 1
Delay 2000
SayString hang(i)
End If
Delay 2000
FindPic 0,0,4000,2500,"Attachment:\3.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intx, inty
LeftClick 1
Delay 2000
SayString "909090"
Delay 2000
End If
FindPic 0,0,4000,2500,"Attachment:\4.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intx, inty
LeftClick 1
Delay 2000
End If
Delay 2000
FindPic 0,0,4000,2500,"Attachment:\5.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intx, inty
LeftClick 1
End If
Delay 3000
FindPic 0,0,4000,2500,"Attachment:\6.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intx, inty + 150
LeftClick 1
MoveTo intx, inty + 100
Delay 1000
LeftDown 1
MoveTo intx, inty + 400
Delay 2000
LeftUp 1
Delay 1000
LeftClick 2
End If
Delay 4000
Next
出现循环第二次时,不取TXT数据,其它部份功能不使用,第三次时又正常,是什么原因
如果没有找到图,每隔一次又正常呢,如果后面没有读到文件,为何每三次又正常呢
追答你的代码找图和循环次数都是独立的,前一次有没有找到图和后一次有没有找到图没任何关系,代码都是正常执行,只不过有没有找到图就不确定,不是因为没找到图就不正常,找到图就正常,主要问题你都没分析出来怎么可能能把代码写好。我很明确的告诉你,是你找图逻辑有问题,不是读文件有问题,你在
word = Plugin.File.ReadFileEx("C:\1.txt")这句后面加上
Message word
看看对话框是不是都有文件的内容,如果是就不是读文件的问题。有些问题要设断点才能分析出来的。