马上加入TC
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
因为回贴有数字限制 所以只能重新发帖了namespace DNFAuto
int myhan
string path
string QQpas,QQuser,getcom_tex
string write_psw,write_user,write_bro,Wcom_tex
string read_psw,read_user,read_bro,Rcom_tex
int x,y,wx,wy,hwnd
bool state
function bool getpos()//找区
int isfind
while(true)
isfind=window.findwindow("地下城与勇士")
if(isfind>0)
break
endif
endwhile
//help.sleep(1000)
string ret=system.enum(convert.inttostr(isfind),3)
string[] str_hand
bool isok=str.split(ret,"|",str_hand)
int c1,i=0,hander,count
array.size(str_hand,c1)
while(i<c1)
if(window.getwindowcaption(convert.strtoint(str_hand,0))==getcom_tex)
hander=convert.strtoint(str_hand)
break
endif
i=i+1
endwhile
if(hander<0)
help.messagebox("Not Finded:DNFchina")
endif
window.getwindowpos(hander,x,y)//获取句柄的坐标
help.sleep(1000)
window.leftdoubleclick(hander,x,y)//双击x,y坐标
thread.beginthread("DNFAuto.send_dnf","")
return true
endfunction
function bool send_dnf()//向密码框发送密码
int isfind
while(true)
isfind=window.findwindow("","TWINCONTROL")
if(isfind>0)
break
endif
endwhile
help.sleep(3000)
string ret=system.enum(convert.inttostr(isfind),3)
string[] str_hand
bool isok=str.split(ret,"|",str_hand)
if(isok==false)
help.messagebox("NotFind:PassWordEdit...")
endif
int c1,i=0,hander,hander1,count
array.size(str_hand,c1)
while(i<c1)
if(window.getwindowtype(convert.strtoint(str_hand,0))=="Edit")
count=i
hander=convert.strtoint(str_hand[count])
endif
i=i+1
endwhile
state=check.getstate("check0")
help.sleep(5*1000)
QQpas=edit.gettext("Qinput")
QQuser=edit.gettext("QQ_user")
help.sleep(500)
if(state==true)
drivekeyboard.keydown(9)
help.sleep(500)
drivekeyboard.keyup(9)
drivekeyboard.keypress (8,10)
help.sleep(2000)
drivekeyboard.keystring(QQuser)
help.sleep(1000)
drivekeyboard.keydown(9)
help.sleep(500)
drivekeyboard.keyup(9)
endif
drivekeyboard.keystring(QQpas)
help.sleep(500)
window.postkeypress(hander,13)
return true
endfunction
//_________________________
function bool start_click()
path=browse.gettext("Dpath")
process.openprocess(path)
myhan=window.getmyhwnd()
window.setwindowmin(myhan)
getcom_tex=combo.gettext("ComB_D")
help.sleep(2000)
thread.beginthread("DNFAuto.getpos","")
return true
endfunction
function bool init()
read_psw=help.readini("ini_file","qq_psw",".\\Config.ini")
edit.settext("Qinput",read_psw)
read_user=help.readini("ini_file","qq_user",".\\Config.ini")
edit.settext("QQ_user",read_user)
read_bro=help.readini("ini_file","path_bro",".\\Config.ini")
browse.settext("Dpath",read_bro)
Rcom_tex=help.readini("ini_file","Wcom_tex",".\\Config.ini")
combo.setcursel("ComB_D",convert.strtoint(Rcom_tex))
return true
endfunction
function bool Save_qq_click()
write_psw=edit.gettext("Qinput")
help.writeini("ini_file","qq_psw",write_psw,".\\Config.ini")
return true
endfunction
function bool Dpath_selectchanged()
write_bro=browse.gettext("Dpath")
help.writeini("ini_file","path_bro",write_bro,".\\Config.ini")
return true
endfunction
function bool ComB_D_selectchanged()
int getID=combo.getcursel("ComB_D")
help.writeini("ini_file","Wcom_tex",convert.inttostr(getID),".\\Config.ini")
return true
endfunction
function bool DNFAuto_close()
write_user=edit.gettext("QQ_user")
help.writeini("ini_file","qq_user",write_user,".\\Config.ini")
help.exit()
return true
endfunction
endnamespace
|