在此先要感谢“风字”和“Hudakdu”的脚本分享(虽然本人对老夫的威名亦有点不以为然),正因为有他们的分享,才会有现在的脚本诞生。如果不是他们将自己写脚本的技术公布,那么我想即使再学上几个月也不可能会有什么进步。会想写脚本是因为本人实在没时间玩游戏,但对大航海的热情却让我想要继续下去。不为别的,只是为了心中对本人第一个网游的一份执着。公布脚本只是为交流,不是为了让各位用来破坏游戏。既然玩了,那么享受游戏的乐趣才是做为一个玩家最重要的东西,而脚本只是让我们可以从一些烦琐的事务中解放出来。本人所有的公布的脚本都是在游戏窗口800*600之下,32位色真彩下运行。拙劣之处还请各位大大们指证,因为没太多时间泡论坛,故也没办法即时回答各位的疑惑,还请先原谅一下。
[General]
Description=安特卫普港内钓鱼脚本
BeginHotkey=219
BeginHotkeyMod=0
PauseHotkey=0
PauseHotkeyMod=0
StopHotkey=221
StopHotkeyMod=0
RunOnce=1
EnableWindow=
Enable=0
[Repeat]
Type=0
Number=1
[CallBack]
OnSetup=
[Comment]
Content=
[Script]
//安特卫普港内钓鱼脚本
//F1=112;F2=113;F3=114;F4=115;F5=116;F6=117;F7=118;F8=119;F9=120;F10=121;F11=122;F12=123;
UserVar ActionLimit=360 行动力上限
UserVar Jiu=4 点餐酒的位置0为不点
UserVar Cai=8 点餐菜的位置0为不点
VBS set TiShiObj = createobject("WScript.Shell")
Plugin hwn = Window.GetKeyFocusWnd()
//参数设置结束
Gosub 安特卫普港内钓鱼
Rem 脚本结束
EndScript
//=================================================================
Sub 安特卫普港内钓鱼
Gosub 码头广场下
Gosub 码头到酒馆
//是否吃过酒菜
OldJiuCai = 0
Gosub 酒馆事项
Gosub 酒馆到钓点
iActionLimit = ActionLimit
Tishi="窗口自动消失后就可以将航海切至后台了!"
Gosub 提示Tishi
For 99999999
Gosub 钓鱼
Gosub 激活窗口
Gosub 钓点到酒馆
Gosub 酒馆事项
Gosub 酒馆到钓点
Gosub 返回窗口
EndFor
Return 安特卫普港内钓鱼
//=================================================================
Sub 钓鱼
lun = iActionLimit\10-1
For lun
Plugin Window.SendKeyPress(hwn,121)
Delay 2000
Plugin Window.SendKeyPress(hwn,117)
Delay 1500
Plugin Window.SendKeyPress(hwn,122)
Delay 63000
EndFor
Return 钓鱼
Sub 码头广场下
Delay 1000
PosX = 656
PosY = 383
Gosub 移动鼠标
LeftClick 1
Gosub 延时判定
Delay 3000
Return 码头广场下
Sub 码头到酒馆
Delay 1000
TurnWay = "L"
TurnAngle = 800
TurnReset = 0
Gosub 转向
TurnAngle = 2800
Gosub 向前行走
Return 码头到酒馆
Sub 酒馆到钓点
Delay 1000
TurnWay = "L"
TurnAngle = 300
TurnReset = 0
Gosub 转向
TurnAngle = 8500
Gosub 向前行走
Return 酒馆到钓点
Sub 钓点到酒馆
Delay 1000
TurnWay = "R"
TurnAngle = 3000
TurnReset = 1
Gosub 转向
TurnAngle = 8600
Gosub 向前行走
Return 钓点到酒馆
//=================================================================
Sub 酒馆事项
Gosub 查找酒馆入口
Gosub 入口到老板
Gosub 查找酒馆老板
Gosub 补行动力
Gosub 老板到出口
Gosub 查找出口
Return 酒馆事项
Sub 入口到老板
Delay 1000
TurnWay = "L"
TurnAngle = 1100
TurnReset = 0
Gosub 转向
TurnAngle = 1800
Gosub 向前行走
Return 入口到老板
Sub 老板到出口
Delay 1000
TurnWay = "L"
TurnAngle = 2900
TurnReset = 1
Gosub 转向
TurnAngle = 1800
Gosub 向前行走
Return 老板到出口
Sub 补行动力
//移动到点餐按钮,颜色EEEEEE
Delay 1000
MP = 0
While MP = 0
PosX = 647
PosY = 357
Gosub 移动鼠标
LeftClick 1
Gosub 延时判定
Delay 2000
If OldJiuCai = 0
VBS iJiu=Jiu:iCai=Cai
Gosub 点餐
EndIf
PosX = 678
PosY = 331
Gosub 坐标转换
IfColor PosX,PosY,F700F7,1
IfColor PosX,PosY,F77CF7,1
PosX = 600
PosY = 406
Gosub 移动鼠标
LeftClick 1
Gosub 延时判定
Delay 1000
OldJiuCai = 1
Else
MP = 1
KeyPress 27,1
Delay 1000
EndIf
Else
MP = 1
KeyPress 27,1
Delay 1000
EndIf
EndWhile
Return 补行动力
Sub 点餐
Delay 1000
//开始选酒和菜
If iJiu > 0
If iJiu > 5
Below = iJiu - 5
For Below
//移动到下拉箭头
PosX = 384
PosY = 369
Gosub 移动鼠标
LeftClick 1
Delay 1000
EndFor
PosX = 124
PosY = 99+(5-1)*56
Gosub 移动鼠标
Else
PosX = 124
PosY = 99+(iJiu-1)*56
Gosub 移动鼠标
EndIf
LeftClick 1
Delay 1000
EndIf
If iCai > 0
If iCai > 5
If iJiu > 5
Below = iCai - iJiu
Else
Below = iCai - 5
EndIf
For Below
//移动到下拉箭头
PosX = 384
PosY = 369
Gosub 移动鼠标
LeftClick 1
Delay 1000
EndFor
PosX = 124
PosY = 99+(5-1)*56
Gosub 移动鼠标
Else
PosX = 124
PosY = 99+(iCai-1)*56
Gosub 移动鼠标
EndIf
LeftClick 1
Delay 1000
EndIf
Return 点餐
Sub 查找酒馆入口
Delay 1000
NPC_Find = 0
KeyDown 27,1
Delay 600
While NPC_Find = 0
KeyPress 9,1
Delay 1000
PosX = 629
PosY = 328
Gosub 坐标转换
IfColor PosX,PosY,FFFFFF,0
PosX = 640
PosY = 328
Gosub 坐标转换
IfColor PosX,PosY,FFFFFF,0
PosX = 651
PosY = 328
Gosub 坐标转换
IfColor PosX,PosY,FFFFFF,0
PosX = 664
PosY = 330
Gosub 坐标转换
IfColor PosX,PosY,FFFFFF,0
PosX = 684
PosY = 329
Gosub 坐标转换
IfColor PosX,PosY,FFFFFF,0
NPC_Find = 1
KeyUp 27,1
Delay 600
KeyPress 13,1
Delay 3000
KeyPress 13,1
Delay 3000
EndIf
EndIf
EndIf
EndIf
EndIf
EndWhile
Return 查找酒馆入口
Sub 查找酒馆老板
Delay 1000
NPC_Find = 0
KeyDown 27,1
Delay 600
While NPC_Find = 0
KeyPress 9,1
Delay 1000
PosX = 629
PosY = 328
Gosub 坐标转换
IfColor PosX,PosY,FFFFFF,0
PosX = 640
PosY = 328
Gosub 坐标转换
IfColor PosX,PosY,FFFFFF,0
PosX = 664
PosY = 328
Gosub 坐标转换
IfColor PosX,PosY,FFFFFF,0
PosX = 669
PosY = 329
Gosub 坐标转换
IfColor PosX,PosY,FFFFFF,0
PosX = 684
PosY = 328
Gosub 坐标转换
IfColor PosX,PosY,FFFFFF,0
NPC_Find = 1
KeyUp 27,1
Delay 600
KeyPress 13,1
Delay 1000
Gosub 等按钮
EndIf
EndIf
EndIf
EndIf
EndIf
EndWhile
Return 查找酒馆老板
Sub 查找出口
Delay 1000
NPC_Find = 0
KeyDown 27,1
Delay 600
While NPC_Find = 0
KeyPress 9,1
Delay 1000
PosX = 630
PosY = 330
Gosub 坐标转换
IfColor PosX,PosY,FFFFFF,0
PosX = 635
PosY = 328
Gosub 坐标转换
IfColor PosX,PosY,FFFFFF,0
PosX = 639
PosY = 330
Gosub 坐标转换
IfColor PosX,PosY,FFFFFF,0
PosX = 654
PosY = 329
Gosub 坐标转换
IfColor PosX,PosY,FFFFFF,0
NPC_Find = 1
KeyUp 27,1
Delay 600
KeyPress 13,1
Delay 3000
KeyPress 13,1
Delay 3000
EndIf
EndIf
EndIf
EndIf
EndIf
EndWhile
Return 查找出口
//================================================================
//坐标转换(参数PosX,PosY)
Sub 坐标转换
Plugin winRect=Window.GetClientRect(hwn)
winPoint = Split(winRect, "|", -1, 1)
AbsX = CInt(winPoint(0)) + PosX
AbsY = CInt(winPoint(1)) + PosY
PosX = AbsX
PosY = AbsY
Return 坐标转换
//移动鼠标到指定点(以窗口为准参数PosX,PosY相对坐标)
Sub 移动鼠标
Plugin winRect=Window.GetClientRect(hwn)
winPoint = Split(winRect, "|", -1, 1)
AbsX = CInt(winPoint(0)) + PosX
AbsY = CInt(winPoint(1)) + PosY
MoveTo AbsX,AbsY
PosX = AbsX
PosY = AbsY
Delay 600
Return 移动鼠标
//激活窗口和返回窗口是对应应用的
Sub 激活窗口
Plugin yuan=Window.Foreground()
Tishi="请稍等一会,不要动鼠标键盘"
Gosub 提示Tishi
Plugin Window.Active(hwn)
Delay 2500
Plugin Window.Restore(hwn)
Delay 2500
Return 激活窗口
Sub 返回窗口
Tishi="可以继续了"
Gosub 提示Tishi
Plugin Window.Active(yuan)
Return 返回窗口
Sub 提示Tishi
VBSCall TiShiObj.Popup(Tishi,3,"3秒后窗口自动关闭",0)
Return 提示Tshi
Sub 转向
//先定位鼠标,因为在聊天窗口是无法转向的
PosX = 399
PosY = 299
Gosub 移动鼠标
//判断是否需要复位后转向,或就以当前位置转向
//0为复位后转向1为不复位直接转向
If TurnReset = 0
RightClick 1
ElseIf TurnReset = 1
KeyPress 27,1
Else
VBSCall MessageBox ("错误的转向复位参数!")
EndIf
Delay 1500
If TurnWay = "R"
KeyDown 17,1
KeyDown 39,1
Delay TurnAngle
KeyUp 17,1
KeyUp 39,1
Delay 100
ElseIf TurnWay = "L"
KeyDown 17,1
KeyDown 37,1
Delay TurnAngle
KeyUp 17,1
KeyUp 37,1
Delay 100
Else
VBSCall MessageBox ("错误转向参数!")
EndIf
Return 转向
Sub 向前行走
KeyDown 38,1
Delay TurnAngle
KeyUp 38,1
Delay 100
Return 向前行走
Sub 延时判定
Delay 1000
Shape1 = 2106545426
//黄色箭头时候的鼠标形状
Shape2 = 2012885647
//网络延时的时候漏斗的形状
DelayTime = 0
While DelayTime = 0
VBSCall shape = GetCursorShape(0)
If shape = shape2
Delay 1000
ElseIf shape = shape1
DelayTime = 1
EndIf
EndWhile
Return 延时判定
//等对话按钮出现
Sub 等按钮
StButton = 0
While StButton = 0
PosX = 635
PosY = 353
Gosub 坐标转换
IfColor PosX,PosY,FFFFFF,0
StButton = 1
Delay 500
Else
KeyPress 13,1
Delay 1000
EndIf
EndWhile
Return 等按钮