- 按键精灵会员
- 310264
- 329
- 6
- 586 朵
- 738 个
- 159 个
- 40740
- 2009-09-11
|
1#
t
T
发表于 2010-03-29 17:44
|
|只看楼主
自动打怪实战脚本系列第三弹!2D游戏依然主流网游市场之一,这个教程突破了以往的找怪思路,适用于各种2D甚至2.5D的游戏,如《剑侠世界》、《大明龙权》等等 如无法观看,请点击下载:按键精灵视频教程全集视频版本: http://www.aipai.com/c9/ODY9JSkgKmgnai8v.html-------------------------应网友的要求,这里解说一下怎么计算“实际游戏与小地图的比例”---------------------------计算出比例:263/17=15.47,所以比例大概是16:1或者15:1这样。由于存在一些像素偏差,真正精确的比例需要结合脚本效果来测试;如果脚本运行过程中发现有时候点不到怪,就把比例适当调大或者调小一点。对视频中的计算公式比较疑惑的,也可以不用考虑当中的运算过程,只要直接代公式即可。----------------------------------------------------------------------------------------------------------------源代码: - Hwnd = Plugin.Window.Find(0, "剑侠世界")
- sRect = Plugin.Window.GetClientRect(Hwnd)
- Dim MyArray
- MyArray=Split(Rect,"|")
- Ux = Clng(MyArray(0))
- Uy = Clng(MyArray(1))
- Rem 战斗开始
- Call 吃药()
- KeyPress "Space", 1
- Delay 50
- KeyPress "Space", 1
- Delay 50
- KeyPress "Space", 1
- Delay 50
- Rem 出界判定
- Cx = 662 + Ux
- Cy = 44 + Uy
- Call 坐标读取()
- Zx = group
- Cx = 686 + Ux
- Call 坐标读取()
- Zy = group
- If Zx > 201 Then
- MoveTo 30 + Ux, 300 + Uy
- Delay 50
- LeftClick 1
- Delay 2000
- End If
- If Zx < 198 Then
- MoveTo 770 + Ux, 300 + Uy
- Delay 50
- LeftClick 1
- Delay 2000
- End If
- If Zy > 232 Then
- MoveTo 400 + Ux, 100 + Uy
- Delay 50
- LeftClick 1
- Delay 2000
- End If
- If Zy < 231 Then
- MoveTo 400 + Ux, 500 + Uy
- Delay 50
- LeftClick 1
- Delay 2000
- End If
- If Zx > 197 And Zx < 202 And Zy > 230 And Zy < 233 Then
- Delay 50
- Else
- Goto 出界判定
- End If
- FindColor 706+Ux,86+Uy,738+Ux,102+Uy,"FF59D6",intX,intY
- If intX > 0 And intY > 0 Then
- Qx=(intX-Ux-724)*16+374+Ux
- Qy=(intY-Uy-94)*16+290+Uy
- MoveTo Qx, Qy
- Delay 50
- LeftClick 1
- a = 0
- Rem 战斗中
- Call 吃药()
- Delay 1000
- a = a + 1
- If a > 10 Then
- Goto 战斗开始
- End If
- IfColor 97,110,"B5B6B5",0 Then
- Goto 战斗中
- End If
- Else
- Call 寻怪()
- End If
- Delay 50
- Goto 战斗开始
- Sub 寻怪()
- Randomize
- //获得0-3的随机数
- n = Int(rnd * 4)
- If n = 0 Then
- MoveTo 208+Ux, 140+Uy
- Delay 50
- LeftClick 1
- End If
- If n = 1 Then
- MoveTo 559+Ux, 128+Uy
- Delay 50
- LeftClick 1
- End If
- If n = 2 Then
- MoveTo 559+Ux, 426+Uy
- Delay 50
- LeftClick 1
- End If
- If n = 3 Then
- MoveTo 227+Ux, 428+Uy
- Delay 50
- LeftClick 1
- End If
- Delay 1800
- End Sub
- Sub 坐标读取()
- group=""
- For 3
- code=""
- y=Cy
- For 8
- x=Cx
- For 5
- color=GetPixelColor(x,y)
- If color="00FF00"
- i="1"
- Else
- i="0"
- End If
- code=code & i
- x=x+1
- Next
- y=y+1
- Next
- NO0="0111010001100011000110001100011000101110"
- NO1="0010001100001000010000100001000010001110"
- NO2="0111010001100010001000100010001000011111"
- NO3="0111010001000010011000001000011000101110"
- NO4="0001000110010100101010010011110001000011"
- NO5="1111110000100001111000001000011000101110"
- NO6="0111010010100001111010001100011000101110"
- NO7="1111110010000100010000100001000010000100"
- NO8="0111010001100010111010001100011000101110"
- NO9="0111010001100011000101111000010100101110"
- If code=NO0
- number="0"
- ElseIf code=NO1
- number="1"
- ElseIf code=NO2
- number="2"
- ElseIf code=NO3
- number="3"
- ElseIf code=NO4
- number="4"
- ElseIf code=NO5
- number="5"
- ElseIf code=NO6
- number="6"
- ElseIf code=NO7
- number="7"
- ElseIf code=NO8
- number="8"
- ElseIf code=NO9
- number="9"
- Else
- number="?"
- End If
- Cx=Cx+6
- group=group & number
- Next
-
-
- End Sub
- Sub 吃药()
- IfColor 312+Ux,20+Uy,"AD",1 Then
- KeyPress "1", 1
- Delay 50
- End If
- End Sub
复制代码
|