TC官方合作论坛

 找回密码
 立即注册
查看: 8544|回复: 26

[DNF] 龍吟第一期LY1.1DNF自动登录源码

[复制链接]
发表于 2012-6-8 16:22:48 | 显示全部楼层 |阅读模式
子空间程序点击下载:想来想去还是没有什么好的方法能够让代码的条理性在帖子上结构清晰一点,但是发上之后发现不够理想。以前最老版本TC复制到word再放上来是有颜色的,如今我这里没有老版本了,大家若想研究源码的就下载我放上来的文件吧!!!
本次主要想把一期1.0的自动登录思路通过源码让大家学习一下写法,也希望大家能够指出不理想或者简化代码的好想法。其实大家对1.0期的思路理解了完全可以自己写出来,所以不含代码注释,主要是看一下写法,每个人都有每个人写代码的思路,若一行一行代码看下去就没必要了。其实代码好写关键在于思路。最近也是比较忙,所以大家若有兴趣的可看一下,没兴趣的直接去1.0期看下思路即可。
自动登录思路1.0期传送门:http://bbs.tyuyan.com/thread-11984-1-1.html
难点1:可能大家看到代码是英文的看起来很头疼,若你是对TC中文命令很了解的话,应该看起来并不难,只要能识别大概意思即可,源码结构很清晰,并非杂乱。
难点2:对中文命令不熟悉,看英文命令不懂什么意思,整个流程也不懂,对于架构也不知道怎么回事。此情况建议大家回到第一期LY1.0自动登录思路把整个流程了解一下再来看源码。
TC代码小技巧1:可能很多人都问为什么你的源码结构如此清晰难道你每写一行都按很多空格进行排列?其实并非如此,如果大家以前用过其他语言的应该都知道。我们在TC写完后按下TAB即可间隔开代码来,这样就能把代码的结构整理得非常清晰。
TC代码小技巧2:看到代码字体变得很小巧,这个大家可以采用键盘按下ctrl不放鼠标中键向上滚动实现。
异常情况:
1、有时候会出现qqlogin.exe 程序错误,对于这个情况大家可以加上去进行判断;
2、登录上去后窗口直接消息插件绑定失败,这个情况采用多线程解决;
这个2个情况关键要将他们出现后的消息框关闭。

理想样本源码发帖:


