KeyPress 13 1
Delay 500
Delay 2000
IfColor 771 461 f0e191 0
Goto 查找城
EndIf
IfColor 771 438 f0e191 0
Goto 查找城
EndIf
IfColor 771 413 f0e191 0
Goto 查找城
EndIf
IfColor 771 389 f0e191 0
Goto 查找城
EndIf
//找到, 進入城市
Goto 結束查找城
EndFor
Rem 結束查找城
//再檢查是否進到碼頭
For 50
Delay 500
IfColor 663 369 ffffff 0
IfColor 650 365 ffffff 0
IfColor 635 366 ffffff 0
Goto 結束找城
EndIf
EndIf
EndIf
EndFor
Gosub 航行補正
Goto 查找城
Rem 結束找城
If Pd5=1
Gosub 重複喊話模組
EndIf
Return 進港
Sub 角度歸零
KeyDown 17 1
Delay 500
KeyDown 40 1
Delay 2500
KeyUp 40 1
Delay 500
KeyUp 17 1
Delay 500
Return
Sub 重複喊話模組
If Pd5=0
Goto 結束重複喊話模組
Else
KeyPress 32 1
Delay 500
For Pd5
KeyPress 38 1
Delay 500
EndFor
KeyPress 13 1
Delay 500
EndIf
Rem 結束重複喊話模組
Return 重複喊話模組
Sub 偵測暴風
Rem 偵測暴風開始
//清除異常窗口
Plugin Window.SendKeyPress(hwn,27)
Delay 50
VBSCall FindPic(746,597,780,624,"storm.bmp",0.8,x,y)
If x>=0 and y>=0
//停船
MoveTo 785 612
Delay 500
LeftClick 1
Delay 500
//持續偵測
Rem 持續偵測暴風
VBSCall FindPic(746,597,780,624,"storm.bmp",0.8,x,y)
If x>=0 and y>=0
//等候暴風
Delay 60000
Goto 持續偵測暴風
Else
//開船
MoveTo 786 572
Delay 500
LeftClick 1
Delay 500
EndIf
EndIf
Return 偵測暴風
//移動滑鼠到指定點以視窗為准參數ax,ay
Sub 移動滑鼠
Plugin winRect=Window.GetClientRect(hwn)
winPoint = Split(winRect, "|", -1, 1)
bx = CInt(winPoint(0)) + ax
by = CInt(winPoint(1)) + ay
MoveTo bx by
Delay 600
Return 移動滑鼠
Sub 尋找滑鼠