Rem [出售完毕]
    Gosub [出售取消]
    Sale = Sale +1
    Saled = 1
    Full =0
Return 出售物品
Sub [出售取消]
    MoveTo 627 292
    Delay 100
    LeftClick 1
    Delay 100
    IfColor 495 30 739aad 0
        Gosub [出售取消]
    EndIf 
Return 出售取消
Sub [取消国战]
    IfColor 758 430 0 0
        MoveTo 400 400
        Delay 200
        LeftClick 2
        Delay 300
    EndIf 
Return [取消国战]
Sub [说话]
    SayString Mystring
    Delay 50
    KeyPress 13 1
    Delay 50
Return [说话]
Sub [等待按键]
    WaitKey Key
    KeyPress 13 1
    Delay 50
Return [等待按键]
Sub [取得数字]
    Numb = ""
    WaitKey Key
    While Key <> 13
        If Key >= 48 and Key <= 57
            Numb = Numb & Chr(Key)
        ElseIf Key = 8
            Numb = Left(Numb,Len(Numb)-1)
        EndIf 
        WaitKey Key
    EndWhile 
    If Numb = ""
        Numb = 0
    Else 
        Numb = CLng(Numb)
    EndIf 
Return [取得数字]
Sub [选择商店]
    If StoreList = ""
        Gosub [读取商店列表]
    EndIf 
    Mystring = "│[选择商店]" & vblf
    Mystring = Mystring & "├───────" & vblf
    Mystring = Mystring & StoreList
    Gosub [说话]
    Gosub [等待按键]
    While StoreCount < CInt("&H" & Chr(Key))
        Gosub [等待按键]
    EndWhile 
    If StoreNum <> Chr(Key)
        Gosub [清空材料列表]
        StoreNum = Chr(Key)
        Plugin StoreName =File.ReadINI("商店",StoreNum,IniFile)
        Gosub [读取商店材料列表]
    EndIf 
    Mystring= "选择["& Chr(Key) & "][" & StoreName & "]..."
    Gosub [说话]
Return [选择商店]
Sub [材料列表]
    I = 0
    Mystring = "│[材料列表] -<S>[" & StoreName & "]" & vblf
    Mystring = Mystring & "├───────────" & vblf
    If BuyItemCount >0
        For BuyItemCount
            Mystring = Mystring & "│<" & I+1 & ">" & Mid(BuyItem(I),6) & String(12-2*Len(Mid(BuyItem(I),6))," ") &"..[" & BuyItem_Amount(I) & "]个" & vblf
            I = I + 1
        EndFor 
    Else 
        Mystring = Mystring & "│<空>" & vblf
    EndIf 
    Mystring = Mystring & "├───────────" & vblf
    Mystring = Mystring & "│<Y>确定 "
    If BuyItemCount < 4
        Mystring = Mystring & "<T>添加 "
    EndIf 
    Mystring = Mystring & "<D>清空" & vblf
    Gosub [说话]
    Gosub [等待按键]
    While (Key <49 Or Key > Asc(BuyItemCount)) And Key <>68 And Key <>83 And Key <>84 And Key <>89
        Gosub [等待按键]
    EndWhile 
    If Key >=49 and Key <= Asc(BuyItemCount)
        I= Chr(Key)-1
        Mystring = "选择材料[" & I+1 & "]..."
        Gosub [说话]
        Gosub [材料操作]