外部调用此子空间程序,只要调用:start_task这个函数即可。
以下为自动登录已封装好的登录源码:





  1. namespace Launcher
  2. function string get_word(int x1,int y1,int x2,int y2,string color_value)  //【得到识别信息】
  3. string  distinguish_words,get_words
  4. int words_number,index,mark
  5. mark=0
  6. while(true)
  7.   index=0
  8.   get_words=""
  9.                 words_number=0
  10.                 distinguish_words=""
  11.                 distinguish_words = dm_龍吟.GetWords(x1,y1,x2,y2,color_value,1.0)
  12.                 if(str.strleng(distinguish_words)>0)
  13.    words_number = dm_龍吟.GetWordResultCount(distinguish_words)
  14.                         while(index<words_number)
  15.     get_words = str.strcat(get_words,dm_龍吟.GetWordResultStr(distinguish_words,index))
  16.                                 index = index + 1
  17.                         endwhile
  18.                         if(str.strleng(get_words)>0)
  19.     break
  20.                         endif
  21.                 endif
  22.                 mark=mark+1
  23.                 if(mark==30)
  24.    get_words=""
  25.    mark = 0
  26.                         break
  27.                 endif
  28.   help.sleep(100)
  29.         endwhile
  30. return get_words
  31. endfunction
  32. function bool channelchoice(string model,string aberration) //【选择频道子程序】
  33. //频道状态 ="【顺畅】":"00FF00"| "【良好】":"FFB100"|"【普通】":"FF8000"|"【拥挤】":"FF0000"
  34. int intX,intY,get_option,mark
  35. string channelstate = str.strcat(str.strcat(str.strcat(str.strcat("00FF00-",aberration),str.strcat("|FFB100-",aberration)),str.strcat("|FF8000-",aberration)),str.strcat("|FF0000-",aberration))
  36.         if(str.strcompare(model,"radio0")==0)
  37.   while(true)
  38.    start_entry.mousemoveclick(570,400,0)
  39.    help.sleep(1000)
  40.    while(true)//【注意:涉及循环都加一个判断避免游戏卡死不动】
  41.     dm_龍吟.MoveTo(10,10)
  42.     help.sleep(50)
  43.     intX = 0
  44.     dm_龍吟.FindStr(417,334,606,391,"拍卖行",str.strcat("c8c3a9-",aberration),1.0,intX,intY)
  45.     if(intX>0)
  46.      break
  47.     endif
  48.     help.sleep(100)
  49.    endwhile
  50.    while(true)
  51.     if(str.strcompare(dm_龍吟.GetColor(283, 400),"737373")!=0)
  52.      start_entry.mousemoveclick(290, 400,0)
  53.     else
  54.      break
  55.     endif
  56.                                 help.sleep(100)
  57.    endwhile
  58.                         while(true)
  59.     intX=0
  60.     intY=0
  61.     dm_龍吟.FindColor(27,82,605,346,channelstate,1.0,0,intX,intY)
  62.     if(intX<=0&&intY<=0)
  63.      start_entry.mousemoveclick(350, 400,0)
  64.      if(str.strcompare(dm_龍吟.GetColor(356,400),"737373")!=0)
  65.       continue
  66.                                         else
  67.       break
  68.      endif
  69.     else
  70.      start_entry.mousemoveclick(intX,intY,1) //【双击进入游戏】
  71.      break
  72.     endif
  73.      help.sleep(100)
  74.                         endwhile
  75.    while(true)//【注意:涉及循环都加一个判断避免游戏卡死不动】
  76.     intX = 1
  77.                                 intY = 1
  78.     dm_龍吟.MoveTo(10,10)
  79.     help.sleep(50)
  80.     dm_龍吟.FindStr(417,334,606,391,"拍卖行",str.strcat("c8c3a9-",aberration),1.0,intX,intY)
  81.     if(intX<=0&&intY<=0)
  82.      break
  83.     endif
  84.     help.sleep(100)
  85.    endwhile
  86.                         if(intX<=0&&intY<=0)
  87.     break
  88.                         endif
  89.                         help.sleep(100)
  90.                 endwhile
  91.         endif
  92.         if(str.strcompare(model,"radio1")==0)
  93.   //【得到下拉框的选项】
  94.                 get_option = 0
  95.                 get_option = combo.getcursel("ComboBox0")
  96.   if(get_option==0) //【亡者峡谷1】
  97.    while(true)//【注意:涉及循环都加一个判断避免游戏卡死不动】
  98.     start_entry.mousemoveclick(113,364,1) //【双击进入游戏】
  99.                                 help.sleep(1000)
  100.     intX = 1
  101.     dm_龍吟.FindStr(417,334,606,391,"拍卖行",str.strcat("c8c3a9-",aberration),1.0,intX,intY)
  102.     if(intX<=0)
  103.      break
  104.     endif
  105.     help.sleep(100)
  106.    endwhile
  107.                         return true
  108.                 endif
  109.   if(get_option==1) //【亡者峡谷2】
  110.    while(true)//【注意:涉及循环都加一个判断避免游戏卡死不动】
  111.     start_entry.mousemoveclick(300,365,1) //【双击进入游戏】
  112.                                 help.sleep(1000)
  113.     intX = 1
  114.     dm_龍吟.FindStr(417,334,606,391,"拍卖行",str.strcat("c8c3a9-",aberration),1.0,intX,intY)
  115.     if(intX<=0)
  116.      break
  117.     endif
  118.     help.sleep(100)
  119.    endwhile
  120.                         return true
  121.                 endif
  122.   if(get_option==2) //【拍卖行】
  123.    while(true)//【注意:涉及循环都加一个判断避免游戏卡死不动】
  124.     start_entry.mousemoveclick(488,359,1) //【双击进入游戏】
  125.     help.sleep(1000)
  126.     intX =1
  127.     dm_龍吟.FindStr(417,334,606,391,"拍卖行",str.strcat("c8c3a9-",aberration),1.0,intX,intY)
  128.     if(intX<=0)
  129.      break
  130.     endif
  131.     help.sleep(100)
  132.    endwhile
  133.                         return true
  134.                 endif
  135.                 if(get_option>2) //【指定频道】
  136.    get_option = get_option + 7
  137.                 endif
  138.                 mark=0
  139.   while(true)
  140.    start_entry.mousemoveclick(570,400,0)
  141.    help.sleep(1000)
  142.    while(true)//【注意:涉及循环都加一个判断避免游戏卡死不动】
  143.     intX = 0
  144.     dm_龍吟.FindStr(417,334,606,391,"拍卖行",str.strcat("c8c3a9-",aberration),1.0,intX,intY)
  145.     if(intX>0)
  146.      break
  147.     endif
  148.     help.sleep(100)
  149.    endwhile
  150.    while(true)
  151.     if(str.strcompare(dm_龍吟.GetColor(283, 400),"737373")!=0)
  152.      start_entry.mousemoveclick(290, 400,0)
  153.     else
  154.      break
  155.     endif
  156.    endwhile
  157.                         while(true)
  158.     intX=0
  159.     intY=0
  160.     dm_龍吟.FindStr(27,82,605,346,str.strcat("ch",convert.inttostr(get_option)),str.strcat("c8c3a9-",aberration),1.0,intX,intY)
  161.     if(intX<=0&&intY<=0)
  162.      start_entry.mousemoveclick(350, 400,0)
  163.                                         help.sleep(1000)
  164.      if(str.strcompare(dm_龍吟.GetColor(356,400),"737373")!=0)
  165.       continue
  166.                                         else
  167.       if(mark==1) //【第二次的时候再跳出】
  168.        break
  169.                                                 endif
  170.       mark = mark + 1
  171.      endif
  172.     else
  173.      start_entry.mousemoveclick(intX,intY,1) //【双击进入游戏】
  174.                                         help.sleep(1000)
  175.      break
  176.     endif
  177.      help.sleep(100)
  178.                         endwhile
  179.                         if(intX>0&&intY>0)
  180.     while(true)//【注意:涉及循环都加一个判断避免游戏卡死不动】
  181.      intX = 1
  182.                                         intY = 1
  183.      dm_龍吟.FindStr(417,334,606,391,"拍卖行",str.strcat("c8c3a9-",aberration),1.0,intX,intY)
  184.      if(intX<=0&&intY<=0)
  185.       break
  186.      endif
  187.      help.sleep(100)
  188.     endwhile
  189.                         endif
  190.                         if(intX<=0&&intY<=0)
  191.     break
  192.                         endif
  193.                         help.sleep(100)
  194.                 endwhile
  195.         endif
  196. return true
  197. endfunction  
  198.         
  199. function bool inputidandpassword(int judge_Hwnd,int id_Hwnd,int password_Hwnd,string ID,string password,int fblWide)  //【输入账号密码子程序】
  200. window.leftclick(judge_Hwnd,153,183)  //【关闭登录失败消息框】
  201. help.sleep(1000)
  202. repeat(18) //【清除之前账号】
  203.   window.postkeypress(id_Hwnd,8)
  204.   help.sleep(10)
  205. endrepeat
  206.         help.sleep(100)
  207. window.poststring(id_Hwnd,ID)  //【输入账号】
  208. help.sleep(500)
  209.         drivemouse.mousemove(fblWide-687+452,407)
  210.         help.sleep(50)
  211.         drivemouse.leftclick(1)
  212.         help.sleep(50)
  213. repeat(2)  //【让光标指向输入密码处】
  214.   window.leftclick(password_Hwnd,20,20)
  215.   help.sleep(100)
  216. endrepeat
  217. //        window.sendstring(password_Hwnd,password)
  218. drivekeyboard.keystring(password)  //【输入密码】【这里采用超级键盘还未找到后台办法】
  219. help.sleep(500)
  220. window.postkeypress(id_Hwnd,13)  //【回车】
  221. help.sleep(300)
  222. return true
  223. endfunction
  224. function int returnhwndvalue(string enumvalue,string comparevalue,int positionx,int positiony,int rwidth,int rheight,int mode,int mark) //【model 0表示句柄 1、类名 2、进程名 3、父窗口得子窗口】
  225. int position,get_positionx,get_positiony,get_width,get_height,get_hwnd
  226. string son_hwnd,returnvalue
  227. //[枚举返回需要的句柄]
  228. returnvalue = system.enum(enumvalue,mode)
  229. if(str.strleng(returnvalue)>0)
  230.   while(true)
  231.    position = str.findchar(returnvalue,124) //【查找“|”】
  232.    son_hwnd = str.strsub(returnvalue,0,position)  //【分割得到子句柄】
  233.    get_positionx = 0
  234.    get_positiony = 0
  235.    window.getwindowpos(convert.strtoint(son_hwnd,0),get_positionx,get_positiony)
  236.    window.getwindowsize(convert.strtoint(son_hwnd,0),get_width,get_height)
  237.    if(str.strcompare(window.getwindowtype(convert.strtoint(son_hwnd,0)),comparevalue)==0&&get_positionx==positionx&&get_positiony==positiony&&get_width==rwidth&&get_height==rheight)
  238.     get_hwnd = convert.strtoint(son_hwnd,0)  
  239.     break
  240.    endif
  241.    if(mark==1) //【不用对比坐标】
  242.     if(str.strcompare(window.getwindowtype(convert.strtoint(son_hwnd,0)),comparevalue)==0&&get_width==rwidth&&get_height==rheight)
  243.      get_hwnd = convert.strtoint(son_hwnd,0)  
  244.      break
  245.     endif
  246.    endif
  247.                         if(mark==2) //【对比标题】
  248.      if(str.strcompare(window.getwindowcaption(convert.strtoint(son_hwnd,0)),comparevalue)==0&&get_width==rwidth&&get_height==rheight)
  249.      get_hwnd = convert.strtoint(son_hwnd,0)  
  250.      break
  251.     endif
  252.                         endif
  253.    if(str.strcompare(son_hwnd,returnvalue)==0)
  254.     get_hwnd=0
  255.     break
  256.    endif
  257.    returnvalue = str.strcut(returnvalue,position+1,true) //【移除前子句柄】
  258.    help.sleep(20)
  259.   endwhile
  260.         endif
  261. return get_hwnd
  262. endfunction
  263. //【账号、密码、大区和服务器、频道、路径、网络运行商、分辨率高、宽、色差】
  264. function string start_task(string ID,string password,string servicer,string path,string Network_Run,int fblWide,string aberration,int mhyf)
  265. int  hwnd,ARP_mark,intX,intY,Button_Hwnd,get_Hwnd,judge_Hwnd,id_Hwnd,password_Hwnd,get_width,get_height
  266. int change_time,error_time,over_time
  267. string hwndlength,path1
  268. int[] return_data = int[5]
  269.         path1 = str.strsub(path,0,2)+"\\地下城与勇士"
  270. process.openprocess("Taskkill /f /im qqlogin.exe /im dnfchina.exe /im tencentdl.exe /im tensafe.exe /im dnfchinatest.exe") //【结束各种进程】
  271.         help.sleep(2000)
  272.         help.writeini("ServerSelection","LastSelectName",str.strcat(servicer,"区"),str.strcat(path1,"\\start\\UserSetting.ini")) //【设置大区服务器】
  273.         help.writeini("ServerSelection","LastSelectISP",Network_Run,str.strcat(path1,"\\start\\UserSetting.ini"))  
  274.         help.writeini("DNF COMMON","DENY PVP INVITE","1",str.strcat(path1,"\\DNF.cfg"))
  275.         help.writeini("DNF COMMON","DENY PARTY INVITE","1",str.strcat(path1,"\\DNF.cfg"))  //【拒绝组队】
  276.         help.writeini("DNF COMMON","SCREEN MODE","0",str.strcat(path1,"\\DNF.cfg"))   //【设置成不全屏】
  277.         help.writeini("DNF COMMON","LAST CONNECT DATE","99999999",str.strcat(path1,"\\DNF.cfg"))   //【不弹广告】
  278. help.sleep(2000)
  279. if(process.openprocess(path)==0)
  280.   //【检测路径是否填写错误】
  281.   return "路径不对"
  282. endif
  283.         ARP_mark = 0
  284.         while(true)    //【注意:涉及循环都加一个判断避免游戏卡死不动】
  285.   hwnd = 0
  286.   hwnd=window.findwindow("地下城与勇士")
  287.                 if(hwnd>0)
  288.    get_width = 0
  289.                         get_height = 0
  290.    window.getwindowsize(hwnd,get_width,get_height)
  291.                         if(get_width==687&&get_height==599)
  292.     window.setwindowpos(hwnd,fblWide-687,0)
  293.     Button_Hwnd = 0
  294.     Button_Hwnd = Launcher.returnhwndvalue(convert.inttostr(hwnd),str.strcat(servicer,"区"),0,0,89,25,3,2)  //【找需要登录的这个区按钮】
  295.     if(Button_Hwnd>0)
  296.      get_width=0
  297.      get_height=0
  298.      window.getwindowsize(Button_Hwnd,get_width,get_height)
  299.      if(get_width==89&&get_height==25)
  300.       break
  301.      endif
  302.     endif
  303.                         endif
  304.                 endif
  305.                 ARP_mark = ARP_mark + 1
  306.                 if(ARP_mark==300)
  307.    break
  308.                 endif
  309.                 help.sleep(20)
  310.         endwhile     
  311.         if(ARP_mark==300) //【30秒没出现直接重新登录】
  312.    return "重新登录"
  313.         endif
  314.         ARP_mark = 0
  315.         while(true) //【注意:涉及循环都加一个判断避免游戏卡死不动】
  316.   Button_Hwnd=0
  317.   Button_Hwnd = Launcher.returnhwndvalue(convert.inttostr(hwnd),"Button",fblWide-687+490,513,147,56,3,0) //【找确定选择按钮】
  318.   if(Button_Hwnd>0)
  319.    help.sleep(5000)
  320.    break
  321.                 endif
  322.                 ARP_mark = ARP_mark + 1
  323.                 if(ARP_mark==300)
  324.    break
  325.                 endif
  326.   help.sleep(100)
  327.         endwhile
  328.         if(ARP_mark==300) //【30秒没出现直接重新登录】
  329.    return "重新登录"
  330.         endif
  331.         ARP_mark = 0
  332. while(true) //【注意:涉及循环都加一个判断避免游戏卡死不动】
  333.   window.leftclick(Button_Hwnd,62,27) //【点击确认选择】
  334.   help.sleep(300)
  335.   get_Hwnd = 1
  336.   get_Hwnd = Launcher.returnhwndvalue(convert.inttostr(hwnd),str.strcat(servicer,"区"),0,0,89,25,3,2)  //【直到消失】
  337.   if(get_Hwnd<=0)
  338.    break
  339.                 endif
  340.                 judge_Hwnd=0
  341.                 judge_Hwnd = Launcher.returnhwndvalue("#32770","#32770",0,0,301,213,1,1)  //【是否出现维护按钮】
  342.                 if(judge_Hwnd>0)
  343.    window.postkeypress(judge_Hwnd,13)
  344.    help.sleep(300)
  345.                         break
  346.                 endif
  347.                 ARP_mark = ARP_mark + 1
  348.                 if(ARP_mark==200)
  349.    break
  350.                 endif
  351.   help.sleep(100)
  352.         endwhile
  353.         if(ARP_mark==200)
  354.   return "重新登录"
  355.         endif
  356.         if(judge_Hwnd>0)
  357.   return "游戏正在维护"
  358.         endif
  359.         help.sleep(3000)
  360.         ARP_mark=0
  361.         while(true) //【注意:涉及循环都加一个判断避免游戏卡死不动】
  362.                 judge_Hwnd=0
  363.                 judge_Hwnd = Launcher.returnhwndvalue("#32770","#32770",0,0,301,213,1,1)  //【是否出现维护按钮】
  364.                 if(judge_Hwnd>0)
  365.    window.postkeypress(judge_Hwnd,13)
  366.    help.sleep(300)
  367.                 endif
  368.                 hwndlength=""
  369.                 hwndlength = system.enum("QQLogin.exe",2)  //【直到该进程出现跳出】
  370.   if(str.strleng(hwndlength)>0)
  371.    break
  372.                 endif
  373.                 ARP_mark = ARP_mark + 1
  374.                if(ARP_mark==600) //【2分半还没进入登陆界面重新登陆】
  375.    break
  376.                endif
  377.                 help.sleep(300)
  378.         endwhile
  379.         if(ARP_mark==600)
  380.   return "重新登录"
  381.         endif
  382.         ARP_mark =0
  383.         while(true)  //【注意:涉及循环都加一个判断避免游戏卡死不动】
  384.   hwndlength="1"
  385.   hwndlength = system.enum("QQLogin.exe",2)  //【是否进程突然消失】
  386.   if(str.strleng(hwndlength)<=0)
  387.    break
  388.                 endif
  389.   hwnd = 0
  390.   hwnd=window.findwindow("地下城与勇士")
  391.                 if(hwnd>0)
  392.    window.setwindowpos(hwnd,fblWide-687,0)
  393.                         window.setwindowtop(hwnd,true)
  394.                         get_Hwnd=0
  395.                         get_Hwnd = Launcher.returnhwndvalue(convert.inttostr(hwnd),"Edit",fblWide-687+314,400,145,16,3,0)  //【找到输入密码按钮跳出】
  396.                         if(get_Hwnd>0)
  397.     break
  398.                         endif
  399.                 endif
  400.                 ARP_mark =ARP_mark+1
  401.                 if(ARP_mark==200)
  402.    break
  403.                 endif
  404.                 help.sleep(100)
  405.         endwhile
  406.         if(str.strleng(hwndlength)<=0||ARP_mark==200)
  407.   return "重新登录"
  408. endif
  409.         help.sleep(2000)
  410.         ARP_mark = 0
  411.         while(true)  //【注意:涉及循环都加一个判断避免游戏卡死不动】
  412.   hwndlength="1"
  413.   hwndlength = system.enum("QQLogin.exe",2)  //【是否进程突然消失】
  414.   if(str.strleng(hwndlength)<=0)
  415.    break
  416.                 endif
  417.   password_Hwnd = 0
  418.                 id_Hwnd = 0
  419.   password_Hwnd = Launcher.returnhwndvalue(convert.inttostr(hwnd),"Edit",fblWide-687+314,400,145,16,3,0) //【账号按钮】
  420.                 id_Hwnd = Launcher.returnhwndvalue(convert.inttostr(hwnd),"Edit",fblWide-687+314,373,145,16,3,0)  //【密码按钮】
  421.                 if(password_Hwnd>0&&id_Hwnd>0)
  422.    window.postkeypress(get_Hwnd,13)   //【向密码按钮执行回车来弹出的输入框判断是否进入登陆界面】
  423.    help.sleep(500)  
  424.    judge_Hwnd=0
  425.    judge_Hwnd = Launcher.returnhwndvalue("TWINCONTROL","TWINCONTROL",fblWide-687+183,199,320,200,1,0)  //【登陆失败消息框】
  426.    if(judge_Hwnd>0)
  427.     window.setwindowtop(hwnd,true)
  428.     Launcher.inputidandpassword(judge_Hwnd,id_Hwnd,password_Hwnd,ID,password,fblWide)  //【调用输入账号密码子程序】
  429.     break
  430.    endif
  431.    help.sleep(100)
  432.                 endif
  433.                 ARP_mark = ARP_mark + 1
  434.                 if(ARP_mark==1200)
  435.    break
  436.                 endif
  437.                 help.sleep(100)
  438.         endwhile
  439.         if(str.strleng(hwndlength)<=0||ARP_mark==1200)
  440.   return "重新登录"
  441. endif
  442.         ARP_mark=0
  443.         while(true)  //【注意:涉及循环都加一个判断避免游戏卡死不动】
  444.   hwndlength="1"
  445.   hwndlength = system.enum("QQLogin.exe",2)  //【是否进程突然消失】
  446.   if(str.strleng(hwndlength)<=0)
  447.    break
  448.                 endif
  449.                 window.setwindowtop(hwnd,true)
  450.                 judge_Hwnd = Launcher.returnhwndvalue("TWINCONTROL","TWINCONTROL",183,199,320,200,1,0)  //【登陆失败消息框】
  451.                 if(judge_Hwnd>0)
  452.                         Button_Hwnd = Button_Hwnd + 1
  453.                         if(Button_Hwnd==change_time)
  454.     drivekeyboard.keypress(20,1)  
  455.                                 help.sleep(100)
  456.                         endif
  457.    Launcher.inputidandpassword(judge_Hwnd,id_Hwnd,password_Hwnd,ID,password,fblWide)  //【调用输入账号密码子程序】
  458.                 endif
  459.                 help.sleep(100)
  460.                 judge_Hwnd=0
  461.                 judge_Hwnd = Launcher.returnhwndvalue("TWINCONTROL","TWINCONTROL",0,0,307,229,1,1)  //【出现验证码消息框】
  462.                 if(judge_Hwnd>0)
  463.    window.leftclick(judge_Hwnd,232,199)  //【关闭验证码消息框,异常处理】
  464.    help.sleep(1000)  
  465.   endif
  466.                 password_Hwnd = Launcher.returnhwndvalue(convert.inttostr(hwnd),"Edit",fblWide-687+314,400,145,16,3,0)
  467.                 if(password_Hwnd<=0)
  468.    break
  469.                 endif
  470.                 if(Button_Hwnd==error_time)
  471.    break
  472.                 endif
  473.                 ARP_mark = ARP_mark + 1
  474.                 if(ARP_mark==600)
  475.    break
  476.                 endif
  477.   help.sleep(100)
  478.         endwhile
  479. if(Button_Hwnd==error_time)
  480.   return "重新登录"
  481. endif
  482.         if(str.strleng(hwndlength)<=0||ARP_mark==600)
  483.   return "重新登录"
  484. endif
  485.         help.sleep(5000)
  486.         ARP_mark = 0
  487.         while(true)  //【注意:涉及循环都加一个判断避免游戏卡死不动】
  488.   hwnd = 0
  489.   hwnd=window.findwindow("地下城与勇士")
  490.                 if(hwnd>0)
  491.    get_width=0
  492.                         get_height=0
  493.    window.getwindowsize(hwnd,get_width,get_height)
  494.                         if(get_width==640&&get_height==480)
  495.     window.setwindowpos(hwnd,fblWide-640,0)
  496.                                 window.setwindowtop(hwnd,true)
  497.                                 help.sleep(1000)
  498.     break
  499.                         endif
  500.                 endif
  501.                 ARP_mark = ARP_mark + 1
  502.                 if(ARP_mark == over_time)
  503.    break
  504.                 endif
  505.   help.sleep(100)
  506.         endwhile
  507. if(ARP_mark == over_time)
  508.   return "重新登录"
  509. endif
  510. if(dm_龍吟.BindWindow(hwnd,"normal","windows2","normal",0)!=1)
  511.   return "绑定失败"
  512. endif
  513.         while(true) //【判断进入游戏频道】//【注意:涉及循环都加一个判断避免游戏卡死不动】
  514.   if(!window.iswindow(hwnd))
  515.    break
  516.                 endif
  517.   dm_龍吟.MoveTo(10,10)
  518.   help.sleep(50)
  519.   intX = 0
  520.   dm_龍吟.FindStr(417,334,606,391,"拍卖行",str.strcat("c8c3a9-",aberration),1.0,intX,intY)
  521.   if(intX>0)
  522.    help.sleep(1000)
  523.    break
  524.   endif
  525.   help.sleep(100)
  526.         endwhile
  527. if(!window.iswindow(hwnd))
  528.   return "重新登录"
  529. endif
  530.         if(radio.getstate("radio1"))
  531.   Launcher.channelchoice("radio1",aberration) //【选择频道】
  532.         else
  533.   Launcher.channelchoice("radio0",aberration) //【选择频道】
  534.         endif
  535. ARP_mark=0
  536.         while(true) //【判断进入游戏频道】//【注意:涉及循环都加一个判断避免游戏卡死不动】
  537.   intX = 0
  538.                 intY = 0
  539.                 dm_龍吟.FindColor(56,54,182,233,str.strcat("d1b994-",aberration),1.0,0,intX,intY)
  540.   if(intX>0&&intY>0)
  541.    help.sleep(1000)
  542.    break
  543.   endif
  544.   if(!window.iswindow(hwnd))
  545.    break
  546.                 endif
  547.                 dm_龍吟.FindColor(446,444,553,530,str.strcat("ddc58d-",aberration),1.0,0,intX,intY)
  548.   if(intX>0&&intY>0)
  549.    ARP_mark=ARP_mark + 1
  550.   endif
  551.                 if(ARP_mark==250)
  552.    break
  553.                 endif
  554.   help.sleep(100)
  555.         endwhile
  556. if(!window.iswindow(hwnd))
  557.   return "重新登录"
  558. endif
  559.         if(ARP_mark==250)
  560.   ARP_mark=0
  561.   return "0"
  562.         endif
  563. int x1,y1,x2,y2,id_mark
  564. string get_level
  565.         if(radio.getstate("check9")) //【只要满足16就ok】
  566.                 //56,53,181,233 第1个角色185,53,310,233 第2个角色56,237,181,417 第二排第1个角色
  567.   //【左边相差129 下边相差 184  初始化:579,69 翻页坐标:580,399 下一页  Lv】
  568.                 x1=56   
  569.                 y1=53
  570.                 x2=181
  571.                 y2=233
  572.                 id_mark=1
  573.   //【扫描第一号没有等级表示登录到错误的区需要换号】
  574.                 repeat(2)
  575.    start_entry.mousemoveclick(579,69,0)
  576.                 endrepeat
  577.                 help.sleep(1000)
  578.                 while(true)
  579.    ARP_mark=0
  580.    while(true)
  581.     intX = 0
  582.                                 intY = 0
  583.     dm_龍吟.FindStr(x1,y1,x2,y2,"Lv",str.strcat("d1b994-",aberration),1.0,intX,intY)
  584.     if(intX>0&&intY>0)
  585.      break
  586.     endif
  587.                                 if(ARP_mark==20)
  588.      break
  589.                                 endif
  590.                                 ARP_mark = ARP_mark + 1
  591.     help.sleep(100)
  592.    endwhile
  593.                         if(ARP_mark==20)
  594.     id_mark=0
  595.     break
  596.                         endif
  597.    get_level = Launcher.get_word(intX-6,intY-6,intX+27,intY+10,str.strcat("d1b994-",aberration))
  598.    if(str.strleng(get_level)<=0)
  599.     id_mark = 0
  600.     break
  601.    else
  602.     if(convert.strtoint(str.strcut(get_level,2,true),0)>=16&&id_mark==mhyf)
  603.      start_entry.mousemoveclick(x1+118,y1+143,0)
  604.      break
  605.                                 endif  
  606.    endif
  607.                         x1 = x1 + 129
  608.                         x2 = x2 + 129
  609.                         if(id_mark==4||id_mark==12)
  610.     y1 = y1 + 184
  611.                                 y2 = y2 + 184
  612.                                 x1 = 56
  613.                                 x2 = 181
  614.                         endif
  615.                         if(id_mark==8)
  616.     repeat(2)
  617.      start_entry.mousemoveclick(580,399,0)
  618.     endrepeat
  619.                                 help.sleep(1000)
  620.     x1=56   
  621.     y1=53
  622.     x2=181
  623.     y2=233
  624.                         endif
  625.                         if(id_mark==16)
  626.     id_mark = 0
  627.     break
  628.                         endif
  629.                         id_mark = id_mark + 1
  630.    help.sleep(100)
  631.                 endwhile
  632.         endif   
  633.         if(id_mark>0)
  634.   while(true)
  635.    if(!window.iswindow(hwnd))
  636.     break
  637.    endif
  638.    start_entry.mousemoveclick(357,440,0)
  639.                         help.sleep(500)
  640.    intX = 0
  641.    dm_龍吟.FindStr(19,463,56,479,"Lv",str.strcat("ffffff-",aberration),1.0,intX,intY)
  642.    if(intX>0)
  643.     window.setwindowtop(hwnd,false)
  644.                                 break
  645.    endif
  646.    help.sleep(100)
  647.                 endwhile
  648.         endif   
  649. if(!window.iswindow(hwnd))
  650.   return "重新登录"
  651. endif
  652. return convert.inttostr(hwnd)
  653. endfunction
  654. endnamespace
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复

