tempX = 0	
				ElseIf intX = x + 502 Then
					tempX = 1
				ElseIf intX = x + 532 Then
					tempX = 2
				ElseIf intX = x + 562 Then
					tempX = 3
				ElseIf intX = x + 592 Then
					tempX = 4
				ElseIf intX = x + 622 Then
					tempX = 5
				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
					Call getInMetris(mx,my)
					
					mx = mx + 30
					ux = ux + 1
				Wend					
			uy = uy + 1
			my = my + 30
	Wend
	Rem finish
		
End Function

// 放入大号材料 副职
 Function getInMetris(x,y)
	Delay 100
	MoveTo x, y
	Delay 300
	LeftClick 1
	Delay 300
	LeftClick 1
 	Delay 300
 	LeftClick 1
 	Delay 100
 End Function
 
 //买药
 Function buyMedicinal(i)
 Delay 100
 MoveTo 350, 460
 Delay 500
 LeftClick 1
 Delay 100
 If i = 0 Then 
 	Call buy(235,300,redHowMuch)
 	Call buy(355,300,blueHowMuch)
 ElseIf i = 1 Then
 	Call buy(265,300,redHowMuch)
 	Call buy(385,300,blueHowMuch)
 Else 
 	Call buy(295,300,redHowMuch)
 	Call buy(415,300,blueHowMuch)
 End If
 	
 End Function
 //购买
 Function buy(x, y, howMuch)
 	Delay 100
 	MoveTo x, y
 	Delay 500
 	For howMuch
 		LeftClick 1
 		Delay 500
 		LeftClick 1
 		Delay 500