Delay 500
    Goto 主程式結束
Return 登出
Sub 補給出城
    Rem 等待補給按鈕出現
    Delay 500
    //2按鈕-補給鍵
    MoveTo 685 392
    Delay 500
    IfColor 685 392 8bdac9 0
        LeftClick 1
        Delay 500
    Else 
        Goto 等待補給按鈕出現
    EndIf 
    //補充到設定數量
    MoveTo 189 381
    Delay 500
    LeftClick 1
    Delay 500
    //確定補充
    MoveTo 606 423
    Delay 500
    LeftClick 1
    Delay 500
    //預防無需補充
    Plugin Window.SendKeyPress(hwn,27)
    Delay 500
    //出港鍵
    Rem 等待出港按鈕出現
    MoveTo 653 388
    Delay 500
    IfColor 653 388 ececec 0
        LeftClick 1
        Delay 500
    Else 
        Delay 500
        Goto 等待出港按鈕出現
    EndIf 
    Rem 等待出港確定鈕出現
    //確定出港
    MoveTo 645 417
    Delay 500
    IfColor 644 416 cde173 0
        LeftClick 1
        Delay 500
    Else 
        Delay 500
        Goto 等待出港確定鈕出現
    EndIf 
Return 補給出城
Sub 確認到港外
    //確認天數為0
    Rem 等待到港外
    Delay 500
    IfColor 27 53 ffffff 0
        IfColor 30 55 ffffff 0
            IfColor 27 56 ffffff 0
                IfColor 30 58 ffffff 0
                    Goto 到達港外
                EndIf 
            EndIf 
        EndIf 
    EndIf 
    Goto 等待到港外
    Rem 到達港外
    If Pd5=1
        Gosub 重複喊話模組
    EndIf 
Return 確認到港外
Sub 進港
    Rem 開始查找
    //清除異常窗口
    Plugin Window.SendKeyPress(hwn,27)
    Delay 50
    //停船
    MoveTo 789 612
    Delay 500
    LeftClick 1
    Delay 500
    KeyPress 46 2
    Delay 500
    //調整角度
    KeyDown 17 1
    Delay 500
    KeyDown 38 1
    Delay 1000
    KeyUp 38 1
    Delay 500
    KeyUp 17 1
    Delay 500
    //判斷、進入城市
    Rem 查找城
    Delay 500
    For 200
        //tab查找城
        KeyPress 9 1
        //確認所選非玩家
        KeyPress 13 1
        Delay 500