马上加入TC
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
下面是我想做的 DNF自动登陆 (QQ号为默认填写了)
只需输入密码
但是提交字符串给 密码框时 总是提示密码错误(密码是正确的)
namespace DNFAuto
string main_handel
//___________________________________
function int send_dnf(string handel)
string ret=system.enum(handel,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)
//判断子窗口类名是否为Edit
if(window.getwindowtype(convert.strtoint(str_hand,0))=="Edit")
count=i//标记类名为Edit的子窗口句柄的下标
hander=convert.strtoint(str_hand[count])
help.messagebox(convert.inttostr(hander))
endif
i=i+1
endwhile
//这里提交的密码总是错的(密码本身没有错误)
window.sendstring(hander,"要输入的密码")//向满足上述条件的子窗口发送字符串
help.sleep(1000)
window.postkeypress(hander,13)//提交按键
return 1
endfunction
//_________________________
function bool start_click()
main_handel=system.enum("地下城与勇士",0)//窗口标题枚举窗口句柄
thread.beginthread("DNFAuto.send_dnf",main_handel)//开启线程
return true
endfunction
endnamespace
|