TC官方合作论坛

标题: 循环找图。怎么老是第一次能找到以后的每一次都找不到了求解 [打印本页]

作者: heshilove2    时间: 2013-10-19 21:26
标题: 循环找图。怎么老是第一次能找到以后的每一次都找不到了求解
function LkFindPic()
    //dm =com("dm.dmsoft")
    ts = com("ts.tssoft")
    //dm.SetPath(help.getrcpath("rc:"))
    ts.SetPath(help.getrcpath("rc:"))  
    int x,y,hald
    hald = window.findwindow("xxx - Microsoft Internet Explorer")
    //dm.BindWindow(hald,"normal","normal","normal",1)
    ts.BindWindow(hald,"normal","normal","normal",1)   
    if(ts.IsBind()!=0)
        while(1)
            // x = 0,y=0
            num=type.cint(ts.FindPic(0,0,1440,900,"111.bmp|222.bmp",000000,0.8,0,x,y))
            if(num!=-1&&x>0&&y>0)
                ts.MoveTo(x+50,y+15)   
                help.sleep(200)
                ts.LeftClick()
                help.sleep(3000)

            endif
        endwhile
    endif

endfunction

作者: klyyz1980    时间: 2013-10-19 23:35
在找图后面输调试出返回值和坐标值,看一下就知道怎么回事了
作者: 贱哥    时间: 2013-10-20 00:11
  endwhile
改成
help.sleep(1000)
  endwhile
作者: heshilove2    时间: 2013-10-20 10:36
回复 2楼klyyz1980的帖子

都是-1
作者: heshilove2    时间: 2013-10-20 10:37
回复 3楼贱哥的帖子

一样 已经解决了 图片的问题




欢迎光临 TC官方合作论坛 (http://bbs.52tc.co/) Powered by Discuz! X3.1