天龙八部.Ent
上传用户:hr2818
上传日期:2013-12-07
资源大小:2k
文件大小:7k
- [ScriptOption]
- Description=天龙八步
- BeginHotkey= 36
- BeginHotkeyMod= 0
- EndHotKey= 35
- EndHotKeyMod= 0
- Enable= 1
- RunOnce= 0
- Type= 1
- Number= 1
- ScriptFormat= 0
- [Comment]
- 【脚本功能】:
- 该脚本是天龙八步测试脚本,请自己测试
- 游戏必须是800*600的窗口模式
- 游戏快捷键:1放普通攻击,2、3、4放技能攻击,
- 5放红,F9放宠物食物。
- 先用鼠标右键选中一个怪,然后按下启动脚本热键
- [InitVar]
- [VBSScriptCode]
- [Main]
- '该脚本是天龙八步测试脚本,请自己测试
- '游戏必须是800*600的窗口模式
- '游戏快捷键:1放普通攻击,2、3、4放技能攻击,
- '5放红,F9放宠物食物。
- '先用鼠标右键选中一个怪,然后按下启动脚本热键
- Dim Attack,CTime,X,Y
- Dim HWND,X0,Y0,X1,Y1,X2,Y2,PX1,PY1,PX2,PY2
- Dim CT,CTPick,AttackS
- Dim HPColor,MonColor,BT,CMDHPColor,FullHP
- Dim IsAttack
- Sub Main() '脚本主程序,请在此下写入主程序代码
- HWindow.GEtClientRect X0,Y0,X1,Y1
- HPColor = GetPixelColor(X0+99,Y0+31) '获得人物的血条颜色
- FullHP = GetPixelColor(X0+180,Y0+31)
- MonColor = GetPixelColor(X0+223,Y0+31) '怪满血为344,31
- CMDHPColor = GetPixelColor(X0+94,Y0+70)
- BT=GetTime
- Do While 1=1
- AttackMon
- Pick
- If GetTime - BT > 2000 Then
- Change
- BT=GetTime
- End If
- SitDown
- 'CEat
- AddBlood
- Loop
-
- End Sub '脚本主程序结束
- Sub AttackMon() '攻击怪物函数
- Dim cc,kk,tm
- cc=0
- AddBlood
- Delay 100
- X1=-1
- FindBlockColor X0+300,Y0+100,X0+700,Y0+500,7,1,&HDD,0.96,0.70,X1,Y1
- If x1> 0 Then
- Delay 100
- FindBlockColor X1-40,Y1-30,X1+40,Y1+30,1,3,&HDD,0.96,0.70,X2,Y2 '606060
- If X1>0 And X2>0 And ABS(Y1-Y2)<12 And ABS(X1-X2)<50 Then
- Kill
- Exit Sub
- End If
- End If
- Delay 100
- 'FindCenterBlockColor X0+40,Y0+30,X+790,Y0+570,4,2,&HF1F1,1,0.580,X1,Y1
- FindCenterBlockHSL X0+80,Y0+80,X0+720,Y0+500,4,2,40,240,100,1,1,40,X1,Y1
- 'Dprint "p" & y1
- If x1>0 Then
- Delay 100
- 'FindCenterBlockColor X0+40,Y0+30,X+790,Y0+570,1,4,&HF1F1,1,0.50,X2,Y2 '606060
- FindCenterBlockHSL X1-40,Y1-30,X1+40,Y1+30,1,4,40,240,100,1,1,40,X2,Y2
-
- If X1>0 And X2>0 And ABS(Y1-Y2)<20 And ABS(X1-X2)<50 Then
- Kill
- Exit Sub
- End If
- End If
- End Sub
- Sub Kill()
- Dim IsKill
- IsKill = 0
- AttackS = 0
- For I= 1 To 6
- Select Case I
- Case 1
- MoveTo X1+25,Y1+35
- Delay 150
- If GetCursorShape() = 36929980 Then
- IsKill = 1
- Exit For
- End If
- Case 2
- MoveTo X1-25,Y1+35
- Delay 150
- If GetCursorShape() = 36929980 Then
- IsKill = 1
- Exit For
- End If
- Case 3
- MoveTo X1+30,Y1+35
- Delay 150
- If GetCursorShape() = 36929980 Then
- IsKill = 1
- Exit For
- End If
-
- Case 4
- MoveTo X1-30,Y1+35
- Delay 150
- If GetCursorShape() = 36929980 Then
- IsKill = 1
- Exit For
- End If
- Case 5
- MoveTo X1+10,Y1+35
- Delay 150
- If GetCursorShape() = 36929980 Then
- IsKill = 1
- Exit For
- End If
- Case 6
- MoveTo X1-10,Y1+35
- Delay 150
- If GetCursorShape() = 36929980 Then
- IsKill = 1
- Exit For
- End If
-
- End Select
- Next
-
- If IsKill = 1 Then
- AttackS = 1
-
- LeftClick 4
- tm= GetTime
- Do While IsColor(X0+223,Y0+31,MonColor,1) <> 1 And GetTime -tm <1000
- Delay 10
- Loop
- tm = GetTime
- Do While IsColor(X0+223,Y0+31,MonColor,1) = 1 And GetTime - tm <20000
- 'AddBlood
- KeyPressH "F1",1 '技能攻击,练技能用
- Delay 100
- KeyPressH "F2",1 '普通攻击
- Delay 100
- Loop
- Delay 1000
- KeyPressH "F1",3
- Change
- End If
-
- End Sub
- Sub AddBlood()
- If IsColor(X0+99,Y0+31,HPColor,1) <> 1 Then
- KeyPressH "F6",3
- Delay 100
- End If
- End Sub
- Sub Change() '改变方向
- MoveTo 300+X0,250+Y0
- Delay 50
- RightDown
- RightDown
- MoveR 1,0
- Delay 50
- MoveTo 430+X0,250+Y0
- Delay 200
- RightUp
- MoveTo 723+X0,105+Y0
- LeftClick 1
- End Sub
- Sub SitDown()
- If IsColor(X0+99,Y0+31,HPColor,1) <> 1 Then
- Do While IsColor(X0+180,Y0+31,FullHP,1) <> 1
- KeyPress "F8",1 '坐下
- Delay 100
- Loop
- End If
- End Sub
- Sub CEat()
- If IsColor(X0+94,Y0+70,CMDHPColor,1) <> 1 Then
- KeyPress "F9",1
- End If
- End Sub
- Sub Pick()
- Dim ZTS,TCD
- TCD = 0
- If AttackS = 0 Then Exit Sub
- ZTS = GetTime
- X2=0
- Do While GetTime - ZTS <1000 And X2<=0 '搜索是否有包裹
- FindBlockHSL X0+300,Y0+200,X0+500,Y0+400,3,3,40,240,210,10,1,100,X2,Y2
- Delay 30
- Loop
-
- If X2 > 0 Then
- For I=1 To 5
- Select Case I
- Case 1
- MoveTo X2,Y2
- Delay 300
- If GetCursorShape = 963600 Then
- TCD = 1
- Exit For
- End If
- Case 2
- MoveTo X2-20,Y2-20
- Delay 300
- If GetCursorShape = 963600 Then
- TCD = 1
- Exit For
- End If
- Case 3
- MoveTo X2-20,Y2
- Delay 300
- If GetCursorShape = 963600 Then
- TCD = 1
- Exit For
- End If
- Case 4
- MoveTo X2+20,Y2
- Delay 300
- If GetCursorShape = 963600 Then
- TCD = 1
- Exit For
- End If
- Case 5
- MoveTo X2+20,Y2+20
- Delay 300
- If GetCursorShape = 963600 Then
- TCD = 1
- Exit For
- End If
- End Select
- Next
-
- If TCD = 1 Then
- LeftClick 2
- Delay 100
- tz = GetTime
- X2=0
- Do While GetTime - tz < 3000 And X2<=0 '判断包裹是否打开
- FindBlockHSL X0+200,Y0+150,X0+600,Y0+400,8,1,1,182,82,4,10,10,X2,Y2
- Delay 200
- Loop
- If X2>0 Then
- Dprint X2
- MoveTo X2+60,Y2+30
- LeftClick 2
- Delay 1000
- Do While X2>0
- FindBlockHSL X0+200,Y0+150,X0+600,Y0+400,8,1,1,182,82,4,10,10,X2,Y2
- If X2>0 Then
- MoveTo X2+160,Y2+10
- LeftClick 1
- Delay 500
- End If
- Loop
- End If
- End If
- End If
- End Sub
- [MainEnd]
- [VBSLib]