马上加入TC
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
我有TC做了个自动登陆DNF的脚本但是向密码框 提交字符串时 登陆总是提示密码错误
这是为何 难道是BUG?
几种提交方式都试过 (按键提交、字符提交等都试过)
有知道的人说明一下 是什么原因
代码如下:
namespace DNFAuto
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])
endif
i=i+1
endwhile
window.sendstring(hander,str.format("%s","15295844099")) // //以下都是我尝试过的提交方式
//help.messagebox(convert.inttostr(hander))
//window.postkeypress(hander,97)//1
//window.postkeypress(hander,101)//5
//window.postkeypress(hander,98)//2
//window.postkeypress(hander,105)//9
//window.postkeypress(hander,101)//5
//window.postkeypress(hander,104)//8
//window.postkeypress(hander,100)//4
//window.postkeypress(hander,100)//4
//window.postkeypress(hander,96)//0
//window.postkeypress(hander,105)//9
//window.postkeypress(hander,105)//9
//keyboard.keydown(160)
//window.postkeypress(hander,187)
//keyboard.keyup(160)
//help.sleep(2000)
//window.postkeypress(hander,101)//5
//window.postkeypress(hander,98)//2
//window.postkeypress(hander,103)//7
//window.postkeypress(hander,99)//3
//help.sleep(2000)
//help.sleep(2000)
//window.postkeypress(hander,102)
//window.postkeypress(hander,121)
//keyboard.keydown(160)
//window.postkeypress(hander,189)
//keyboard.keyup(160)
//window.sendstring(hander,"15295844099")
return 1
endfunction
//_________________________
function bool start_click()
string main_handel
main_handel=system.enum("地下城与勇士",0)//窗口标题枚举窗口句柄
thread.beginthread("DNFAuto.send_dnf",main_handel)//开启线程
return true
endfunction
endnamespace
|