使用道具 举报

发表于 2012-6-8 16:26:53 | 显示全部楼层
沙发,看英文表示压力大,看长英文表示压力很大!
回复 支持 反对

使用道具 举报

发表于 2012-6-8 16:59:55 | 显示全部楼层
全英文。 。 头晕。。  而且都没得注释。。
回复 支持 反对

使用道具 举报

发表于 2012-6-8 17:02:02 | 显示全部楼层
灰常厉害啊
回复 支持 反对

使用道具 举报

发表于 2012-6-8 20:23:48 | 显示全部楼层
看了一下,不错的作品,
回复 支持 反对

使用道具 举报

发表于 2012-6-21 23:37:52 | 显示全部楼层
看不怎么明白,全是英文,学英文曲
回复 支持 反对

使用道具 举报

发表于 2012-7-21 08:38:02 | 显示全部楼层
支持中文
回复 支持 反对

使用道具 举报

发表于 2012-7-28 18:40:03 | 显示全部楼层
支持中文11111111111111111111111111111111111111
回复 支持 反对

使用道具 举报

发表于 2012-9-1 12:15:10 | 显示全部楼层
好复杂啊
回复 支持 反对

使用道具 举报

发表于 2012-11-12 11:34:34 | 显示全部楼层
看英文表示压力大
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条

关闭

小黑屋|TC官方合作论坛 (苏ICP备18045623号)

GMT+8, 2024-5-18 14:14 , Processed in 0.043378 second(s), 23 queries .

Powered by 海安简单软件服务部

© 2008-2019 版权所有 保留所有权利

快速回复 返回顶部 返回列表