TC官方合作论坛

标题: 学习半天TC写出来的“清空回收站”代码,分享给大家,主要是点击和移动鼠标操作! [打印本页]

作者: chentaotest    时间: 2012-8-16 15:59
标题: 学习半天TC写出来的“清空回收站”代码,分享给大家,主要是点击和移动鼠标操作!
namespace 清空回收站
//定义默认空间
function bool start_click()
//这里添加你要执行的代码
int isfind,x,y
if(0==color.findpic(0,0,1440,900,"c:\\无垃圾.bmp",#101010,1.0,0,x,y))
    help.messagebox("回收站中无垃圾文件!")
    bool exit=help.exit()
else
        if(0==color.findpic(0,0,1440,900,"c:\\有垃圾.bmp",#101010,1.0,0,x,y))
        drivemouse.mousemove(x+3,y+3)
        help.sleep(1000)
        drivemouse.leftdoubleclick(1)
        help.sleep(2000)
        if(0==color.findpic(0,0,1440,900,"c:\\清空.bmp",#101010,1.0,0,x,y))
            drivemouse.mousemove(x+10,y+5)
            help.sleep(1000)
            drivemouse.leftclick(1)
            help.sleep(1000)
            if(0==color.findpic(0,0,1440,900,"c:\\是.bmp",#101010,1.0,0,x,y))
                drivemouse.mousemove(x+10,y+5)
                help.sleep(1000)
                drivemouse.leftclick(1)
                help.sleep(1000)
                if(0==color.findpic(0,0,1440,900,"c:\\清空.bmp",#101010,1.0,0,x,y))
                else
                    help.messagebox("检测到回收站中还有其他垃圾文件!")
                endif
            else
                help.messagebox("确认清空回收站对话框未弹出!")
            endif
        else
            help.messagebox("未找到“清空回收站”按钮!")
        endif
        else
            help.messagebox("检测出现异常!请重新检测!")
            bool exit=help.exit()
        endif
endif
return true
//函数返回语句
endfunction

function bool exit_click()
//这里添加你要执行的代码
help.exit()

return true
//函数返回语句
endfunction

endnamespace
//空间结束语句
作者: chentaotest    时间: 2012-8-16 16:00
我觉得我的悟性还可以
下面就该回去拿游戏做实验了,写一个辅助出来,但愿“问道”这个游戏不会检测出来。。。
作者: yy3259    时间: 2012-8-16 18:49
新手   看不明白




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