马上加入TC
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
- 打怪的时候会卡住,跑路的时候有时也卡住,连修装备也卡,停止再开始又行了
复制代码- namespace 武尊脚本
- var x,y//,a,b
- var VK_2 = 50,VK_A = 65,VK_Z = 90
- var 线程查血,线程打怪,线程捡物,监测线程
- var curScState = false
- var iniFilePath = ""
- var timerEnable
- timerEnable = false
- var pickCnt
- var destoryCnt2
- var timeCnt
- var curLocation
- var IsFoundBoss
- var 路径
- var 下一地点x,下一地点y
- //基坐标
- var RTx,RTy,HPx,HPy,BagX,BagY,熔炉坐标x,熔炉坐标y
- var 地图基点x,地图基点y
- var pointColor
- curLocation = 1
- IsFoundBoss = false
- timeCnt = 0
- timeColorCnt = 0
- timeChangePlace = 0
- function 初始基坐标()
- 路径 = help.getrcpath("rc:")
- color.findpic(0,0,1440,900,"图片\\右上角基坐标图.bmp",000000,0.9,0,RTx,RTy) //1272,77
- color.findpic(0,0,1440,900,"图片\\血基坐.bmp",000000,0.9,0,HPx,HPy) //333,839
- color.findpic(0,0,1327,862,"图片\\1212.bmp",#000000,0.8,0,x,y) //1257,817
-
- mouse.mousemove(RTx+35,RTy+122)
- mouse.leftclick()
- help.sleep(1500)
- color.findpic(0,0,1440,900,"图片\\地图.bmp",000000,0.9,0,地图基点x,地图基点y)//688,213
- mouse.mousemove(RTx+35,RTy+122)
- mouse.leftclick()
- help.sleep(1500)
-
- BagX = HPx+545
- BagY = HPy-25
- 熔炉坐标x=x-267
- 熔炉坐标y=y-1
-
- 下一地点x = 地图基点x-170
- 下一地点y = 地图基点y+201
- a = 1
- endfunction
- function exit_click()
- 武尊脚本.btnStop_click()
- help.exit()
- endfunction
- function hkStart_onhotkey()
- 武尊脚本.btnStart_click()
- endfunction
- function 使用技能()
- select(combo.gettext("cboJobList"))
- case "法师":
- keyboard.keypress(武尊脚本.TransKey(edit.gettext("edtStuffKey")))
- help.sleep(100)
-
- case "道士":
- keyboard.keypress(武尊脚本.TransKey(edit.gettext("edtStuffKey")))
- help.sleep(100)
-
- case "战士":
- mouse.leftclick()
- help.sleep(100)
-
- endselect
- endfunction
- function 快捷使用物品(栏位)
- select(栏位)
- case "1":
- mouse.mousemove(HPx+147,HPy-54)
- mouse.leftdoubleclick()
- case "2":
- mouse.mousemove(HPx+186,HPy-54)
- mouse.leftdoubleclick()
- case "3":
- mouse.mousemove(HPx+226,HPy-54)
- mouse.leftdoubleclick()
- case "4":
- mouse.mousemove(HPx+268,HPy-54)
- mouse.leftdoubleclick()
- case "5":
- mouse.mousemove(HPx+310,HPy-54)
- mouse.leftdoubleclick()
- case "6":
- mouse.mousemove(HPx+351,HPy-54)
- mouse.leftdoubleclick()
- case "7":
- mouse.mousemove(HPx+391,HPy-54)
- mouse.leftdoubleclick()
- case "8":
- mouse.mousemove(HPx+431,HPy-54)
- mouse.leftdoubleclick()
- case "Q":
- mouse.mousemove(HPx+147,HPy-9)
- mouse.leftdoubleclick()
- case "W":
- mouse.mousemove(HPx+186,HPy-9)
- mouse.leftdoubleclick()
- case "E":
- mouse.mousemove(HPx+226,HPy-9)
- mouse.leftdoubleclick()
- case "R":
- mouse.mousemove(HPx+268,HPy-9)
- mouse.leftdoubleclick()
- case "A":
- mouse.mousemove(HPx+310,HPy-9)
- mouse.leftdoubleclick()
- case "S":
- mouse.mousemove(HPx+351,HPy-9)
- mouse.leftdoubleclick()
- case "D":
- mouse.mousemove(HPx+391,HPy-9)
- mouse.leftdoubleclick()
- case "F":
- mouse.mousemove(HPx+431,HPy-9)
- mouse.leftdoubleclick()
- endselect
- endfunction
- function 检查血值()
- var a,b
- while(true) //1257,817
- if (color.getpixelcolor(HPx+46, HPy-62) == #5F6A5D)
- //mouse.mousemove(HPx+350, HPy-51 ) //使用随机 6号栏位
- //mouse.leftdoubleclick()
- //keyboard.keypress(武尊脚本.TransKey(edit.gettext("edtRandomStoneKey")))
- 武尊脚本.快捷使用物品(edit.gettext("edtRandomStoneKey"))
- help.sleep(5000)
- keyboard.keypress(VK_2) //按键2
- endif
- if (color.findpic(0,0,1440,900,"图片\\回城复活.bmp",000000,0.9,0,a,b) != -1)
- mouse.mousemove(a+15,b+10)
- mouse.leftclick()
- endif
-
- endwhile
- endfunction
- function 初始化监视()
- var a,b
- while(true)
- if (color.findpic( RTx-19, RTy-48, RTx+75, RTy-3, "图片\\沙漠土城.bmp", 000000,0.9,0, a, b) != -1)
- thread.suspendthread(线程打怪)
- thread.suspendthread(线程捡物)
- 武尊脚本.修理装备()
- if (武尊脚本.判断有无令牌())
- 武尊脚本.使用玛雅令牌()
-
- else
- 武尊脚本.购买令牌()
- 武尊脚本.使用玛雅令牌()
- endif
- thread.resumethread(线程打怪)
- thread.resumethread(线程捡物)
- endif
- help.sleep(2000)
- endwhile
- endfunction
- function 打怪与寻路()
- var a,b
- while(true)
- //如果当前不在玛雅一层
- if (color.findpic( RTx-19, RTy-48, RTx+75, RTy-3, "图片\\玛雅一层.bmp", 000000,0.9,0, a, b) == -1)
- continue
- endif
- IsFoundBoss = false
- //Call 检查血值
-
- if (timeColorCnt +3000 < system.gettickcount() && pointColor == color.getpixelcolor(304,149))
- //keyboard.keypress(keys.VK_Z)
- mouse.mousemove(304,149)
- mouse.leftclick()
- help.sleep(100)
- mouse.leftclick()
- help.sleep(100)
- mouse.leftclick()
- help.sleep(100)
- mouse.leftclick()
- help.sleep(100)
- else
- pointColor = color.getpixelcolor(397,433)
- timeColorCnt = system.gettickcount()
- endif
-
- if (color.findrectpixelcolor( x-1238, y-645, x+35, y-72,#7E7242,0,a,b))
- //help.messagebox( "找到奴玛教主")
- //continue
- mouse.mousemove( a, b)
- 武尊脚本.使用技能()
- IsFoundBoss = true
- timeCnt = system.gettickcount()
- endif
-
- if (color.findrectpixelcolor( x-1238, y-645, x+35, y-72,#5E645D,0,a,b))
- //help.messagebox( "找到金刚")
- //continue
- mouse.mousemove( a, b)
- 武尊脚本.使用技能()
- IsFoundBoss = true
- timeCnt = system.gettickcount()
- endif
- if (color.findrectpixelcolor( x-1238, y-645, x+35, y-72,#C59378,0,a,b))
- //help.messagebox( "找到猛玛")
- //continue
- mouse.mousemove( a, b)
- 武尊脚本.使用技能()
- IsFoundBoss = true
- timeCnt = system.gettickcount()
- endif
- if (color.findrectpixelcolor( x-1238, y-645, x+35, y-72,#866965,0,a,b)) //5D4949
- //help.messagebox( "找到蛇蝎")
- //continue
- mouse.mousemove( a, b)
- 武尊脚本.使用技能()
- IsFoundBoss = true
- timeCnt = system.gettickcount()
- endif
-
- if (color.findrectpixelcolor( x-1238, y-645, x+35, y-72,#48462A,0,a,b)) //323024
- //help.messagebox( "找到重装")
- //continue
- mouse.mousemove( a, b)
- 武尊脚本.使用技能()
- IsFoundBoss = true
- timeCnt = system.gettickcount()
- endif
-
- if (IsFoundBoss == false && timeCnt+5000 <system.gettickcount())
- 武尊脚本.换地点()
- //武尊脚本.拾取物品()
- endif
- endwhile
-
- endfunction
- function 购买令牌()
- var a,b
- 武尊脚本.复位()
- mouse.mousemove( x+19, y+4) //打开商城
- mouse.leftclick()
- help.sleep( 1500)
-
- if (color.findpic(0,0,1440,900,"图片\\绑定商城(文字).bmp",000000,0.9,0,a,b) != -1)
-
- mouse.mousemove( a+10,b+10 )//点绑定商城
- mouse.leftclick()
- help.sleep( 300)
-
- mouse.mousemove( a+213,b+96) //点购买令牌按钮
- mouse.leftclick()
- help.sleep( 500)
-
- mouse.mousemove( a+273,b+226) //点确定
- mouse.leftclick()
- help.sleep( 500)
-
- endif
- mouse.mousemove( a+539,b-19) //关闭商城
- mouse.leftclick()
- help.sleep( 1500)
- endfunction
- function 换地点()
- //武尊脚本.复位()
- var a,b
-
- if (color.findpic(0,0,1440,900,"图片\\地图.bmp",000000,0.9,0,a,b)!= -1)
- mouse.mousemove(RTx+35,RTy+122)
- mouse.leftclick()
- help.sleep(1500)
- endif
- if (color.findpic( RTx+63, RTy-48, RTx+143, RTy-5, "图片\\第一个地点49_77.bmp", 000000,0.9,0, a, b) != -1)
- 下一地点x = 地图基点x-109
- 下一地点y = 地图基点y+147
- endif
- if (color.findpic( RTx+63, RTy-48, RTx+143, RTy-5, "图片\\第二个地点77_52.bmp", 000000,0.9,0, a, b) != -1)
- 下一地点x = 地图基点x-33
- 下一地点y = 地图基点y+223
- endif
- if (color.findpic( RTx+63, RTy-48, RTx+143, RTy-5, "图片\\第三个地点111_87.bmp", 000000,0.9,0, a, b) != -1)
- 下一地点x = 地图基点x-82
- 下一地点y = 地图基点y+278
- endif
- if (color.findpic( RTx+63, RTy-48, RTx+143, RTy-5, "图片\\第四个地点89_112.bmp", 000000,0.9,0, a, b) != -1)
- 下一地点x = 地图基点x+44
- 下一地点y = 地图基点y+372
- endif
- if (color.findpic( RTx+63, RTy-48, RTx+143, RTy-5, "图片\\第五个地点147_155.bmp", 000000,0.9,0, a, b) != -1)
- 下一地点x = 地图基点x-170
- 下一地点y = 地图基点y+201
- endif
-
- if (timeChangePlace +5000 > system.gettickcount())
- return 0
- else
- timeChangePlace = system.gettickcount()
- endif
-
- mouse.mousemove(RTx+35,RTy+122)
- mouse.leftclick()
- help.sleep(1000)
- mouse.mousemove(下一地点x,下一地点y)
- mouse.leftclick()
- help.sleep(500)
- mouse.mousemove(RTx+35,RTy+122)
- mouse.leftclick()
- //help.sleep(1000)
-
-
- endfunction
- function 回收物品()
- //武尊脚本.复位()
- mouse.mousemove(熔炉坐标x, 熔炉坐标y) //打开关闭熔炉
- mouse.leftclick()
- help.sleep(1500)
- var a,b
- if (color.findpic(0,0,1440,900,"图片\\装备回收.bmp",000000,0.9,0,a,b)!= -1)
- mouse.mousemove( a+10,b+10)
- mouse.leftclick()
- help.sleep(200)
- if (color.findpic(0,0,1440,900,"图片\\全部添加.bmp",000000,0.9,0,a,b)!= -1)
- mouse.mousemove( a+10,b+10)
- mouse.leftclick()
- help.sleep(200)
- if (color.findpic(0,0,1440,900,"图片\\确认回收.bmp",000000,0.9,0,a,b)!= -1)
- mouse.mousemove( a+10,b+10)
- mouse.leftclick()
- help.sleep(200)
- endif
- endif
- endif
-
- mouse.mousemove(熔炉坐标x, 熔炉坐标y) //打开关闭熔炉
- mouse.leftclick()
- help.sleep(1500)
- endfunction
- function 销毁物品()
- var destoryX,destoryY
- var a,b
- mouse.mousemove( BagX,BagY) //打开关闭包裹
- mouse.leftclick()
-
- help.sleep( 2010)
- if (color.findpic(0,0,1440,900,"图片\\摧毁物品.bmp",000000,0.9,0,destoryX,destoryY) != -1)
- mouse.mousemove( destoryX+10,destoryY+5)
- help.sleep( 300)
- mouse.leftclick() //点击销毁物品
- endif
-
- 继续销毁物品:
- destoryCnt = 0
-
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\紫碧螺.bmp",000000,0.9,0,a,b) != -1)
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
-
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\天师手.bmp",000000,0.9,0,a,b) != -1)
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
-
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\玄铁头盔.bmp",000000,0.9,0,a,b) != -1)
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
-
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\道力戒指.bmp",000000,0.9,0,a,b) != -1)
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
-
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\魔力镜.bmp",000000,0.9,0,a,b) != -1)
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
-
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\魔神头盔.bmp",000000,0.9,0,a,b) != -1)
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
-
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\魔神手.bmp",000000,0.9,0,a,b) != -1)
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\三眼手.bmp",000000,0.9,0,a,b) != -1)
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\翡翠项链.bmp",000000,0.9,0,a,b) != -1)
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
-
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\审判之杖.bmp",000000,0.9,0,a,b) != -1)
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
-
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\战神铠甲女.bmp",000000,0.9,0,a,b) != -1)
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
-
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\天师项链.bmp",000000,0.9,0,a,b) != -1)
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
-
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\珊瑚戒指.bmp",000000,0.9,0,a,b) != -1)
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
-
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\道魂项链.bmp",000000,0.9,0,a,b) != -1)
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
-
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\无极棍.bmp",000000,0.9,0,a,b) != -1)
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\天师戒指.bmp",000000,0.9,0,a,b) != -1)
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\虎齿项链.bmp",000000,0.9,0,a,b) != -1)
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\邪恶铃铛.bmp",000000,0.9,0,a,b) != -1)
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
-
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\圣战手.bmp",000000,0.9,0,a,b) != -1)
-
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\红药.bmp",000000,0.9,0,a,b) != -1)
-
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
-
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\蓝药.bmp",000000,0.9,0,a,b) != -1)
-
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
-
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\魔神戒指.bmp",000000,0.9,0,a,b) != -1)
-
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
-
- if(color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\魔神项链.bmp",000000,0.9,0,a,b) != -1)
-
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
-
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\战神铠甲.bmp",000000,0.9,0,a,b) != -1)
-
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
-
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\泰坦戒.bmp",000000,0.9,0,a,b) != -1)
-
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
-
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\绿玉项链.bmp",000000,0.9,0,a,b) != -1)
-
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
-
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\恶魔战袍.bmp",000000,0.9,0,a,b) != -1)
-
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
-
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\战圣头盔.bmp",000000,0.9,0,a,b) != -1)
-
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
-
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\灵魂道袍.bmp",000000,0.9,0,a,b) != -1)
-
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
-
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\力量戒指.bmp",000000,0.9,0,a,b) != -1)
-
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
-
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\战圣戒指.bmp",000000,0.9,0,a,b) != -1)
-
- mouse.mousemove( a+10, b+5)
- mouse.leftclick()
- help.sleep( 300)
- destoryCnt = destoryCnt+1
- endif
-
- if (destoryCnt != 0 )
- goto 继续销毁物品
- endif
-
- mouse.mousemove(destoryX-100,destoryY)
- mouse.leftclick()
- help.sleep( 300)
- //销毁太阳水
-
- 继续销毁太阳水:
- if (color.findpic(destoryX-247,destoryY-364,destoryX+78,destoryY+87,"图片\\强效太阳水.bmp",000000,0.9,0,a,b)!= -1)
- //mouse.mousemove( destoryX+10,destoryY+5)
- //help.sleep( 300)
- //mouse.leftclick() //点击销毁物品,获处铁锤
- mouse.mousemove( a+10, b+5) //点击太阳水
- mouse.leftdoubleclick()
- help.sleep( 200)
- //if (color.findpic(0,0,1440,900,"图片\\确定.bmp",000000,0.9,0,a,b)!= -1)
- //mouse.mousemove( a+10, b+5)
- //mouse.leftclick()
- //help.sleep(300)
- //mouse.leftclick()
- //endif
- goto 继续销毁太阳水
- endif
- //结束销毁太阳水
- mouse.mousemove( BagX,BagY )//打开关闭包裹
- mouse.leftclick()
- help.sleep( 1500)
- endfunction
- function 判断有无令牌()
- var a,b
- 武尊脚本.复位()
- mouse.mousemove( BagX, BagY) //打开关闭包裹
- mouse.leftclick()
- help.sleep(1500)
- if (color.findpic(0,0,1440,900,"图片\\玛雅令牌.bmp",000000,0.9,0,a,b)!= -1)
- mouse.mousemove( a, b) //打开关闭包裹
- mouse.leftclick()
- help.sleep(1500)
- mouse.mousemove( BagX, BagY) //打开关闭包裹
- mouse.leftclick()
- return true
- endif
- mouse.mousemove( BagX, BagY) //打开关闭包裹
- mouse.leftclick()
- return false
- endfunction
- function 使用玛雅令牌()
- var a,b
- 武尊脚本.复位()
- mouse.mousemove( BagX, BagY) //打开关闭包裹
- mouse.leftclick()
- help.sleep( 1500 )
- if (color.findpic(0,0,1440,900,"图片\\玛雅令牌.bmp",000000,0.9,0,a,b )!= -1)//从包裹中查找
- mouse.mousemove( a+10, b+10)
- mouse.leftdoubleclick()
- help.sleep( 1500)
- endif
- mouse.mousemove( BagX, BagY) //打开关闭包裹
- mouse.leftclick()
- help.sleep( 1500)
- endfunction
- function 复位()
- var a,b
- //复位地图,如果已打开则关闭之
- if (color.findpic(0,0,1440,900,"图片\\地图.bmp",000000,0.9,0,a,b)!= -1)
- keyboard.keypress(keys.VK_M)
- help.sleep(1500)
- endif
- //复位包裹
- if (color.findpic(0,0,1440,900,"图片\\包裹标题.bmp",000000,0.9,0,a,b)!= -1)
- keyboard.keypress(keys.VK_B)
- help.sleep(1500)
- endif
- //复位熔炉
- if (color.findpic(0,0,1440,900,"图片\\熔炉标题.bmp",000000,0.9,0,a,b)!= -1)
- keyboard.keypress(keys.VK_I)
- help.sleep(1500)
- endif
-
- //关闭其它未知窗口
- 继续关闭未知窗口:
- if (color.findpic(0,0,1440,900,"图片\\叉.bmp",000000,0.9,0,a,b)!= -1)
- mouse.mousemove(a+10,b+10)
- mouse.leftclick()
- goto 继续关闭未知窗口
- endif
-
- endfunction
- function 修理指定装备(特殊修理x,特殊修理y,装备x,装备y)
- mouse.mousemove(特殊修理x+20,特殊修理y+10)
- mouse.leftclick()
- mouse.mousemove(装备x,装备y)
- mouse.leftclick()
- help.sleep(200)
- endfunction
- function 修理装备()
- var a,b
- var 人物属性标题坐标x,人物属性标题坐标x,特殊修理x,特殊修理y
- 武尊脚本.复位()
- keyboard.keypress(keys.VK_M)
- help.sleep(1500)
- if (color.findpic(0,0,1440,900,"图片\\铁匠铺老板.bmp",000000,0.9,0,a,b)!= -1)
- mouse.mousemove(a+20,b+10)
- mouse.leftclick()
- 等待修理:
- help.sleep(500)
- if (color.findpic(0,0,1440,900,"图片\\特殊修理.bmp",000000,0.9,0,特殊修理x,特殊修理y)!= -1)
- mouse.mousemove(特殊修理x+20,特殊修理y+10)
- mouse.leftclick()
- help.sleep(1000)
- if (color.findpic(0,0,1440,900,"图片\\人物属性标题.bmp",000000,0.9,0,a,b)!= -1)
- mouse.mousemove(a-128,b+212)
- mouse.leftclick()
- help.sleep(200)
- 武尊脚本.修理指定装备(特殊修理x,特殊修理y,a-56,b+243)
- 武尊脚本.修理指定装备(特殊修理x,特殊修理y,a+41,b+231 )
- 武尊脚本.修理指定装备(特殊修理x,特殊修理y,a+41,b+274)
- 武尊脚本.修理指定装备(特殊修理x,特殊修理y,a+41,b+17 )
- 武尊脚本.修理指定装备(特殊修理x,特殊修理y,a+41,b+352)
- 武尊脚本.修理指定装备(特殊修理x,特殊修理y,a+44,b+402 )
- 武尊脚本.修理指定装备(特殊修理x,特殊修理y,a-3,b+398)
- 武尊脚本.修理指定装备(特殊修理x,特殊修理y,a-95,b+398)
- 武尊脚本.修理指定装备(特殊修理x,特殊修理y,a-145,b+397 )
- 武尊脚本.修理指定装备(特殊修理x,特殊修理y,a-142,b+361)
- 武尊脚本.修理指定装备(特殊修理x,特殊修理y,a-138,b+318)
- 武尊脚本.修理指定装备(特殊修理x,特殊修理y,a-142,b+275)
- endif
- else
- goto 等待修理
- endif
- endif
- 武尊脚本.复位()
- endfunction
- function 拾取物品()
- var a,b,isFind
- while(true)
- 继续捡取物品:
-
- if (武尊脚本.用文字判断包裹已满())
- thread.suspendthread(线程打怪)
- //武尊脚本.复位()
- 武尊脚本.回收物品()
- 武尊脚本.销毁物品()
- thread.resumethread(线程打怪)
- endif
-
- pickCnt = 0
- if (color.findpic(x-947, y-526, x-73, y-108,"图片\\黑方点.bmp",000000,0.9,0,a,b) != -1)
- thread.suspendthread(线程打怪)
- mouse.mousemove( a-20,b+15)
- mouse.leftclick()
- help.sleep( 1100)
- pickCnt = pickCnt + 1
- timeCnt = system.gettickcount()
- //thread.resumethread(线程打怪)
- endif
- if (color.findpic(x-947, y-526, x-73, y-108,"图片\\级宝(绿).bmp",000000,0.9,0,a,b) != -1)
- thread.suspendthread(线程打怪)
- mouse.mousemove( a + 10, b + 15 )
- mouse.leftclick()
- help.sleep( 1100)
- pickCnt = pickCnt + 1
- timeCnt = system.gettickcount()
- //thread.resumethread(线程打怪)
-
- endif
- if (color.findpic(x-947, y-526, x-73, y-108,"图片\\级灵(绿).bmp",000000,0.9,0,a,b) != -1)
- thread.suspendthread(线程打怪)
- mouse.mousemove( a + 10, b + 15)
-
- mouse.leftclick()
- help.sleep( 1100)
- pickCnt = pickCnt + 1
- timeCnt = system.gettickcount()
- //thread.resumethread(线程打怪)
-
- endif
- //if (color.findpic(x-947, y-526, x-73, y-108,"图片\\金币.bmp",000000,0.9,0,a,b) != -1)
- //thread.suspendthread(线程打怪)
- //mouse.mousemove( a + 10, b + 15)
- //mouse.leftclick()
- //help.sleep( 1100)
- //pickCnt = pickCnt + 1
- //timeCnt = system.gettickcount()
- //thread.resumethread(线程打怪)
- //endif
-
- if (color.findpic(x-947, y-526, x-73, y-108,"图片\\进阶石.bmp",000000,0.9,0,a,b) != -1)
- thread.suspendthread(线程打怪)
- mouse.mousemove( a + 10, b + 15)
- mouse.leftclick()
- help.sleep( 1100)
- pickCnt = pickCnt+1
- //thread.resumethread(线程打怪)
- endif
- if (color.findpic(x-947, y-526, x-73, y-108,"图片\\天师道袍.bmp",000000,0.9,0,a,b) != -1)
- thread.suspendthread(线程打怪)
- mouse.mousemove( a+20,b+15)
- mouse.leftclick()
- help.sleep( 1100)
- pickCnt = pickCnt + 1
- timeCnt = system.gettickcount()
- //thread.resumethread(线程打怪)
- endif
- if (color.findpic(x-947, y-526, x-73, y-108,"图片\\天师道衣.bmp",000000,0.9,0,a,b) != -1)
- thread.suspendthread(线程打怪)
- mouse.mousemove( a+20,b+15)
- mouse.leftclick()
- help.sleep( 1100)
- pickCnt = pickCnt + 1
- timeCnt = system.gettickcount()
- //thread.resumethread(线程打怪)
- endif
-
- if (color.findpic(x-947, y-526, x-73, y-108,"图片\\屠龙刀.bmp",000000,0.9,0,a,b) != -1)
- thread.suspendthread(线程打怪)
- mouse.mousemove( a+10,b+15)
- mouse.leftclick()
- help.sleep( 1100)
- pickCnt = pickCnt + 1
- timeCnt = system.gettickcount()
- //thread.resumethread(线程打怪)
- endif
- if (color.findpic(x-947, y-526, x-73, y-108,"图片\\惊世.bmp",000000,0.9,0,a,b) != -1)
- thread.suspendthread(线程打怪)
- mouse.mousemove( a+30,b+15)
- mouse.leftclick()
- help.sleep( 1100)
- pickCnt = pickCnt + 1
- timeCnt = system.gettickcount()
- //thread.resumethread(线程打怪)
- endif
-
- if (color.findpic(x-947, y-526, x-73, y-108,"图片\\护腕.bmp",000000,0.9,0,a,b) != -1)
- thread.suspendthread(线程打怪)
- mouse.mousemove( a+10,b+15)
- mouse.leftclick()
- help.sleep( 1100)
- timeCnt = system.gettickcount()
-
- //thread.resumethread(线程打怪)
- endif
- if (color.findpic(x-947, y-526, x-73, y-108,"图片\\混天.bmp",000000,0.9,0,a,b) != -1)
- thread.suspendthread(线程打怪)
- mouse.mousemove( a+20,b+15)
- mouse.leftclick()
- help.sleep( 1100)
- pickCnt = pickCnt + 1
- timeCnt = system.gettickcount()
- //thread.resumethread(线程打怪)
- endif
- if (color.findpic(x-947, y-526, x-73, y-108,"图片\\乾坤.bmp",000000,0.9,0,a,b) != -1)
- thread.suspendthread(线程打怪)
- mouse.mousemove( a+10,b+15)
- mouse.leftclick()
- help.sleep( 1100)
- pickCnt = pickCnt + 1
- timeCnt = system.gettickcount()
-
- //thread.resumethread(线程打怪)
- endif
- if (color.findpic(x-947, y-526, x-73, y-108,"图片\\天地.bmp",000000,0.9,0,a,b) != -1)
- thread.suspendthread(线程打怪)
- mouse.mousemove( a+10,b+15)
- mouse.leftclick()
- help.sleep( 1100)
- pickCnt = pickCnt + 1
- timeCnt = system.gettickcount()
- //thread.resumethread(线程打怪)
- endif
-
- if (color.findpic(x-947, y-526, x-73, y-108,"图片\\神战(天神战甲).bmp",000000,0.9,0,a,b) != -1)
- thread.suspendthread(线程打怪)
- mouse.mousemove( a,b+15)
- mouse.leftclick()
- help.sleep( 1100)
- pickCnt = pickCnt + 1
- timeCnt = system.gettickcount()
- //thread.resumethread(线程打怪)
- endif
-
- if (color.findpic(x-947, y-526, x-73, y-108,"图片\\玄天剑.bmp",000000,0.9,0,a,b) != -1)
- thread.suspendthread(线程打怪)
- mouse.mousemove( a,b+15)
- mouse.leftclick()
- help.sleep( 1100)
- pickCnt = pickCnt + 1
- timeCnt = system.gettickcount()
- //thread.resumethread(线程打怪)
- endif
- if (color.findpic(x-947, y-526, x-73, y-108,"图片\\龙牙刃.bmp",000000,0.9,0,a,b) != -1)
- thread.suspendthread(线程打怪)
- mouse.mousemove( a,b+15)
- mouse.leftclick()
- help.sleep( 1100)
- pickCnt = pickCnt + 1
- timeCnt = system.gettickcount()
- //thread.resumethread(线程打怪)
- endif
- if (color.findpic(x-947, y-526, x-73, y-108,"图片\\无极.bmp",000000,0.9,0,a,b) != -1)
- thread.suspendthread(线程打怪)
- mouse.mousemove( a+15,b+15)
- mouse.leftclick()
- help.sleep( 1100)
- pickCnt = pickCnt + 1
- timeCnt = system.gettickcount()
- thread.resumethread(线程打怪)
- endif
- if (color.findpic(x-947, y-526, x-73, y-108,"图片\\无极.bmp",000000,0.9,0,a,b) != -1)
- thread.suspendthread(线程打怪)
- mouse.mousemove( a-20,b+15)
- mouse.leftclick()
- help.sleep( 1100)
- pickCnt = pickCnt + 1
- timeCnt = system.gettickcount()
- //thread.resumethread(线程打怪)
- endif
- if (color.findpic(x-947, y-526, x-73, y-108,"图片\\武威.bmp",000000,0.9,0,a,b) != -1)
- thread.suspendthread(线程打怪)
- mouse.mousemove( a-20,b+15)
- mouse.leftclick()
- help.sleep( 1100)
- pickCnt = pickCnt + 1
- timeCnt = system.gettickcount()
- //thread.resumethread(线程打怪)
- endif
- if (color.findpic(x-947, y-526, x-73, y-108,"图片\\烈焰.bmp",000000,0.9,0,a,b) != -1)
- thread.suspendthread(线程打怪)
- mouse.mousemove( a-20,b+15)
- mouse.leftclick()
- help.sleep( 1100)
- pickCnt = pickCnt + 1
- timeCnt = system.gettickcount()
- //thread.resumethread(线程打怪)
- endif
- //Call 检查血值
- if( pickCnt != 0 )
- goto 继续捡取物品
- endif
- thread.resumethread(线程打怪)
- //Call 换地点
- //Call 寻找BOSS与跑路
- endwhile
-
- endfunction
- function 用文字判断包裹已满()
- var a,b
- if (color.findpic(x-1228, y-97, x-1018, y-28,"图片\\包裹已满.bmp",000000,0.9,0,a,b)!= -1)
- return true
- endif
- return false
- endfunction
- function hkStart_killfocus()
- hotkey.register("hkStart")
- endfunction
- function hkExit_killfocus()
- hotkey.register("hkExit")
- endfunction
- function hkStop_onhotkey()
- 武尊脚本.btnStop_click()
- endfunction
- function hkStop_killfocus()
- hotkey.register("hkStop")
- endfunction
- function btnStart_click()
-
- if (curScState)
- return 0
- endif
-
- 武尊脚本.初始基坐标()
- 线程查血 = thread.beginthread("武尊脚本.检查血值","")
- 线程打怪 = thread.beginthread("武尊脚本.打怪与寻路","")
- 线程捡物 = thread.beginthread("武尊脚本.拾取物品","")
- help.sleep(1000)
- 监测线程 = thread.beginthread("武尊脚本.初始化监视","")
- timerEnable = true
- control.enable("btnStop",true)
- control.enable("btnStart",false)
- curScState = true
- endfunction
- function btnStop_click()
- if (!curScState)
- return 0
- endif
- control.enable("btnStop",false)
- control.enable("btnStart",true)
- thread.closethread(线程查血)
- thread.closethread(线程打怪)
- thread.closethread(线程捡物)
- thread.closethread(监测线程)
- curScState = false
- endfunction
- function hkExit_onhotkey()
- 武尊脚本.exit_click()
- endfunction
- function btnSave_click() //保存
- help.writeini("ParamSettings","TaskName",combo.getcursel("cboTaskList"),iniFilePath)
- help.writeini("ParamSettings","Job",combo.getcursel("cboJobList"),iniFilePath)
- help.writeini("ParamSettings","StuffKey",edit.gettext("edtStuffKey"),iniFilePath)
- help.writeini("ParamSettings","RandomStoneKey",edit.gettext("edtRandomStoneKey"),iniFilePath)
- //help.writeini("ParamSettings","btnSaveHotKey",)
- help.messagebox("设置已保存成功!","武尊辅助")
- endfunction
- function init()
- iniFilePath = ".\\config.ini"
- combo.setcursel("cboTaskList",help.readini("ParamSettings","TaskName",iniFilePath))
- combo.setcursel("cboJobList",help.readini("ParamSettings","Job",iniFilePath))
- edit.settext("edtStuffKey",help.readini("ParamSettings","StuffKey",iniFilePath))
- edit.settext("edtRandomStoneKey",help.readini("ParamSettings","RandomStoneKey",iniFilePath))
- endfunction
- function TransKey(keyStr) //转换虚拟键值
- if(keyStr == "Q")
- return keys.VK_Q
- endif
- if(keyStr == "W")
- return keys.VK_W
- endif
- if(keyStr == "E")
- return keys.VK_E
- endif
- if(keyStr == "R")
- return keys.VK_R
- endif
- if(keyStr == "A")
- return keys.VK_A
- endif
- if(keyStr == "S")
- return keys.VK_S
- endif
- if(keyStr == "D")
- return keys.VK_D
- endif
- if(keyStr == "F")
- return keys.VK_F
- endif
- if(keyStr == "1")
- return keys.VK_1
- endif
- if(keyStr == "2")
- return keys.VK_2
- endif
- if(keyStr == "3")
- return keys.VK_3
- endif
- if(keyStr == "4")
- return keys.VK_4
- endif
- if(keyStr == "5")
- return keys.VK_5
- endif
- if(keyStr == "6")
- return keys.VK_6
- endif
- if(keyStr == "7")
- return keys.VK_7
- endif
- if(keyStr == "8")
- return keys.VK_8
- endif
- endfunction
- function hkSave_killfocus()
- hotkey.register("hkSave")
-
- endfunction
- function hkSave_onhotkey()
- 武尊脚本.btnSave_click()
- endfunction
- function timer0_ontime()
- //if(timerEnable)
- //武尊脚本.复位()
- //武尊脚本.btnStop_click()
- //武尊脚本.btnStart_click()
- //endif
- endfunction
- endnamespace
- namespace keys
- VK_LBUTTON = 1
- VK_RBUTTON = 2
- VK_CANCEL = 3
- VK_MBUTTON = 4
- VK_BACK = 8
- VK_TAB = 9
- VK_CLEAR = 12
- VK_RETURN = 13
- VK_SHIFT = 16
- VK_CONTROL = 17
- VK_MENU = 18
- VK_PAUSE = 19
- VK_CAPITAL = 20
- VK_ESCAPE = 27
- VK_SPACE = 32
- VK_PRIOR = 33
- VK_NEXT = 34
- VK_END = 35
- VK_HOME = 36
- VK_LEFT = 37
- VK_UP = 38
- VK_RIGHT = 39
- VK_DOWN = 40
- VK_SELECT = 41
- VK_PRINT = 42
- VK_EXECUTE = 43
- VK_SNAPSHOT = 44
- VK_INSERT = 45
- VK_DELETE = 46
- VK_HELP = 47
- VK_0 = 48
- VK_1 = 49
- VK_2 = 50
- VK_3 = 51
- VK_4 = 52
- VK_5 = 53
- VK_6 = 54
- VK_7 = 55
- VK_8 = 56
- VK_9 = 57
- VK_A = 65
- VK_B = 66
- VK_C = 67
- VK_D = 68
- VK_E = 69
- VK_F = 70
- VK_G = 71
- VK_H = 72
- VK_I = 73
- VK_J = 74
- VK_K = 75
- VK_L = 76
- VK_M = 77
- VK_N = 78
- VK_O = 79
- VK_P = 80
- VK_Q = 81
- VK_R = 82
- VK_S = 83
- VK_T = 84
- VK_U = 85
- VK_V = 86
- VK_W = 87
- VK_X = 88
- VK_Y = 89
- VK_Z = 90
- VK_LWIN = 91
- VK_RWIN = 92
- VK_APPS = 93
- VK_SLEEP = 95
- VK_NUMPAD0 = 96
- VK_NUMPAD1 = 97
- VK_NUMPAD2 = 98
- VK_NUMPAD3 = 99
- VK_NUMPAD4 = 100
- VK_NUMPAD5 = 101
- VK_NUMPAD6 = 102
- VK_NUMPAD7 = 103
- VK_NUMPAD8 = 104
- VK_NUMPAD9 = 105
- VK_MULTIPLY = 106
- VK_ADD = 107
- VK_SEPARATOR = 108
- VK_SUBTRACT = 109
- VK_DECIMAL = 110
- VK_DIVIDE = 111
- VK_F1 = 112
- VK_F2 = 113
- VK_F3 = 114
- VK_F4 = 115
- VK_F5 = 116
- VK_F6 = 117
- VK_F7 = 118
- VK_F8 = 119
- VK_F9 = 120
- VK_F10 = 121
- VK_F11 = 122
- VK_F12 = 123
- VK_F13 = 124
- VK_F14 = 125
- VK_F15 = 126
- VK_F16 = 127
- VK_F17 = 128
- VK_F18 = 129
- VK_F19 = 130
- VK_F20 = 131
- VK_F21 = 132
- VK_F22 = 133
- VK_F23 = 134
- VK_F24 = 135
- VK_NUMLOCK = 144
- VK_SCROLL = 145
- VK_LSHIFT = 160
- VK_RSHIFT = 161
- VK_LCONTROL = 162
- VK_RCONTROL = 163
- VK_LMENU = 164
- VK_RMENU = 165
- VK_OEM_1 = 186
- VK_OEM_PLUS = 187
- VK_OEM_COMMA = 188
- VK_OEM_MINUS = 189
- VK_OEM_PERIOD = 190
- VK_OEM_2 = 191
- VK_OEM_3 = 192
- VK_OEM_4 = 219
- VK_OEM_5 = 220
- VK_OEM_6 = 221
- VK_OEM_7 = 222
- endnamespace
复制代码
|