FindColor 190,293,206,309,"CEFFFF",intX,intY
   If intX>0 Then
    Exit For
   Else
    Delay 100
   End If
  Next
        MoveTo 198,300
//      Delay 1000
        LeftClick 2
        Delay 200
        KeyPress "BackSpace", 15
        
        Dim 数字码,位数,n
        位数=Len(数字串)
        n=位数
        For 位数
            数字码=Asc(数字串)
            Delay 50
            KeyPress 数字码,1
            n=n-1
            数字串=Right(数字串,n)
        Endfor
        LeftClick 1
//        MoveTo 198,400
End Sub
  

Sub 检查是否有交易() 
IfColor 915,453,"FFFFFF",2 Then
     Delay200
     MoveTo 881, 544
     Delay 200
     LeftClick 2
Else
  Delay 500
     Goto s
End If
End Sub



Sub 检查是否正在交易
// Delay 500
// Call FindPic(81,107,316,135,"C:DNF图片\物品交易.bmp",0.6,intX,intY)
// If intX > 0 
FindColor 160,115,217,130,"FFFFFF",intX,intY
If intX > 0  Then
//  MessageBox("正在交易")
  Call 等待放入物品
//  Delay 100
Else
  Call 交易前喊收货()
End If
End Sub 


Sub 检查交易是否提前结束
// MessageBox("进来sum"&sum)
// Call FindPic(81,107,316,135,"C:\物品交易.bmp",0.6,intX,intY)
// If intX > 0 
FindColor 160,115,217,130,"FFFFFF",intX,intY
If intX > 0  Then
//  MessageBox("交易未结束,开始找图")
  sum=0
  flag=0
  For m=0 to 45
//   MessageBox("m="&m)
   Call 找图并传递图片(物品(m),单价(m),图片位置(m))
  Next
//  MessageBox(sum)
Else 
  Goto s
End If
End Sub 


Sub 等待交易
Delay 1000
For j=1 to 5
  Call FindPic (448,263,644,331,"C:DNF图片\交易公告.bmp",0.6,intX,intY) //扫描交易框
  If intX >0 Then
   Delay 200
   MoveTo 523,403
   LeftClick 2
   Delay 2000
   Goto s 
   Exit For
  Else
   Delay 200
  End If
Next 
Goto s
End Sub