ElseIf intX = x + 652 Then
					tempX = 6
				ElseIf intX = x + 682 Then
					tempX = 7	
				Else
					tempX = 0
				End If
    				
			
				If intY = y + 305 
    				tempY = 0	
				ElseIf intY = y + 335
    				tempY = 1
    			ElseIf intY = y + 365
    				tempY = 2
    			ElseIf intY = y + 395
    				tempY = 3
				Else
    				tempY = 0
    			End If
	End If
	
	If tempX = 0 and tempY = 0 Then 
		Goto finish
	End If
	
	While uy <= tempY
			mx = x + 485
			ux = 0
			If uy < tempY Then 
				tempS = 8
			Else 
				tempS=tempX
			End If
				While ux < tempS
					If flag = "big" Then 
						Call getInMetris(mx,my)
					Else 
						Call moveSmallMetris(mx,my)
					End If
					
					mx = mx + 30
					ux = ux + 1
				Wend					
			uy = uy + 1
			my = my + 30
	Wend
	Rem finish
		
End Function


 /*
 	*@Fun   search every  region
 **/ 
 Function moveMouseAndClick(x, y)
 	Delay 100
 	MoveTo x,y
 	Delay 500
 	LeftClick 1
 	Delay 100
 End Function
 
 
 // 放入大号材料 副职
 
 Function getInMetris(x,y)
	Delay 100
	MoveTo x, y
	Delay 100
	LeftClick 1
	Delay 100
	LeftClick 1
 	Delay 100
 End Function


/*  
 *@Fun  取出材料
 *@arg1 start x 
 *@arg1 start y	 
 *@retun null
 **/
Function getOutMetris()
	Dim intX, intY
	Dim intX1, intY1
	Dim intX2, intY2
	Dim intX3, intY3
	//取出
	Delay 100
	FindPic 240, 370, 440, 500, "Attachment:\取出.bmp", 1.0, intxT, intyT
	//TracePrint intT &" " & intT
	Delay 100
 	Call moveMouseAndClick(intxT+3, intyT+4)
 	Delay 100
	FindPic 190, 140, 435, 380, "Attachment:\无色小金块.bmp", 0.8, intX, intY
	Delay 100
	FindPic 190, 140, 435, 380, "Attachment:\黑色小金块.bmp", 0.8, intX1, intY1
	Delay 100
	FindPic 190, 140, 435, 380, "Attachment:\炉岩炭.bmp", 0.8, intX2, intY2