腳本絕對自創,內有自己特有的讀取物價的方法,歡迎各位同好者批評指正,共同交流!
[General]
Description=巴塞帕尔玛(台)
BeginHotkey=187
BeginHotkeyMod=2
PauseHotkey=0
PauseHotkeyMod=0
StopHotkey=123
StopHotkeyMod=0
RunOnce=1
EnableWindow=
Enable=0
AutoRun=0
[Repeat]
Type=0
Number=1
[Relative]
SetupOCXFile=
[Comment]
Content=
[Script]
//自定义栏:F5料理,F4操帆,F3警戒
//快捷键:F4城市放大地图,F10自定义栏
//800*600窗口模式
//坐标选择方法:截屏(x',y')、截屏左上灰色顶点(X,Y)、脚本(X0+x,Y0+y)
//其中 x=x'-X+3, y=y'-Y+4
Rem 键盘常量定义
VBS const TAB = 9
VBS const ENTER = 13
VBS const CTRL = 17
VBS const ESC = 27
VBS const PageUp = 33
VBS const PageDown = 34
VBS const UP = 38
VBS const DOWN = 40
VBS const INSERT = 45
VBS const F1 = 112
VBS const F2 = 113
VBS const F3 = 114
VBS const F4 = 115
VBS const F5 = 116
VBS const F6 = 117
VBS const F7 = 118
VBS const F8 = 119
VBS const F9 = 120
VBS const F10 = 121
VBS const F11 = 122
VBS const F12 = 123
//市内坐标City = Array(交易所(x,y),码头(x,y),酒吧(x,y))
VBS dim CityBarcelona(2)(1) As Variant, CityPalma(2)(1) As Variant
CityBarcelona = Array(Array(447,174),Array(396,303),Array(434,208))
CityAlgiers = Array(Array(591,191),Array(507,295),Array(613,113))
//文字坐标
VBS dim Barcelona(9)(1) As Variant, Algiers(9)(1) As Variant, wharfinger(9)(1) As Variant, boss(9)(1) As Variant
Barcelona = Array(Array(635,336),Array(646,339),Array(647,345),Array(654,338),Array(662,343),Array(668,339),Array(677,338),Array(686,336),Array(689,335),Array(689,345))
Algiers = Array(Array(635,337),Array(639,339),Array(643,342),Array(652,337),Array(664,338),Array(655,343),Array(666,348),Array(670,346),Array(674,347),Array(679,335))
wharfinger = Array(Array(636,337),Array(637,346),Array(634,341),Array(647,335),Array(650,335),Array(638,348),Array(645,345),Array(660,336),Array(659,343),Array(658,347))
boss = Array(Array(641,334),Array(636,340),Array(646,340),Array(642,344),Array(658,346),Array(654,345),Array(678,334),Array(689,335),Array(704,335),Array(709,348))
VBS dim i,j,x,y
//脚本原点坐标(X0,Y0)
VBS dim X0
VBS dim Y0
//键盘常量定义结束
VBS dim num = -1
//price0原始价格,price1一砍价,price2二砍价,cut砍价次数
VBS dim price = 0
VBS dim price0 = 0
VBS dim price1 = 0
VBS dim price2 = 0
VBS dim cut = 2
VBS dim canCut = 1
VBS dim nX = 0
VBS dim nY = 0
VBS dim times = 0
VBS dim nOut = 0
VBS dim hp = 0
VBS dim atam = 0
VBS dim order = 0
//程序窗口变量
VBS dim handle,cRect,MyArray,fileHandle
Rem 程序开始
//获取当前窗口的句柄
Plugin handle = Window.Foreground()
//如果当前无窗口,则结束程序
If handle = 0
VBSCall MessageBox("没有找到窗口,程序结束")
Goto 程序结束
EndIf
Plugin cRect = Window.GetClientRect(handle)
MyArray = Split(cRect, "|", -1, 1)
VBS X0 = MyArray(0) - 5
VBS Y0 = MyArray(1) - 6
Delay 1000
VBS dim startstep = 0
VBSCall GG=InputBox("请输入开始位置!巴帕线1 帕尔玛交易2 帕巴线3 巴塞交易4 默认为1!!! 无内容输入时直接按 OK 或 Cancel 退出!!!")
If StrComp("",GG)=0
Goto 开始巴帕线
EndIf
VBS startstep=CInt(GG)
Delay 1000
If startstep = 1
Goto 开始巴帕线
ElseIf startstep = 2
Goto 开始帕玛交易
ElseIf startstep = 3
Goto 开始帕巴线
ElseIf startstep = 4
Goto 开始巴塞交易
EndIf
Rem 开始帕玛交易
Gosub 帕尔玛交易
Rem 开始帕巴线
Gosub 帕巴线
Rem 开始巴塞交易
Gosub 巴塞罗那买货
Rem 开始巴帕线
While 1=1
Gosub 巴帕线
Gosub 帕尔玛交易
Gosub 帕巴线
Gosub 巴塞罗那买货
EndWhile
Rem 程序结束
EndScript
Sub 巴塞罗那
Rem 寻找巴塞罗那
IfColor X0+661,Y0+389 EEE48A 0
Goto 找到巴塞
EndIf
KeyPress TAB,1
Delay 200
VBS i = 0
For 10
VBS x = Barcelona(i)(0)
VBS y = Barcelona(i)(1)
IfColor X0+x,Y0+y FFFFFF 1
Goto 寻找巴塞罗那
EndIf
VBS i = i+1
EndFor
Delay 500
KeyPress ENTER, 1
Delay 1000
KeyPress ENTER, 1
Delay 1000
KeyPress ENTER, 1
Delay 3000
Gosub 场景转换
Rem 找到巴塞
Return 巴塞罗那
Sub 开小地图
Rem 开小地图
KeyPress F4 1
Delay 1000
If atam = 0
VBS x = X0+CityAlgiers(2)(0)
VBS y = Y0+CityAlgiers(2)(1)
ElseIf atam = 1
VBS x = X0+CityBarcelona(2)(0)
VBS y = Y0+CityBarcelona(2)(1)
EndIf
VBS j = 0
For 5
IfColor x,y+j FFFFFF 1
Goto 开小地图
EndIf
VBS j = j+1
EndFor
Return 开小地图
Sub 寻找交易所
Delay 500
Gosub 开小地图
If atam = 0
VBS x = X0+CityAlgiers(0)(0)
VBS y = Y0+CityAlgiers(0)(1)
ElseIf atam = 1
VBS x = X0+CityBarcelona(0)(0)
VBS y = Y0+CityBarcelona(0)(1)
EndIf
MoveTo x,y
Delay 500
LeftDoubleClick 1
Delay 1000
KeyPress F4 1
Delay 7000
If atam = 1
Delay 3000
EndIf
RightClick 1
Gosub 交易所学徒
Return 寻找交易所
Sub 寻找码头
Gosub 开小地图
If atam = 0
VBS x = X0+CityAlgiers(1)(0)
VBS y = Y0+CityAlgiers(1)(1)
ElseIf atam = 1
VBS x = X0+CityBarcelona(1)(0)
VBS y = Y0+CityBarcelona(1)(1)
EndIf
MoveTo x,y
Delay 500
LeftDoubleClick 1
Delay 1000
KeyPress F4 1
Delay 7000
If atam = 1
Delay 3000
EndIf
RightClick 1
Gosub 码头导航员
Return 寻找码头
Sub 判断体力
IfColor X0+80,Y0+121 343434 0
VBS hp = 1
Else
VBS hp = 0
EndIf
Return 判断体力
Sub 行动力满
IfColor X0+135,Y0+121 343434 0
VBS hp = 1
Else
VBS hp = 0
EndIf
Return 行动力满
Sub 帕尔玛
Rem 寻找帕尔玛
IfColor X0+661,Y0+389 EEE48A 0
Goto 找到帕尔玛
EndIf
KeyPress TAB,1
Delay 200
VBS i = 0
For 10
VBS x = Algiers(i)(0)
VBS y = Algiers(i)(1)
IfColor X0+x,Y0+y FFFFFF 1
Goto 寻找帕尔玛
EndIf
VBS i = i+1
EndFor
Delay 500
KeyPress ENTER, 1
Delay 1000
KeyPress ENTER, 1
Delay 1000
KeyPress ENTER, 1
Delay 3000
Gosub 场景转换
Rem 找到帕尔玛
Return 帕尔玛
Sub 码头导航员
MoveTo X0+400,Y0+400 //去除鼠标干扰
Rem 找码头导航员
KeyPress TAB,1
Delay 500
VBS i = 0
For 10
VBS x = wharfinger(i)(0)
VBS y = wharfinger(i)(1)
IfColor X0+x,Y0+y FFFFFF 1
Goto 找码头导航员
EndIf
VBS i = i+1
EndFor
Delay 100
Rem 导航会话
KeyPress ENTER 1
Delay 1000
IfColor X0+772, Y0+412 EEDD8C 1
Goto 导航会话
EndIf
Return 码头导航员
Sub 交易所学徒
MoveTo X0+400,Y0+400 //去除鼠标干扰
Rem 找交易所学徒
KeyPress TAB,1
Delay 500
VBS i = 0
For 10
VBS x = boss(i)(0)
VBS y = boss(i)(1)
IfColor X0+x,Y0+y FFFFFF 1
Goto 找交易所学徒
EndIf
VBS i = i+1
EndFor
Delay 100
Rem 交易会话
KeyPress ENTER 1
Delay 1000
IfColor X0+772, Y0+389 EEDD8C 1
Goto 交易会话
EndIf
Return 交易所学徒
//固定视角为正下方视角
Sub 正下方视角
//按住鼠标右键从(700,150)拖到(700,550)
MoveTo X0+700,Y0+130
RightDown 1
MoveR 0,400
RightUp 0
Delay 20
RightClick 1
Delay 500
KeyDown PageDown 1
Delay 2000
KeyUp PageDown 1
Return 正下方视角
//场景转换
Sub 场景转换
MoveTo X0+400,Y0+400 //去除鼠标干扰
Rem 正在场景转换
Delay 1000
IfColor X0+28, Y0+61 0000FD 1
Goto 正在场景转换
EndIf
IfColor X0+28, Y0+65 FFFFFF 1
Goto 正在场景转换
EndIf
IfColor X0+28, Y0+70 00DFFE 1
Goto 正在场景转换
EndIf
//Delay 2000
Return 场景转换
Sub 码头进港
Rem 码头按钮
IfColor X0+661,Y0+389 EEE48A 1
Goto 码头按钮
EndIf
MoveTo X0+650,Y0+389
LeftClick 1
Delay 4000
Gosub 场景转换
Return 码头进港
Sub 商会进港
Rem 商会按钮
IfColor X0+661,Y0+389 EEE48A 1
Goto 码头按钮
EndIf
MoveTo X0+730,Y0+389
LeftClick 1
Delay 4000
Gosub 场景转换
Return 商会进港
//巴塞罗那买货
Sub 巴塞罗那买货
Gosub 码头进港
Gosub 判断体力
Gosub 吃料理
VBS atam = 1
Gosub 寻找交易所
RightClick 1
Delay 3000
Gosub 卖货
Delay 2000
Gosub 买货
KeyPress ESC,1
Delay 100
KeyPress ESC,1
Delay 100
Gosub 寻找码头
MoveTo X0+650,Y0+365
LeftClick 1
Delay 4000
Gosub 场景转换
Return 巴塞罗那买货
Sub 帕尔玛交易
Gosub 码头进港
Gosub 判断体力
Gosub 吃料理
VBS atam = 0
Gosub 寻找交易所
RightClick 1
Delay 3000
Gosub 卖货
Delay 2000
Gosub 买货
KeyPress ESC,1
Delay 100
KeyPress ESC,1
Delay 100
Gosub 寻找码头
MoveTo X0+650,Y0+365
LeftClick 1
Delay 4000
Gosub 场景转换
Return 帕尔玛交易
Sub 卖货
MoveTo X0+690,Y0+365
LeftClick 1
Delay 2000
Rem 卖出场景
Delay 1000
IfColor X0+495,Y0+73 000000 1
Goto 卖出场景
EndIf
IfColor X0+533,Y0+71 000000 1
Goto 卖出场景
EndIf
MoveTo X0+330,Y0+77
LeftClick 1
Delay 1000
MoveTo X0+470,Y0+325
Delay 500
Rem 继续要价
IfColor X0+435,Y0+321 FEFEFE 0
LeftClick 1
Delay 2500
//If atam = 0
Goto 要价结束
//EndIf
//Goto 继续要价
EndIf
Rem 要价结束
MoveTo X0+635,Y0+420
LeftClick 1
Delay 3000
Return 卖货
Sub 买货
VBS order = 0
VBS canCut = 0
Rem 开始买货
MoveTo X0+650,Y0+365
LeftClick 1
Delay 2000
Rem 买入场景
Delay 1000
IfColor X0+552,Y0+73 000000 1
Goto 买入场景
EndIf
IfColor X0+575,Y0+72 000000 1
Goto 买入场景
EndIf
//---------------------------------
//如果想练会计技能,请删除下面两句
If atam = 1
Gosub 取引买货
VBS order = order + 1
If order > 1
KeyPress 27,1
Delay 100
KeyPress 27,1
Delay 100
Goto 结束买货
EndIf
Goto 开始买货
Else
Gosub 阿尔买货
EndIf
Rem 结束买货
Return 买货
Sub 取引买货
//坎价
MoveTo X0+485,Y0+328
Delay 500
Gosub 购买价格
VBS price0 = price
Rem 砍价失败
IfColor X0+465,Y0+322 FEFEFE 0
LeftClick 1
Delay 2500
Gosub 购买价格
If price = price0
Goto 砍价失败
EndIf
Else
VBS canCut = 1
EndIf
//买
If order = 0
KeyPress DOWN,1
Delay 200
//皮革
Gosub 一样货物
KeyPress DOWN,1
Delay 200
//单手剑
Gosub 一样货物
KeyPress DOWN,1
Delay 200
//火药
Gosub 一样货物
KeyPress DOWN,1
Delay 200
// 大炮
Gosub 一样货物
KeyPress DOWN,1
Delay 200
KeyPress DOWN,1
Delay 200
KeyPress DOWN,1
Delay 200
KeyPress DOWN,1
Delay 200
//钢
Gosub 一样货物
KeyPress DOWN,1
Delay 200
//盐
//Gosub 一样货物
ElseIf order = 1
//矿石
Gosub 一样货物
For 5
KeyPress DOWN,1
Delay 200
EndFor
//炮弹
Gosub 一样货物
KeyPress DOWN,1
Delay 200
//火枪
Gosub 一样货物
KeyPress DOWN,1
Delay 200
//铜
Gosub 一样货物
ElseIf order = 2
For 3
KeyPress DOWN,1
Delay 200
EndFor
//火药
Gosub 一样货物
EndIf
Delay 1000
MoveTo X0+665, Y0+418
LeftClick 1
Delay 3000
Return 取引买货
Sub 一样货物
KeyDown CTRL,1
Delay 500
MoveTo X0+385,Y0+310
Delay 300
LeftClick 1
Delay 500
IfColor X0+359,Y0+216 B3B3B3 0
MoveTo X0+385,Y0+240
Delay 200
LeftClick 1
Delay 500
EndIf
IfColor X0+359,Y0+146 B3B3B3 0
MoveTo X0+385,Y0+170
Delay 200
LeftClick 1
Delay 500
EndIf
KeyUp CTRL,1
Delay 500
Return 一样货物
Sub 阿尔买货
//坎价
MoveTo X0+485,Y0+328
Delay 500
Gosub 购买价格
VBS price0 = price
Rem 砍价失败
IfColor X0+465,Y0+322 FEFEFE 0
LeftClick 1
Delay 2500
Gosub 购买价格
If price = price0
Goto 砍价失败
EndIf
Else
VBS canCut = 1
EndIf
Delay 2000
//橄榄
Gosub 一样货物
KeyPress DOWN,1
Delay 200
//鱼肉
Gosub 一样货物
KeyPress DOWN,1
Delay 200
//荷兰芹菜
// Gosub 一样货物
KeyPress DOWN,1
Delay 200
//葡萄醋
Gosub 一样货物
KeyPress DOWN,1
Delay 200
//杏仁
Gosub 一样货物
KeyPress DOWN,1
Delay 200
//牛至
// Gosub 一样货物
KeyPress DOWN,1
Delay 200
//香菜
// Gosub 一样货物
KeyPress DOWN,1
Delay 200
//芹菜
// Gosub 一样货物
KeyPress DOWN,1
Delay 200
//百里香
Gosub 一样货物
KeyPress DOWN,1
Delay 200
//珊瑚
// Gosub 一样货物
Delay 200
Delay 1000
MoveTo X0+665, Y0+418
LeftClick 1
Delay 1000
KeyPress 27,1
Delay 100
KeyPress 27,1
Delay 100
Return 阿尔买货
Sub 补给
MoveTo X0+695,Y0+365
LeftClick 1
Delay 1000
Rem 补给场景
Delay 1000
IfColor X0+344,Y0+90 000000 1
Goto 补给场景
EndIf
IfColor X0+362,Y0+91 000000 1
Goto 补给场景
EndIf
MoveTo X0+190,Y0+357
LeftClick 1
Delay 1000
MoveTo X0+607,Y0+398
LeftClick 1
Delay 2000
Return 补给
//出航
Sub 出航
Gosub 补给
Rem 暴风守护
KeyPress ESC,1
Delay 100
KeyPress ESC,1
Delay 100
Rem 点击出航
VBS nOut = 0
MoveTo X0+653,Y0+365
LeftClick 1
Rem 出航场景
VBS nOut = nOut + 1
If nOut > 3
Goto 点击出航
EndIf
Delay 1000
IfColor X0+193,Y0+96 000000 1
Goto 出航场景
EndIf
IfColor X0+178,Y0+107 000000 1
Goto 出航场景
EndIf
IfColor X0+698, Y0+357 FFFFFF 0
IfColor X0+704, Y0+358 FFFFFF 0
IfColor X0+716, Y0+352 FFFFFF 0
Delay 10000
Goto 暴风守护
EndIf
EndIf
EndIf
MoveTo X0+645,Y0+392
LeftClick 1
Delay 5000
Gosub 场景转换
Return 出航
Sub 船顶视角
//按住鼠标右键从(700,150)拖到(700,550)
MoveTo X0+700,Y0+130
RightDown 1
MoveR 0,400
RightUp 0
Delay 20
RightClick 1
Delay 500
KeyDown PageUp 1
Delay 2000
KeyUp PageUp 1
Delay 500
Return 船顶视角
Sub 巴帕线
Gosub 出航
Gosub 船顶视角
//y=(12400-19x)/16
MoveTo X0+480,Y0+204
Delay 1000
LeftDoubleClick 1
Delay 2000
KeyPress F10 1
Delay 3000
KeyPress F4 1
Delay 2000
KeyPress F10 1
Delay 3000
KeyPress F3 1
Delay 2000
Delay 70000
//矫正视角,保证定位
MoveTo X0+400,Y0+500
RightDown 1
MoveR 0,-250
RightUp 0
Delay 500
Delay 13000
KeyDown PageDown 1
Delay 2000
KeyUp PageDown 1
Delay 2000
Rem 确认帕尔玛
Gosub 帕尔玛
IfColor X0+661,Y0+389 EEE48A 1
Goto 确认帕尔玛
EndIf
Return 巴帕线
//帕巴线
Sub 帕巴线
Gosub 出航
Gosub 船顶视角
//海上45度视角从海尔朝向格罗阿姆方向
//y=(11500-4x)/33
MoveTo X0+480,Y0+290
Delay 1000
LeftDoubleClick 1
Delay 2000
KeyPress F10 1
Delay 3000
KeyPress F4 1
Delay 2000
KeyPress F10 1
Delay 3000
KeyPress F3 1
Delay 2000
Delay 70000
//矫正视角,保证定位
MoveTo X0+400,Y0+500
RightDown 1
MoveR 0,-250
RightUp 0
Delay 500
Delay 13000
KeyDown PageDown 1
Delay 2000
KeyUp PageDown 1
Delay 2000
RightClick 1
Delay 500
Rem 确认巴塞
Gosub 巴塞罗那
IfColor X0+661,Y0+389 EEE48A 1
Goto 确认巴塞
EndIf
Return 帕巴线
Sub 吃料理
KeyPress 27,1
Delay 100
While hp = 1
KeyPress F10,1
Delay 2000
KeyPress F5,1
Delay 1000
Gosub 行动力满
EndWhile
Delay 1000
KeyPress 27,1
Delay 100
KeyPress 27,1
Delay 100
Return 吃料理
//读购买价格
Sub 购买价格
VBS nX=X0+399
VBS nY=Y0+198
VBS price=0
VBS times=0
For 5
Gosub 读数字
If num > -1
VBS price = price+num*(10^times)
EndIf
VBS times = times + 1
VBS nX = nX - 8
If times=3
nX = nX - 4
EndIf
EndFor
Return 购买价格
//读数字
Sub 读数字
//0
IfColor nX+6,nY+3,FFFFFF,0
VBS num = 0
Goto 读到数字
EndIf
//1
IfColor nX+3,nY+1,FFFFFF,0
VBS num = 1
Goto 读到数字
EndIf
//2
IfColor nX+6,nY+11,FFFFFF,0
VBS num = 2
Goto 读到数字
EndIf
//4
IfColor nX+4,nY+1,FFFFFF,0
VBS num = 4
Goto 读到数字
EndIf
//5
IfColor nX+1,nY+1,FFFFFF,0
VBS num = 5
Goto 读到数字
EndIf
//6
IfColor nX+2,nY+1,FFFFFF,0
VBS num = 6
Goto 读到数字
EndIf
//7
IfColor nX+1,nY,FFFFFF,0
VBS num = 7
Goto 读到数字
EndIf
//8
IfColor nX+3,nY+5,FFFFFF,0
VBS num = 8
Goto 读到数字
EndIf
//9
IfColor nX+5,nY+5,FFFFFF,0
VBS num = 9
Goto 读到数字
EndIf
//3
IfColor nX+4,nY+5,FFFFFF,0
VBS num = 3
Goto 读到数字
EndIf
VBS num = -1
Rem 读到数字
Return 读数字 |