- 按键精灵会员
- 310264
- 333
- 6
- 590 朵
- 742 个
- 163 个
- 40740
- 2009-09-11
|
1#
t
T
发表于 2010-04-29 18:09
|
|只看楼主
自动打怪实战脚本系列第四弹! 主要适用于《冒险岛》《彩虹岛》这类的横版游戏。 如无法观看,请点击下载:按键精灵视频教程全集 视频版本: http://www.aipai.com/c9/ODY9JSkhJ2gnaiAg.html上集 源代码 - SetSimMode 2
- Hwnd = Plugin.Window.GetKeyFocusWnd()
- sRect = Plugin.Window.GetClientRect(Hwnd)
- Dim MyArray
- MyArray = Split(sRect, "|")
- Ux = CLng(MyArray(0))
- Uy = CLng(MyArray(1))
- Rem 开始右跑
- i=0
- KeyPress "Right", 1
- Delay 20
- KeyDown "Right", 1
- Rem 继续右跑
- Call 吃药()
- Call 出界判定()
- Call 攻击子程序()
- If i = 1 Then
- Goto 开始右跑
- End If
- Delay 100
- Goto 继续右跑
- Rem 开始左跑
- i=0
- KeyPress "Left", 1
- Delay 20
- KeyDown "Left", 1
- Rem 继续左跑
- Call 吃药()
- Call 出界判定()
- Call 攻击子程序()
- If i = 1 Then
- Goto 开始左跑
- End If
- Delay 100
- Goto 继续左跑
- Sub 出界判定()
- FindColor 614+Ux,37+Uy,798+Ux,48+Uy,"00FF55",pointX,pointY
- If pointX > 786 + Ux Then
- KeyUp "Right", 1
- Delay 200
- Goto 开始左跑
- End If
- If pointX > 0 And pointX < 627 + Ux Then
- KeyUp "Left", 1
- Delay 200
- Goto 开始右跑
- End If
- End Sub
- Sub 攻击子程序()
- Rem 攻击开始
- Call 吃药()
- FindPic Ux,Uy,Ux+800,Uy+600,"Attachment:\1.bmp",1,zijiX,zijiY
- If zijiX > 0 And zijiY > 0 Then
- FindPic zijiX-370,zijiY-100,zijiX+230,zijiY+100,"Attachment:\2.bmp",1,guaiX,guaiY
- If guaiX > 0 And guaiY > 0 Then
- i = 1
- KeyUp "Right", 1
- KeyUp "Left", 1
- If guaiX > zijiX - 70 Then
- KeyDown "Right", 1
- Else
- KeyDown "Left", 1
- End If
- KeyPress "A", 1
- KeyPress "S", 1
- KeyPress "D", 1
- KeyPress "F", 1
- KeyPress "Z", 1
- KeyPress "X", 1
- KeyPress "C", 1
- KeyUp "Right", 1
- KeyUp "Left", 1
- Delay 100
- Goto 攻击开始
- Else
- Goto 攻击结束
- End If
- Else
- Goto 攻击结束
- End If
- Rem 攻击结束
- End Sub
- Sub 吃药()
- IfColor 93+Ux,29+Uy,"88BBFF",1 Then
- KeyPress "1", 1
- End If
- IfColor 93+Ux,45+Uy,"EEBB88",1 Then
- KeyPress "2", 1
- End If
- IfColor 73+Ux,29+Uy,"88BBFF",1 Then
- KeyPress "3", 1
- End If
- IfColor 73+Ux,45+Uy,"EEBB88",1 Then
- KeyPress "3", 1
- End If
- End Sub
复制代码
|