TC官方合作论坛

 找回密码
 立即注册
查看: 1482|回复: 6

[问题] 脚本有时会莫名其妙会卡住,不知什么问题,有代码

[复制链接]
发表于 2013-10-27 18:16:09 | 显示全部楼层 |阅读模式

马上加入TC

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

x
  1. 打怪的时候会卡住,跑路的时候有时也卡住,连修装备也卡,停止再开始又行了
复制代码
  1. namespace 武尊脚本
  2. var x,y//,a,b
  3. var VK_2 = 50,VK_A = 65,VK_Z = 90
  4. var 线程查血,线程打怪,线程捡物,监测线程
  5. var curScState = false
  6. var iniFilePath = ""
  7. var timerEnable
  8. timerEnable = false

  9. var pickCnt
  10. var destoryCnt2
  11. var timeCnt
  12. var curLocation
  13. var IsFoundBoss
  14. var 路径
  15. var 下一地点x,下一地点y
  16. //基坐标
  17. var RTx,RTy,HPx,HPy,BagX,BagY,熔炉坐标x,熔炉坐标y
  18. var 地图基点x,地图基点y
  19. var pointColor
  20. curLocation = 1
  21. IsFoundBoss = false
  22. timeCnt = 0
  23. timeColorCnt = 0
  24. timeChangePlace = 0

  25. function 初始基坐标()
  26.     路径 = help.getrcpath("rc:")
  27.     color.findpic(0,0,1440,900,"图片\\右上角基坐标图.bmp",000000,0.9,0,RTx,RTy) //1272,77
  28.     color.findpic(0,0,1440,900,"图片\\血基坐.bmp",000000,0.9,0,HPx,HPy) //333,839
  29.     color.findpic(0,0,1327,862,"图片\\1212.bmp",#000000,0.8,0,x,y) //1257,817
  30.    
  31.     mouse.mousemove(RTx+35,RTy+122)
  32.     mouse.leftclick()
  33.     help.sleep(1500)
  34.     color.findpic(0,0,1440,900,"图片\\地图.bmp",000000,0.9,0,地图基点x,地图基点y)//688,213
  35.     mouse.mousemove(RTx+35,RTy+122)
  36.     mouse.leftclick()
  37.     help.sleep(1500)
  38.    
  39.     BagX = HPx+545
  40.     BagY = HPy-25
  41.     熔炉坐标x=x-267
  42.     熔炉坐标y=y-1
  43.    
  44.     下一地点x = 地图基点x-170
  45.     下一地点y = 地图基点y+201
  46.     a = 1
  47. endfunction

  48. function exit_click()
  49.     武尊脚本.btnStop_click()
  50.     help.exit()
  51. endfunction

  52. function hkStart_onhotkey()
  53.     武尊脚本.btnStart_click()   
  54. endfunction

  55. function 使用技能()
  56.     select(combo.gettext("cboJobList"))
  57.         case "法师":
  58.         keyboard.keypress(武尊脚本.TransKey(edit.gettext("edtStuffKey")))
  59.         help.sleep(100)
  60.         
  61.         case "道士":
  62.         keyboard.keypress(武尊脚本.TransKey(edit.gettext("edtStuffKey")))
  63.         help.sleep(100)
  64.         
  65.         case "战士":
  66.         mouse.leftclick()
  67.         help.sleep(100)
  68.         
  69.     endselect
  70. endfunction

  71. function 快捷使用物品(栏位)
  72.         select(栏位)
  73.         case "1":
  74.                         mouse.mousemove(HPx+147,HPy-54)
  75.             mouse.leftdoubleclick()
  76.                 case "2":
  77.                         mouse.mousemove(HPx+186,HPy-54)
  78.             mouse.leftdoubleclick()
  79.         case "3":
  80.                         mouse.mousemove(HPx+226,HPy-54)
  81.             mouse.leftdoubleclick()
  82.                 case "4":
  83.                         mouse.mousemove(HPx+268,HPy-54)
  84.             mouse.leftdoubleclick()
  85.                 case "5":
  86.                         mouse.mousemove(HPx+310,HPy-54)
  87.             mouse.leftdoubleclick()
  88.                 case "6":
  89.                         mouse.mousemove(HPx+351,HPy-54)
  90.             mouse.leftdoubleclick()
  91.                 case "7":
  92.                         mouse.mousemove(HPx+391,HPy-54)
  93.             mouse.leftdoubleclick()
  94.                 case "8":
  95.                         mouse.mousemove(HPx+431,HPy-54)
  96.             mouse.leftdoubleclick()
  97.                 case "Q":
  98.                         mouse.mousemove(HPx+147,HPy-9)
  99.             mouse.leftdoubleclick()
  100.                 case "W":
  101.                         mouse.mousemove(HPx+186,HPy-9)
  102.             mouse.leftdoubleclick()
  103.         case "E":
  104.                         mouse.mousemove(HPx+226,HPy-9)
  105.             mouse.leftdoubleclick()
  106.                 case "R":
  107.                         mouse.mousemove(HPx+268,HPy-9)
  108.             mouse.leftdoubleclick()
  109.                 case "A":
  110.                         mouse.mousemove(HPx+310,HPy-9)
  111.             mouse.leftdoubleclick()
  112.                 case "S":
  113.                         mouse.mousemove(HPx+351,HPy-9)
  114.             mouse.leftdoubleclick()
  115.                 case "D":
  116.                         mouse.mousemove(HPx+391,HPy-9)
  117.             mouse.leftdoubleclick()
  118.                 case "F":
  119.                         mouse.mousemove(HPx+431,HPy-9)
  120.             mouse.leftdoubleclick()
  121.     endselect
  122. endfunction

  123. function 检查血值()
  124.     var a,b
  125.     while(true)         //1257,817
  126.         if (color.getpixelcolor(HPx+46, HPy-62) == #5F6A5D)
  127.             //mouse.mousemove(HPx+350, HPy-51 ) //使用随机 6号栏位   
  128.             //mouse.leftdoubleclick()
  129.             //keyboard.keypress(武尊脚本.TransKey(edit.gettext("edtRandomStoneKey")))
  130.             武尊脚本.快捷使用物品(edit.gettext("edtRandomStoneKey"))
  131.             help.sleep(5000)
  132.             keyboard.keypress(VK_2) //按键2
  133.         endif
  134.         if (color.findpic(0,0,1440,900,"图片\\回城复活.bmp",000000,0.9,0,a,b) != -1)
  135.             mouse.mousemove(a+15,b+10)
  136.             mouse.leftclick()
  137.         endif
  138.         
  139.     endwhile
  140. endfunction

  141. function 初始化监视()
  142.     var a,b
  143.     while(true)
  144.         if (color.findpic( RTx-19, RTy-48, RTx+75, RTy-3, "图片\\沙漠土城.bmp", 000000,0.9,0, a, b) != -1)
  145.             thread.suspendthread(线程打怪)
  146.             thread.suspendthread(线程捡物)
  147.             武尊脚本.修理装备()
  148.             if (武尊脚本.判断有无令牌())
  149.                 武尊脚本.使用玛雅令牌()
  150.                
  151.             else
  152.                 武尊脚本.购买令牌()
  153.                 武尊脚本.使用玛雅令牌()               
  154.             endif
  155.             thread.resumethread(线程打怪)
  156.             thread.resumethread(线程捡物)
  157.         endif
  158.         help.sleep(2000)
  159.     endwhile
  160. endfunction

  161. function 打怪与寻路()
  162.     var a,b
  163.     while(true)
  164.         //如果当前不在玛雅一层
  165.         if (color.findpic( RTx-19, RTy-48, RTx+75, RTy-3, "图片\\玛雅一层.bmp", 000000,0.9,0, a, b) == -1)
  166.             continue
  167.         endif
  168.         IsFoundBoss = false
  169.         //Call 检查血值
  170.         
  171.         if (timeColorCnt +3000 < system.gettickcount() && pointColor == color.getpixelcolor(304,149))
  172.             //keyboard.keypress(keys.VK_Z)
  173.             mouse.mousemove(304,149)
  174.             mouse.leftclick()
  175.             help.sleep(100)
  176.             mouse.leftclick()
  177.             help.sleep(100)
  178.             mouse.leftclick()
  179.             help.sleep(100)
  180.             mouse.leftclick()
  181.             help.sleep(100)
  182.         else
  183.             pointColor = color.getpixelcolor(397,433)
  184.             timeColorCnt = system.gettickcount()
  185.         endif
  186.         
  187.         if (color.findrectpixelcolor( x-1238, y-645, x+35, y-72,#7E7242,0,a,b))
  188.             //help.messagebox( "找到奴玛教主")   
  189.             //continue
  190.             mouse.mousemove( a, b)        
  191.             武尊脚本.使用技能()
  192.             IsFoundBoss = true
  193.             timeCnt = system.gettickcount()
  194.         endif
  195.         
  196.         if (color.findrectpixelcolor( x-1238, y-645, x+35, y-72,#5E645D,0,a,b))
  197.             //help.messagebox( "找到金刚")
  198.             //continue
  199.             mouse.mousemove( a, b)
  200.             武尊脚本.使用技能()
  201.             IsFoundBoss = true
  202.             timeCnt = system.gettickcount()
  203.         endif
  204.         if (color.findrectpixelcolor( x-1238, y-645, x+35, y-72,#C59378,0,a,b))               
  205.             //help.messagebox( "找到猛玛")
  206.             //continue
  207.             mouse.mousemove( a, b)
  208.             武尊脚本.使用技能()
  209.             IsFoundBoss = true
  210.             timeCnt = system.gettickcount()
  211.         endif
  212.         if (color.findrectpixelcolor( x-1238, y-645, x+35, y-72,#866965,0,a,b))        //5D4949
  213.             //help.messagebox( "找到蛇蝎")
  214.             //continue
  215.             mouse.mousemove( a, b)
  216.             武尊脚本.使用技能()
  217.             IsFoundBoss = true
  218.             timeCnt = system.gettickcount()
  219.         endif
  220.         
  221.         if (color.findrectpixelcolor( x-1238, y-645, x+35, y-72,#48462A,0,a,b))        //323024
  222.             //help.messagebox( "找到重装")
  223.             //continue
  224.             mouse.mousemove( a, b)
  225.             武尊脚本.使用技能()
  226.             IsFoundBoss = true
  227.             timeCnt = system.gettickcount()
  228.         endif
  229.         
  230.         if (IsFoundBoss == false && timeCnt+5000 <system.gettickcount())  
  231.             武尊脚本.换地点()
  232.             //武尊脚本.拾取物品()
  233.         endif
  234.     endwhile
  235.    
  236. endfunction

  237. function 购买令牌()
  238.     var a,b
  239.     武尊脚本.复位()
  240.     mouse.mousemove( x+19, y+4) //打开商城
  241.     mouse.leftclick()
  242.     help.sleep( 1500)
  243.    
  244.     if (color.findpic(0,0,1440,900,"图片\\绑定商城(文字).bmp",000000,0.9,0,a,b) != -1)
  245.         
  246.         mouse.mousemove( a+10,b+10 )//点绑定商城
  247.         mouse.leftclick()
  248.         help.sleep( 300)
  249.         
  250.         mouse.mousemove( a+213,b+96) //点购买令牌按钮
  251.         mouse.leftclick()
  252.         help.sleep( 500)
  253.         
  254.         mouse.mousemove( a+273,b+226) //点确定
  255.         mouse.leftclick()
  256.         help.sleep( 500)
  257.         
  258.     endif
  259.     mouse.mousemove( a+539,b-19) //关闭商城
  260.     mouse.leftclick()
  261.     help.sleep( 1500)
  262. endfunction

  263. function 换地点()
  264.     //武尊脚本.复位()
  265.         var a,b
  266.    
  267.     if (color.findpic(0,0,1440,900,"图片\\地图.bmp",000000,0.9,0,a,b)!= -1)
  268.         mouse.mousemove(RTx+35,RTy+122)
  269.                 mouse.leftclick()
  270.                 help.sleep(1500)
  271.     endif
  272.     if (color.findpic( RTx+63, RTy-48, RTx+143, RTy-5, "图片\\第一个地点49_77.bmp", 000000,0.9,0, a, b) != -1)
  273.         下一地点x = 地图基点x-109
  274.         下一地点y = 地图基点y+147
  275.     endif   
  276.     if (color.findpic( RTx+63, RTy-48, RTx+143, RTy-5, "图片\\第二个地点77_52.bmp", 000000,0.9,0, a, b) != -1)
  277.         下一地点x = 地图基点x-33
  278.         下一地点y = 地图基点y+223
  279.     endif
  280.     if (color.findpic( RTx+63, RTy-48, RTx+143, RTy-5, "图片\\第三个地点111_87.bmp", 000000,0.9,0, a, b) != -1)
  281.         下一地点x = 地图基点x-82
  282.         下一地点y = 地图基点y+278
  283.     endif
  284.     if (color.findpic( RTx+63, RTy-48, RTx+143, RTy-5, "图片\\第四个地点89_112.bmp", 000000,0.9,0, a, b) != -1)
  285.         下一地点x = 地图基点x+44
  286.         下一地点y = 地图基点y+372
  287.     endif
  288.     if (color.findpic( RTx+63, RTy-48, RTx+143, RTy-5, "图片\\第五个地点147_155.bmp", 000000,0.9,0, a, b) != -1)
  289.         下一地点x = 地图基点x-170
  290.         下一地点y = 地图基点y+201
  291.     endif
  292.    
  293.      if (timeChangePlace +5000 > system.gettickcount())
  294.         return 0
  295.     else
  296.         timeChangePlace = system.gettickcount()
  297.     endif
  298.    
  299.     mouse.mousemove(RTx+35,RTy+122)
  300.     mouse.leftclick()
  301.     help.sleep(1000)
  302.     mouse.mousemove(下一地点x,下一地点y)
  303.     mouse.leftclick()
  304.     help.sleep(500)
  305.     mouse.mousemove(RTx+35,RTy+122)
  306.     mouse.leftclick()
  307.     //help.sleep(1000)
  308.    
  309.    
  310. endfunction

  311. function 回收物品()
  312.     //武尊脚本.复位()
  313.     mouse.mousemove(熔炉坐标x, 熔炉坐标y) //打开关闭熔炉
  314.     mouse.leftclick()
  315.     help.sleep(1500)
  316.     var a,b
  317.     if (color.findpic(0,0,1440,900,"图片\\装备回收.bmp",000000,0.9,0,a,b)!= -1)
  318.         mouse.mousemove( a+10,b+10)
  319.         mouse.leftclick()
  320.         help.sleep(200)
  321.         if (color.findpic(0,0,1440,900,"图片\\全部添加.bmp",000000,0.9,0,a,b)!= -1)
  322.             mouse.mousemove( a+10,b+10)
  323.             mouse.leftclick()
  324.             help.sleep(200)
  325.             if (color.findpic(0,0,1440,900,"图片\\确认回收.bmp",000000,0.9,0,a,b)!= -1)
  326.                 mouse.mousemove( a+10,b+10)
  327.                 mouse.leftclick()
  328.                 help.sleep(200)
  329.             endif
  330.         endif
  331.     endif
  332.    
  333.     mouse.mousemove(熔炉坐标x, 熔炉坐标y) //打开关闭熔炉
  334.     mouse.leftclick()
  335.     help.sleep(1500)
  336. endfunction

  337. function 销毁物品()
  338.     var destoryX,destoryY
  339.     var a,b
  340.     mouse.mousemove( BagX,BagY) //打开关闭包裹
  341.     mouse.leftclick()
  342.    
  343.     help.sleep( 2010)
  344.     if (color.findpic(0,0,1440,900,"图片\\摧毁物品.bmp",000000,0.9,0,destoryX,destoryY) != -1)
  345.         mouse.mousemove( destoryX+10,destoryY+5)
  346.         help.sleep( 300)
  347.         mouse.leftclick() //点击销毁物品
  348.     endif
  349.    
  350. 继续销毁物品:
  351.     destoryCnt = 0
  352.    
  353.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\紫碧螺.bmp",000000,0.9,0,a,b) != -1)   
  354.         mouse.mousemove( a+10, b+5)
  355.         mouse.leftclick()
  356.         help.sleep( 300)
  357.         destoryCnt = destoryCnt+1
  358.     endif
  359.    
  360.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\天师手.bmp",000000,0.9,0,a,b) != -1)   
  361.         mouse.mousemove( a+10, b+5)
  362.         mouse.leftclick()
  363.         help.sleep( 300)
  364.         destoryCnt = destoryCnt+1
  365.     endif
  366.    
  367.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\玄铁头盔.bmp",000000,0.9,0,a,b) != -1)   
  368.         mouse.mousemove( a+10, b+5)
  369.         mouse.leftclick()
  370.         help.sleep( 300)
  371.         destoryCnt = destoryCnt+1
  372.     endif
  373.    
  374.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\道力戒指.bmp",000000,0.9,0,a,b) != -1)   
  375.         mouse.mousemove( a+10, b+5)
  376.         mouse.leftclick()
  377.         help.sleep( 300)
  378.         destoryCnt = destoryCnt+1
  379.     endif
  380.    
  381.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\魔力镜.bmp",000000,0.9,0,a,b) != -1)   
  382.         mouse.mousemove( a+10, b+5)
  383.         mouse.leftclick()
  384.         help.sleep( 300)
  385.         destoryCnt = destoryCnt+1
  386.     endif
  387.    
  388.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\魔神头盔.bmp",000000,0.9,0,a,b) != -1)   
  389.         mouse.mousemove( a+10, b+5)
  390.         mouse.leftclick()
  391.         help.sleep( 300)
  392.         destoryCnt = destoryCnt+1
  393.     endif
  394.    
  395.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\魔神手.bmp",000000,0.9,0,a,b) != -1)   
  396.         mouse.mousemove( a+10, b+5)
  397.         mouse.leftclick()
  398.         help.sleep( 300)
  399.         destoryCnt = destoryCnt+1
  400.     endif
  401.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\三眼手.bmp",000000,0.9,0,a,b) != -1)   
  402.         mouse.mousemove( a+10, b+5)
  403.         mouse.leftclick()
  404.         help.sleep( 300)
  405.         destoryCnt = destoryCnt+1
  406.     endif
  407.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\翡翠项链.bmp",000000,0.9,0,a,b) != -1)   
  408.         mouse.mousemove( a+10, b+5)
  409.         mouse.leftclick()
  410.         help.sleep( 300)
  411.         destoryCnt = destoryCnt+1
  412.     endif
  413.    
  414.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\审判之杖.bmp",000000,0.9,0,a,b) != -1)   
  415.         mouse.mousemove( a+10, b+5)
  416.         mouse.leftclick()
  417.         help.sleep( 300)
  418.         destoryCnt = destoryCnt+1
  419.     endif
  420.    
  421.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\战神铠甲女.bmp",000000,0.9,0,a,b) != -1)   
  422.         mouse.mousemove( a+10, b+5)
  423.         mouse.leftclick()
  424.         help.sleep( 300)
  425.         destoryCnt = destoryCnt+1
  426.     endif
  427.    
  428.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\天师项链.bmp",000000,0.9,0,a,b) != -1)   
  429.         mouse.mousemove( a+10, b+5)
  430.         mouse.leftclick()
  431.         help.sleep( 300)
  432.         destoryCnt = destoryCnt+1
  433.     endif
  434.    
  435.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\珊瑚戒指.bmp",000000,0.9,0,a,b) != -1)   
  436.         mouse.mousemove( a+10, b+5)
  437.         mouse.leftclick()
  438.         help.sleep( 300)
  439.         destoryCnt = destoryCnt+1
  440.     endif
  441.    
  442.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\道魂项链.bmp",000000,0.9,0,a,b) != -1)   
  443.         mouse.mousemove( a+10, b+5)
  444.         mouse.leftclick()
  445.         help.sleep( 300)
  446.         destoryCnt = destoryCnt+1
  447.     endif
  448.    
  449.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\无极棍.bmp",000000,0.9,0,a,b) != -1)   
  450.         mouse.mousemove( a+10, b+5)
  451.         mouse.leftclick()
  452.         help.sleep( 300)
  453.         destoryCnt = destoryCnt+1
  454.     endif
  455.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\天师戒指.bmp",000000,0.9,0,a,b) != -1)   
  456.         mouse.mousemove( a+10, b+5)
  457.         mouse.leftclick()
  458.         help.sleep( 300)
  459.         destoryCnt = destoryCnt+1
  460.     endif
  461.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\虎齿项链.bmp",000000,0.9,0,a,b) != -1)
  462.         mouse.mousemove( a+10, b+5)
  463.         mouse.leftclick()
  464.         help.sleep( 300)
  465.         destoryCnt = destoryCnt+1
  466.     endif
  467.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\邪恶铃铛.bmp",000000,0.9,0,a,b) != -1)
  468.         mouse.mousemove( a+10, b+5)
  469.         mouse.leftclick()
  470.         help.sleep( 300)
  471.         destoryCnt = destoryCnt+1
  472.     endif
  473.    
  474.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\圣战手.bmp",000000,0.9,0,a,b) != -1)
  475.         
  476.         mouse.mousemove( a+10, b+5)
  477.         mouse.leftclick()
  478.         help.sleep( 300)
  479.         destoryCnt = destoryCnt+1
  480.     endif
  481.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\红药.bmp",000000,0.9,0,a,b) != -1)
  482.         
  483.         mouse.mousemove( a+10, b+5)
  484.         mouse.leftclick()
  485.         help.sleep( 300)
  486.         destoryCnt = destoryCnt+1
  487.     endif
  488.    
  489.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\蓝药.bmp",000000,0.9,0,a,b) != -1)
  490.         
  491.         mouse.mousemove( a+10, b+5)
  492.         mouse.leftclick()
  493.         help.sleep( 300)
  494.         destoryCnt = destoryCnt+1
  495.     endif
  496.    
  497.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\魔神戒指.bmp",000000,0.9,0,a,b) != -1)
  498.         
  499.         mouse.mousemove( a+10, b+5)
  500.         mouse.leftclick()
  501.         help.sleep( 300)
  502.         destoryCnt = destoryCnt+1
  503.     endif
  504.    
  505.     if(color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\魔神项链.bmp",000000,0.9,0,a,b) != -1)
  506.         
  507.         mouse.mousemove( a+10, b+5)
  508.         mouse.leftclick()
  509.         help.sleep( 300)
  510.         destoryCnt = destoryCnt+1
  511.     endif
  512.    
  513.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\战神铠甲.bmp",000000,0.9,0,a,b) != -1)
  514.         
  515.         mouse.mousemove( a+10, b+5)
  516.         mouse.leftclick()
  517.         help.sleep( 300)
  518.         destoryCnt = destoryCnt+1
  519.     endif
  520.    
  521.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\泰坦戒.bmp",000000,0.9,0,a,b) != -1)
  522.         
  523.         mouse.mousemove( a+10, b+5)
  524.         mouse.leftclick()
  525.         help.sleep( 300)
  526.         destoryCnt = destoryCnt+1
  527.     endif
  528.    
  529.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\绿玉项链.bmp",000000,0.9,0,a,b) != -1)
  530.         
  531.         mouse.mousemove( a+10, b+5)
  532.         mouse.leftclick()
  533.         help.sleep( 300)
  534.         destoryCnt = destoryCnt+1
  535.     endif
  536.    
  537.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\恶魔战袍.bmp",000000,0.9,0,a,b) != -1)
  538.         
  539.         mouse.mousemove( a+10, b+5)
  540.         mouse.leftclick()
  541.         help.sleep( 300)
  542.         destoryCnt = destoryCnt+1
  543.     endif
  544.    
  545.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\战圣头盔.bmp",000000,0.9,0,a,b) != -1)
  546.         
  547.         mouse.mousemove( a+10, b+5)
  548.         mouse.leftclick()
  549.         help.sleep( 300)
  550.         destoryCnt = destoryCnt+1
  551.     endif
  552.    
  553.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\灵魂道袍.bmp",000000,0.9,0,a,b) != -1)
  554.         
  555.         mouse.mousemove( a+10, b+5)
  556.         mouse.leftclick()
  557.         help.sleep( 300)
  558.         destoryCnt = destoryCnt+1
  559.     endif
  560.    
  561.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\力量戒指.bmp",000000,0.9,0,a,b) != -1)
  562.         
  563.         mouse.mousemove( a+10, b+5)
  564.         mouse.leftclick()
  565.         help.sleep( 300)
  566.         destoryCnt = destoryCnt+1
  567.     endif
  568.    
  569.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\战圣戒指.bmp",000000,0.9,0,a,b) != -1)
  570.         
  571.         mouse.mousemove( a+10, b+5)
  572.         mouse.leftclick()
  573.         help.sleep( 300)
  574.         destoryCnt = destoryCnt+1
  575.     endif
  576.    
  577.     if (destoryCnt != 0 )
  578.         goto 继续销毁物品
  579.     endif
  580.    
  581.     mouse.mousemove(destoryX-100,destoryY)
  582.     mouse.leftclick()
  583.     help.sleep( 300)
  584.     //销毁太阳水
  585.    
  586. 继续销毁太阳水:        
  587.     if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\强效太阳水.bmp",000000,0.9,0,a,b)!= -1)
  588.         //mouse.mousemove( destoryX+10,destoryY+5)
  589.         //help.sleep( 300)
  590.         //mouse.leftclick() //点击销毁物品,获处铁锤
  591.         mouse.mousemove( a+10, b+5) //点击太阳水
  592.         mouse.leftdoubleclick()
  593.         help.sleep( 200)
  594.         //if (color.findpic(0,0,1440,900,"图片\\确定.bmp",000000,0.9,0,a,b)!= -1)
  595.             //mouse.mousemove( a+10, b+5)
  596.             //mouse.leftclick()
  597.             //help.sleep(300)
  598.             //mouse.leftclick()
  599.         //endif
  600.         goto 继续销毁太阳水
  601.     endif
  602.     //结束销毁太阳水
  603.     mouse.mousemove( BagX,BagY )//打开关闭包裹
  604.     mouse.leftclick()
  605.     help.sleep( 1500)
  606. endfunction

  607. function 判断有无令牌()
  608.     var a,b
  609.     武尊脚本.复位()
  610.     mouse.mousemove( BagX, BagY) //打开关闭包裹
  611.     mouse.leftclick()
  612.     help.sleep(1500)               
  613.     if (color.findpic(0,0,1440,900,"图片\\玛雅令牌.bmp",000000,0.9,0,a,b)!= -1)
  614.         mouse.mousemove( a, b) //打开关闭包裹
  615.         mouse.leftclick()
  616.         help.sleep(1500)
  617.         mouse.mousemove( BagX, BagY) //打开关闭包裹
  618.         mouse.leftclick()
  619.         return true
  620.     endif
  621.     mouse.mousemove( BagX, BagY) //打开关闭包裹
  622.     mouse.leftclick()
  623.     return false   
  624. endfunction

  625. function 使用玛雅令牌()
  626.     var a,b
  627.     武尊脚本.复位()
  628.     mouse.mousemove( BagX, BagY) //打开关闭包裹
  629.     mouse.leftclick()
  630.     help.sleep( 1500 )
  631.     if (color.findpic(0,0,1440,900,"图片\\玛雅令牌.bmp",000000,0.9,0,a,b )!= -1)//从包裹中查找
  632.         mouse.mousemove( a+10, b+10)
  633.         mouse.leftdoubleclick()
  634.         help.sleep( 1500)
  635.     endif
  636.     mouse.mousemove( BagX, BagY) //打开关闭包裹
  637.     mouse.leftclick()
  638.     help.sleep( 1500)
  639. endfunction

  640. function 复位()
  641.     var a,b
  642.     //复位地图,如果已打开则关闭之   
  643.     if (color.findpic(0,0,1440,900,"图片\\地图.bmp",000000,0.9,0,a,b)!= -1)     
  644.         keyboard.keypress(keys.VK_M)
  645.         help.sleep(1500)
  646.     endif
  647.     //复位包裹
  648.     if (color.findpic(0,0,1440,900,"图片\\包裹标题.bmp",000000,0.9,0,a,b)!= -1)     
  649.         keyboard.keypress(keys.VK_B)
  650.         help.sleep(1500)
  651.     endif
  652.     //复位熔炉
  653.     if (color.findpic(0,0,1440,900,"图片\\熔炉标题.bmp",000000,0.9,0,a,b)!= -1)     
  654.         keyboard.keypress(keys.VK_I)
  655.         help.sleep(1500)
  656.     endif
  657.    
  658.     //关闭其它未知窗口
  659. 继续关闭未知窗口:
  660.     if (color.findpic(0,0,1440,900,"图片\\叉.bmp",000000,0.9,0,a,b)!= -1)   
  661.         mouse.mousemove(a+10,b+10)
  662.         mouse.leftclick()
  663.         goto 继续关闭未知窗口
  664.     endif
  665.    
  666. endfunction

  667. function 修理指定装备(特殊修理x,特殊修理y,装备x,装备y)
  668.     mouse.mousemove(特殊修理x+20,特殊修理y+10)
  669.     mouse.leftclick()
  670.     mouse.mousemove(装备x,装备y)
  671.     mouse.leftclick()
  672.     help.sleep(200)
  673. endfunction

  674. function 修理装备()
  675.     var a,b
  676.     var 人物属性标题坐标x,人物属性标题坐标x,特殊修理x,特殊修理y
  677.     武尊脚本.复位()
  678.     keyboard.keypress(keys.VK_M)
  679.     help.sleep(1500)
  680.     if (color.findpic(0,0,1440,900,"图片\\铁匠铺老板.bmp",000000,0.9,0,a,b)!= -1)
  681.         mouse.mousemove(a+20,b+10)
  682.         mouse.leftclick()
  683. 等待修理:
  684.         help.sleep(500)
  685.         if (color.findpic(0,0,1440,900,"图片\\特殊修理.bmp",000000,0.9,0,特殊修理x,特殊修理y)!= -1)
  686.             mouse.mousemove(特殊修理x+20,特殊修理y+10)
  687.             mouse.leftclick()
  688.             help.sleep(1000)
  689.             if (color.findpic(0,0,1440,900,"图片\\人物属性标题.bmp",000000,0.9,0,a,b)!= -1)
  690.                 mouse.mousemove(a-128,b+212)
  691.                 mouse.leftclick()
  692.                 help.sleep(200)               
  693.                 武尊脚本.修理指定装备(特殊修理x,特殊修理y,a-56,b+243)
  694.                 武尊脚本.修理指定装备(特殊修理x,特殊修理y,a+41,b+231 )
  695.                 武尊脚本.修理指定装备(特殊修理x,特殊修理y,a+41,b+274)
  696.                 武尊脚本.修理指定装备(特殊修理x,特殊修理y,a+41,b+17 )
  697.                 武尊脚本.修理指定装备(特殊修理x,特殊修理y,a+41,b+352)
  698.                 武尊脚本.修理指定装备(特殊修理x,特殊修理y,a+44,b+402 )
  699.                 武尊脚本.修理指定装备(特殊修理x,特殊修理y,a-3,b+398)
  700.                 武尊脚本.修理指定装备(特殊修理x,特殊修理y,a-95,b+398)
  701.                 武尊脚本.修理指定装备(特殊修理x,特殊修理y,a-145,b+397 )
  702.                 武尊脚本.修理指定装备(特殊修理x,特殊修理y,a-142,b+361)
  703.                 武尊脚本.修理指定装备(特殊修理x,特殊修理y,a-138,b+318)
  704.                 武尊脚本.修理指定装备(特殊修理x,特殊修理y,a-142,b+275)                 
  705.             endif
  706.         else
  707.             goto 等待修理
  708.         endif
  709.     endif
  710.     武尊脚本.复位()
  711. endfunction


  712. function 拾取物品()
  713.     var a,b,isFind
  714.     while(true)
  715. 继续捡取物品:
  716.         
  717.         if (武尊脚本.用文字判断包裹已满())  
  718.             thread.suspendthread(线程打怪)
  719.             //武尊脚本.复位()
  720.             武尊脚本.回收物品()
  721.             武尊脚本.销毁物品()
  722.             thread.resumethread(线程打怪)
  723.         endif
  724.         
  725.         pickCnt = 0
  726.         if (color.findpic(x-947, y-526, x-73, y-108,"图片\\黑方点.bmp",000000,0.9,0,a,b) != -1)
  727.             thread.suspendthread(线程打怪)
  728.             mouse.mousemove( a-20,b+15)
  729.             mouse.leftclick()
  730.             help.sleep( 1100)
  731.             pickCnt = pickCnt + 1
  732.             timeCnt = system.gettickcount()
  733.             //thread.resumethread(线程打怪)
  734.         endif
  735.         if (color.findpic(x-947, y-526, x-73, y-108,"图片\\级宝(绿).bmp",000000,0.9,0,a,b) != -1)
  736.             thread.suspendthread(线程打怪)
  737.             mouse.mousemove( a + 10, b + 15 )
  738.             mouse.leftclick()
  739.             help.sleep( 1100)
  740.             pickCnt = pickCnt + 1
  741.             timeCnt = system.gettickcount()
  742.             //thread.resumethread(线程打怪)
  743.             
  744.         endif
  745.         if (color.findpic(x-947, y-526, x-73, y-108,"图片\\级灵(绿).bmp",000000,0.9,0,a,b) != -1)
  746.             thread.suspendthread(线程打怪)
  747.             mouse.mousemove( a + 10, b + 15)
  748.             
  749.             mouse.leftclick()
  750.             help.sleep( 1100)
  751.             pickCnt = pickCnt + 1
  752.             timeCnt = system.gettickcount()
  753.             //thread.resumethread(线程打怪)
  754.             
  755.         endif
  756.         //if (color.findpic(x-947, y-526, x-73, y-108,"图片\\金币.bmp",000000,0.9,0,a,b) != -1)
  757.             //thread.suspendthread(线程打怪)
  758.             //mouse.mousemove( a + 10, b + 15)            
  759.             //mouse.leftclick()
  760.             //help.sleep( 1100)
  761.             //pickCnt = pickCnt + 1
  762.             //timeCnt = system.gettickcount()
  763.             //thread.resumethread(线程打怪)
  764.         //endif
  765.         
  766.         if (color.findpic(x-947, y-526, x-73, y-108,"图片\\进阶石.bmp",000000,0.9,0,a,b) != -1)
  767.             thread.suspendthread(线程打怪)
  768.             mouse.mousemove( a + 10, b + 15)
  769.             mouse.leftclick()
  770.             help.sleep( 1100)
  771.             pickCnt = pickCnt+1
  772.             //thread.resumethread(线程打怪)
  773.         endif
  774.         if (color.findpic(x-947, y-526, x-73, y-108,"图片\\天师道袍.bmp",000000,0.9,0,a,b) != -1)
  775.             thread.suspendthread(线程打怪)
  776.             mouse.mousemove( a+20,b+15)
  777.             mouse.leftclick()
  778.             help.sleep( 1100)
  779.             pickCnt = pickCnt + 1
  780.             timeCnt = system.gettickcount()
  781.             //thread.resumethread(线程打怪)
  782.         endif
  783.         if (color.findpic(x-947, y-526, x-73, y-108,"图片\\天师道衣.bmp",000000,0.9,0,a,b) != -1)
  784.             thread.suspendthread(线程打怪)
  785.             mouse.mousemove( a+20,b+15)
  786.             mouse.leftclick()
  787.             help.sleep( 1100)
  788.             pickCnt = pickCnt + 1
  789.             timeCnt = system.gettickcount()
  790.             //thread.resumethread(线程打怪)
  791.         endif
  792.         
  793.         if (color.findpic(x-947, y-526, x-73, y-108,"图片\\屠龙刀.bmp",000000,0.9,0,a,b) != -1)
  794.             thread.suspendthread(线程打怪)
  795.             mouse.mousemove( a+10,b+15)
  796.             mouse.leftclick()
  797.             help.sleep( 1100)
  798.             pickCnt = pickCnt + 1
  799.             timeCnt = system.gettickcount()
  800.             //thread.resumethread(线程打怪)
  801.         endif
  802.         if (color.findpic(x-947, y-526, x-73, y-108,"图片\\惊世.bmp",000000,0.9,0,a,b) != -1)
  803.             thread.suspendthread(线程打怪)
  804.             mouse.mousemove( a+30,b+15)
  805.             mouse.leftclick()
  806.             help.sleep( 1100)
  807.             pickCnt = pickCnt + 1
  808.             timeCnt = system.gettickcount()
  809.             //thread.resumethread(线程打怪)
  810.         endif
  811.         
  812.         if (color.findpic(x-947, y-526, x-73, y-108,"图片\\护腕.bmp",000000,0.9,0,a,b) != -1)
  813.             thread.suspendthread(线程打怪)
  814.             mouse.mousemove( a+10,b+15)
  815.             mouse.leftclick()
  816.             help.sleep( 1100)
  817.             timeCnt = system.gettickcount()
  818.             
  819.             //thread.resumethread(线程打怪)
  820.         endif
  821.         if (color.findpic(x-947, y-526, x-73, y-108,"图片\\混天.bmp",000000,0.9,0,a,b) != -1)
  822.             thread.suspendthread(线程打怪)
  823.             mouse.mousemove( a+20,b+15)
  824.             mouse.leftclick()
  825.             help.sleep( 1100)
  826.             pickCnt = pickCnt + 1
  827.             timeCnt = system.gettickcount()
  828.             //thread.resumethread(线程打怪)
  829.         endif
  830.         if (color.findpic(x-947, y-526, x-73, y-108,"图片\\乾坤.bmp",000000,0.9,0,a,b) != -1)
  831.             thread.suspendthread(线程打怪)
  832.             mouse.mousemove( a+10,b+15)
  833.             mouse.leftclick()
  834.             help.sleep( 1100)
  835.             pickCnt = pickCnt + 1
  836.             timeCnt = system.gettickcount()
  837.             
  838.             //thread.resumethread(线程打怪)
  839.         endif
  840.         if (color.findpic(x-947, y-526, x-73, y-108,"图片\\天地.bmp",000000,0.9,0,a,b) != -1)
  841.             thread.suspendthread(线程打怪)
  842.             mouse.mousemove( a+10,b+15)
  843.             mouse.leftclick()
  844.             help.sleep( 1100)
  845.             pickCnt = pickCnt + 1
  846.             timeCnt = system.gettickcount()
  847.             //thread.resumethread(线程打怪)
  848.         endif
  849.         
  850.         if (color.findpic(x-947, y-526, x-73, y-108,"图片\\神战(天神战甲).bmp",000000,0.9,0,a,b) != -1)
  851.             thread.suspendthread(线程打怪)
  852.             mouse.mousemove( a,b+15)
  853.             mouse.leftclick()
  854.             help.sleep( 1100)
  855.             pickCnt = pickCnt + 1
  856.             timeCnt = system.gettickcount()
  857.             //thread.resumethread(线程打怪)
  858.         endif
  859.         
  860.         if (color.findpic(x-947, y-526, x-73, y-108,"图片\\玄天剑.bmp",000000,0.9,0,a,b) != -1)
  861.             thread.suspendthread(线程打怪)
  862.             mouse.mousemove( a,b+15)
  863.             mouse.leftclick()
  864.             help.sleep( 1100)
  865.             pickCnt = pickCnt + 1
  866.             timeCnt = system.gettickcount()
  867.             //thread.resumethread(线程打怪)
  868.         endif
  869.         if (color.findpic(x-947, y-526, x-73, y-108,"图片\\龙牙刃.bmp",000000,0.9,0,a,b) != -1)
  870.             thread.suspendthread(线程打怪)
  871.             mouse.mousemove( a,b+15)
  872.             mouse.leftclick()
  873.             help.sleep( 1100)
  874.             pickCnt = pickCnt + 1
  875.             timeCnt = system.gettickcount()
  876.             //thread.resumethread(线程打怪)
  877.         endif
  878.         if (color.findpic(x-947, y-526, x-73, y-108,"图片\\无极.bmp",000000,0.9,0,a,b) != -1)
  879.             thread.suspendthread(线程打怪)
  880.             mouse.mousemove( a+15,b+15)
  881.             mouse.leftclick()
  882.             help.sleep( 1100)
  883.             pickCnt = pickCnt + 1
  884.             timeCnt = system.gettickcount()
  885.             thread.resumethread(线程打怪)
  886.         endif
  887.         if (color.findpic(x-947, y-526, x-73, y-108,"图片\\无极.bmp",000000,0.9,0,a,b) != -1)
  888.             thread.suspendthread(线程打怪)
  889.             mouse.mousemove( a-20,b+15)
  890.             mouse.leftclick()
  891.             help.sleep( 1100)
  892.             pickCnt = pickCnt + 1
  893.             timeCnt = system.gettickcount()
  894.             //thread.resumethread(线程打怪)
  895.         endif
  896.         if (color.findpic(x-947, y-526, x-73, y-108,"图片\\武威.bmp",000000,0.9,0,a,b) != -1)
  897.             thread.suspendthread(线程打怪)
  898.             mouse.mousemove( a-20,b+15)
  899.             mouse.leftclick()
  900.             help.sleep( 1100)
  901.             pickCnt = pickCnt + 1
  902.             timeCnt = system.gettickcount()
  903.             //thread.resumethread(线程打怪)
  904.         endif
  905.         if (color.findpic(x-947, y-526, x-73, y-108,"图片\\烈焰.bmp",000000,0.9,0,a,b) != -1)
  906.             thread.suspendthread(线程打怪)
  907.             mouse.mousemove( a-20,b+15)
  908.             mouse.leftclick()
  909.             help.sleep( 1100)
  910.             pickCnt = pickCnt + 1
  911.             timeCnt = system.gettickcount()
  912.             //thread.resumethread(线程打怪)
  913.         endif
  914.         //Call 检查血值
  915.         if( pickCnt != 0 )
  916.             goto 继续捡取物品
  917.         endif
  918.         thread.resumethread(线程打怪)
  919.         //Call 换地点
  920.         //Call 寻找BOSS与跑路
  921.     endwhile
  922.    
  923. endfunction

  924. function 用文字判断包裹已满()
  925.     var a,b
  926.     if (color.findpic(x-1228, y-97, x-1018, y-28,"图片\\包裹已满.bmp",000000,0.9,0,a,b)!= -1)        
  927.         return true
  928.     endif
  929.     return false
  930. endfunction

  931. function hkStart_killfocus()
  932.     hotkey.register("hkStart")
  933. endfunction

  934. function hkExit_killfocus()
  935.     hotkey.register("hkExit")     
  936. endfunction

  937. function hkStop_onhotkey()
  938.     武尊脚本.btnStop_click()
  939. endfunction


  940. function hkStop_killfocus()
  941.     hotkey.register("hkStop")
  942. endfunction


  943. function btnStart_click()
  944.    
  945.     if (curScState)
  946.         return 0
  947.     endif
  948.    
  949.     武尊脚本.初始基坐标()   
  950.     线程查血 = thread.beginthread("武尊脚本.检查血值","")
  951.     线程打怪 = thread.beginthread("武尊脚本.打怪与寻路","")
  952.     线程捡物 = thread.beginthread("武尊脚本.拾取物品","")
  953.     help.sleep(1000)
  954.     监测线程 = thread.beginthread("武尊脚本.初始化监视","")
  955.     timerEnable = true
  956.     control.enable("btnStop",true)
  957.     control.enable("btnStart",false)
  958.     curScState = true
  959. endfunction


  960. function btnStop_click()
  961.     if (!curScState)
  962.         return 0
  963.     endif
  964.     control.enable("btnStop",false)
  965.     control.enable("btnStart",true)
  966.     thread.closethread(线程查血)
  967.     thread.closethread(线程打怪)
  968.     thread.closethread(线程捡物)
  969.     thread.closethread(监测线程)
  970.     curScState = false
  971. endfunction

  972. function hkExit_onhotkey()
  973.     武尊脚本.exit_click()
  974. endfunction

  975. function btnSave_click() //保存
  976.     help.writeini("ParamSettings","TaskName",combo.getcursel("cboTaskList"),iniFilePath)
  977.     help.writeini("ParamSettings","Job",combo.getcursel("cboJobList"),iniFilePath)
  978.     help.writeini("ParamSettings","StuffKey",edit.gettext("edtStuffKey"),iniFilePath)
  979.     help.writeini("ParamSettings","RandomStoneKey",edit.gettext("edtRandomStoneKey"),iniFilePath)
  980.     //help.writeini("ParamSettings","btnSaveHotKey",)
  981.     help.messagebox("设置已保存成功!","武尊辅助")
  982. endfunction

  983. function init()   
  984.     iniFilePath = ".\\config.ini"   
  985.     combo.setcursel("cboTaskList",help.readini("ParamSettings","TaskName",iniFilePath))
  986.     combo.setcursel("cboJobList",help.readini("ParamSettings","Job",iniFilePath))
  987.     edit.settext("edtStuffKey",help.readini("ParamSettings","StuffKey",iniFilePath))
  988.     edit.settext("edtRandomStoneKey",help.readini("ParamSettings","RandomStoneKey",iniFilePath))
  989. endfunction

  990. function TransKey(keyStr) //转换虚拟键值
  991.     if(keyStr == "Q")
  992.         return keys.VK_Q
  993.     endif
  994.     if(keyStr == "W")
  995.         return keys.VK_W
  996.     endif
  997.     if(keyStr == "E")
  998.         return keys.VK_E
  999.     endif
  1000.     if(keyStr == "R")
  1001.         return keys.VK_R
  1002.     endif
  1003.     if(keyStr == "A")
  1004.         return keys.VK_A
  1005.     endif
  1006.     if(keyStr == "S")
  1007.         return keys.VK_S
  1008.     endif
  1009.     if(keyStr == "D")
  1010.         return keys.VK_D
  1011.     endif
  1012.     if(keyStr == "F")
  1013.         return keys.VK_F
  1014.     endif
  1015.     if(keyStr == "1")
  1016.         return keys.VK_1
  1017.     endif
  1018.     if(keyStr == "2")
  1019.         return keys.VK_2
  1020.     endif
  1021.     if(keyStr == "3")
  1022.         return keys.VK_3
  1023.     endif
  1024.     if(keyStr == "4")
  1025.         return keys.VK_4
  1026.     endif
  1027.     if(keyStr == "5")
  1028.         return keys.VK_5
  1029.     endif
  1030.     if(keyStr == "6")
  1031.         return keys.VK_6
  1032.     endif
  1033.     if(keyStr == "7")
  1034.         return keys.VK_7
  1035.     endif
  1036.     if(keyStr == "8")
  1037.         return keys.VK_8
  1038.     endif
  1039. endfunction

  1040. function hkSave_killfocus()
  1041.         hotkey.register("hkSave")
  1042.    
  1043. endfunction

  1044. function hkSave_onhotkey()
  1045.         武尊脚本.btnSave_click()
  1046. endfunction

  1047. function timer0_ontime()
  1048.     //if(timerEnable)
  1049.         //武尊脚本.复位()
  1050.         //武尊脚本.btnStop_click()
  1051.                 //武尊脚本.btnStart_click()
  1052.     //endif
  1053. endfunction

  1054. endnamespace

  1055. namespace keys
  1056. VK_LBUTTON        =        1



  1057. VK_RBUTTON        =        2
  1058. VK_CANCEL        =        3
  1059. VK_MBUTTON        =        4
  1060. VK_BACK        =        8
  1061. VK_TAB        =        9
  1062. VK_CLEAR        =        12
  1063. VK_RETURN        =        13
  1064. VK_SHIFT        =        16
  1065. VK_CONTROL        =        17
  1066. VK_MENU        =        18
  1067. VK_PAUSE        =        19
  1068. VK_CAPITAL        =        20
  1069. VK_ESCAPE        =        27
  1070. VK_SPACE        =        32
  1071. VK_PRIOR        =        33
  1072. VK_NEXT        =        34
  1073. VK_END        =        35
  1074. VK_HOME        =        36
  1075. VK_LEFT        =        37
  1076. VK_UP        =        38
  1077. VK_RIGHT        =        39
  1078. VK_DOWN        =        40
  1079. VK_SELECT        =        41
  1080. VK_PRINT        =        42
  1081. VK_EXECUTE        =        43
  1082. VK_SNAPSHOT        =        44
  1083. VK_INSERT        =        45
  1084. VK_DELETE        =        46
  1085. VK_HELP        =        47
  1086. VK_0        =        48
  1087. VK_1        =        49
  1088. VK_2        =        50
  1089. VK_3        =        51
  1090. VK_4        =        52
  1091. VK_5        =        53
  1092. VK_6        =        54
  1093. VK_7        =        55
  1094. VK_8        =        56
  1095. VK_9        =        57
  1096. VK_A        =        65
  1097. VK_B        =        66
  1098. VK_C        =        67
  1099. VK_D        =        68
  1100. VK_E        =        69
  1101. VK_F        =        70
  1102. VK_G        =        71
  1103. VK_H        =        72
  1104. VK_I        =        73
  1105. VK_J        =        74
  1106. VK_K        =        75
  1107. VK_L        =        76
  1108. VK_M        =        77
  1109. VK_N        =        78
  1110. VK_O        =        79
  1111. VK_P        =        80
  1112. VK_Q        =        81
  1113. VK_R        =        82
  1114. VK_S        =        83
  1115. VK_T        =        84
  1116. VK_U        =        85
  1117. VK_V        =        86
  1118. VK_W        =        87
  1119. VK_X        =        88
  1120. VK_Y        =        89
  1121. VK_Z        =        90
  1122. VK_LWIN        =        91
  1123. VK_RWIN        =        92
  1124. VK_APPS        =        93
  1125. VK_SLEEP        =        95
  1126. VK_NUMPAD0        =        96
  1127. VK_NUMPAD1        =        97
  1128. VK_NUMPAD2        =        98
  1129. VK_NUMPAD3        =        99
  1130. VK_NUMPAD4        =        100
  1131. VK_NUMPAD5        =        101
  1132. VK_NUMPAD6        =        102
  1133. VK_NUMPAD7        =        103
  1134. VK_NUMPAD8        =        104
  1135. VK_NUMPAD9        =        105
  1136. VK_MULTIPLY        =        106
  1137. VK_ADD        =        107
  1138. VK_SEPARATOR        =        108
  1139. VK_SUBTRACT        =        109
  1140. VK_DECIMAL        =        110
  1141. VK_DIVIDE        =        111
  1142. VK_F1        =        112
  1143. VK_F2        =        113
  1144. VK_F3        =        114
  1145. VK_F4        =        115
  1146. VK_F5        =        116
  1147. VK_F6        =        117
  1148. VK_F7        =        118
  1149. VK_F8        =        119
  1150. VK_F9        =        120
  1151. VK_F10        =        121
  1152. VK_F11        =        122
  1153. VK_F12        =        123
  1154. VK_F13        =        124
  1155. VK_F14        =        125
  1156. VK_F15        =        126
  1157. VK_F16        =        127
  1158. VK_F17        =        128
  1159. VK_F18        =        129
  1160. VK_F19        =        130
  1161. VK_F20        =        131
  1162. VK_F21        =        132
  1163. VK_F22        =        133
  1164. VK_F23        =        134
  1165. VK_F24        =        135
  1166. VK_NUMLOCK        =        144
  1167. VK_SCROLL        =        145
  1168. VK_LSHIFT        =        160
  1169. VK_RSHIFT        =        161
  1170. VK_LCONTROL        =        162
  1171. VK_RCONTROL        =        163
  1172. VK_LMENU        =        164
  1173. VK_RMENU        =        165
  1174. VK_OEM_1        =        186
  1175. VK_OEM_PLUS        =        187
  1176. VK_OEM_COMMA        =        188
  1177. VK_OEM_MINUS        =        189
  1178. VK_OEM_PERIOD        =        190
  1179. VK_OEM_2        =        191
  1180. VK_OEM_3        =        192
  1181. VK_OEM_4        =        219
  1182. VK_OEM_5        =        220
  1183. VK_OEM_6        =        221
  1184. VK_OEM_7        =        222
  1185. endnamespace
复制代码


回复

使用道具 举报

发表于 2013-10-27 19:02:24 | 显示全部楼层
1227行
回复

使用道具 举报

发表于 2013-10-27 20:54:14 | 显示全部楼层
这么长代码 没法帮你看
哪里出错 就在哪里下断点 单步调试着查看  慢慢来 总会来找到的
这种问题 在论坛几乎找不到答案
回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-10-28 12:03:38 | 显示全部楼层
187144831 发表于 2013-10-27 20:54
这么长代码 没法帮你看
哪里出错 就在哪里下断点 单步调试着查看  慢慢来 总会来找到的
这种问题 在论坛几 ...

逻辑上应该没什么问题,我估计会不会是线程崩溃造成的,tc没法检测线程异常
回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-10-28 12:04:34 | 显示全部楼层
187144831 发表于 2013-10-27 20:54
这么长代码 没法帮你看
哪里出错 就在哪里下断点 单步调试着查看  慢慢来 总会来找到的
这种问题 在论坛几 ...

不能监视线程状态,如果线程出错了,线程内的脚本就会停止,而这一切程序无法探知
回复 支持 反对

使用道具 举报

发表于 2013-10-28 15:22:02 | 显示全部楼层
{:soso_e193:} 代码太长了,自己调输出吧v
回复 支持 反对

使用道具 举报

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

本版积分规则

关闭

推荐上一条 /2 下一条

关闭

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

GMT+8, 2024-9-23 23:59 , Processed in 0.047590 second(s), 23 queries .

Powered by 海安简单软件服务部

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

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