EndIf 
For lun
    Gosub 航海組合技
EndFor 
Goto 主程式開始
Rem 主程式結束
EndScript 
//副程式開始
Sub 副官換崗位
    Rem 等待崗位視窗打開
    //清除異常窗口
    Plugin Window.SendKeyPress(hwn,27)
    Delay 50
    //開啟副官視窗
    KeyPress 121 1
    Delay 1500
    IfColor 249 281 99c9e4 0
        Delay 500
        If a=0
            Goto 1號副官漂航海
        EndIf 
        Rem 1號副官換崗位
        KeyPress 40 1
        Delay 200
        Rem 1號副官漂航海
        MoveTo 350 120
        Delay 200
        LeftClick 1
        Delay 200
        If b=0
            Goto 2號副官漂航海
        EndIf 
        Rem 2號副官換崗位
        KeyPress 40 1
        Delay 200
        Rem 2號副官漂航海
        MoveTo 505 400
        Delay 200
        LeftClick 1
        Delay 200
        KeyPress 27 2
    Else 
        Delay 1000
        Goto 等待崗位視窗打開
    EndIf 
Return 副官換崗位
Sub 移動船
    MoveTo 400 moveY
    Delay 300
    LeftDoubleClick 1
    Delay 300
Return 
Sub 航海組合技
    Gosub 移動船
    Gosub 補行動力
    Gosub 遇難處理
    //    Gosub 移動船
    //  Gosub 偵測暴風
    //    Gosub 遇難處理
    Gosub 使用航海技能
Return 航海組合技
Sub 使用航海技能
    If Ft1=1
        Gosub 移動船
        //清除異常窗口
        KeyPress 27 1
        Delay 50
        // 技能1
        Gosub 開啟自定義欄
        //KeyPress 123 1
        //       Plugin Window.SendKeyPress(hwn,123)
        //Delay 500
        KeyPress 112 1
        //     Plugin Window.SendKeyPress(hwn,112)
        Delay 500
        Gosub 移動船
        //除錯用,關閉自定義欄
        KeyPress 122 1
        //       Plugin Window.SendKeyPress(hwn,122)
        Delay 500
        KeyPress 122 1
        //      Plugin Window.SendKeyPress(hwn,122)
        Delay 500
        Gosub 遇難處理
    EndIf 
    If Ft3=1
        Gosub 移動船
        //清除異常窗口
        KeyPress 27 1
        Delay 50
        // 技能3
        Gosub 開啟自定義欄
        //KeyPress 123 1
        //        Plugin Window.SendKeyPress(hwn,123)
        //Delay 500
        KeyPress 114 1
        //      Plugin Window.SendKeyPress(hwn,114)
        Delay 500
        Gosub 移動船
        //除錯用,關閉自定義欄