 	}
 	StrPos := StrPos + 1	
 }
+while CurrentStk > 1 {
+	PopStk()
+}
+
+
+
 Return

	MsgBox Place your mouse over the top-left corner of the 12*3 craftingfield and press ENTER 
		MouseGetPos, TLCX, TLCY
		PGScript := RegExReplace(PGScript, "TopLeftCornerX := [0-9]+", "TopLeftCornerX := " TLCX, , 1)  
		PGScript := RegExReplace(PGScript, "TopLeftCornerY := [0-9]+ ", "TopLeftCornerY := " TLCY, , 1)  	
	MsgBox Place your mouse over the bottom-right corner of the 12*3 craftingfield and press ENTER
		MouseGetPos, BRCX, BRCY
		PGScript := RegExReplace(PGScript, "BottomRightCornerX := [0-9]+ ", "BottomRightCornerX := "BRCX, , 1)  
		PGScript := RegExReplace(PGScript, "BottomRightCornerY := [0-9]+ ", "BottomRightCornerY := "BRCY, , 1)
		PGScript := RegExReplace(PGScript, "InitialMode := True  `; Init", "InitialMode := False `; Init", , 1)
	FileAppend, %PGScript%, Parent2Gem.ahk
	

CombineMode := True
LastGemPos := 1

TopLeftCornerX := 1590 				;  ####### ENTER THE COORDINATES OF THE 3*12 CRAFTINGFIELD ON YOUR SCREEN #########
TopLeftCornerY := 338				;	###### If you don't know how to obtain those values, you'd better  ########
BottomRightCornerX := 1436			;    ##### ask somebody. They don't have to be really precise.     #######
BottomRightCornerY := 686			;	  #### AND THAT'S IT! The script should work for you now!  ######
