TC官方合作论坛

标题: 蛤蟆练习第1贴 [打印本页]

作者: 250136457    时间: 2012-1-8 19:45
标题: 蛤蟆练习第1贴


namespace study
//定义默认空间
int 加血线程
function bool 加血加蓝啊()
int 窗口句柄,x,y
        bool 加血
        bool 加蓝
        string 游戏名,加血按键,加蓝按键
        游戏名=edit.gettext("编辑框0")
        加血按键=edit.gettext("编辑框1")
        加蓝按键=edit.gettext("编辑框2")
        窗口句柄=window.findwindow(游戏名)
        if (窗口句柄==0)
            help.messagebox("没有找到窗口")
        else
            window.setwindowtop(窗口句柄)
            window.setwindowpos(窗口句柄,0,0)
            help.sleep(500)
        endif
        while 0
        加血=color.findrectpixelcolor(0,0,400,400,#0000a2,0,x,y)
        if(!加血)
            keyboard.keypress(convert.strtoint(加血按键),1)
            help.sleep(1000)
        endif
        加蓝=color.findrectpixelcolor(0,0,400,400,#944e00,0,x,y)
        if (!加蓝)
            keyboard.keypress(convert.strtoint(加蓝按键),1)
            help.sleep(1000)
        endif
        endwhile
return ture
endfunction
function bool start_click()
//这里添加你要执行的代码
加血线程=thread.beginthread(study.加血加蓝啊)
return true
//函数返回语句
endfunction
function bool exit_click()
//这里添加你要执行的代码
thread.closethread(加血线程)
help.exit()
return true
//函数返回语句
endfunction
endnamespace
//空间结束语句






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