TC官方合作论坛

标题: TC惊现BUG [打印本页]

作者: 袭、羽    时间: 2012-12-4 21:10
标题: TC惊现BUG
我有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


作者: 超自然    时间: 2012-12-4 21:13

弄DNF的都知道那框框加料了,楼主不会不知道吧......
用超级,不是发送的,是一个个打上去的.
作者: 袭、羽    时间: 2012-12-4 21:16
敢问您做过自动登陆么?  超级 怎么用   没有要参数句柄
作者: 袭、羽    时间: 2012-12-4 21:34
天呐  终于可以了   不要一个键一个键按    提交的代码如下 :  嘿嘿  自己做的呀  激动呀哈哈
window.activate(hander)
      drivekeyboard.keystring("要输入的密码")
      window.postkeypress(hander,13)




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