Key = 0
If GetItemAtXY(1345, 14, 8) = 548
	Key=Key+1
EndIf
If GetItemAtXY(1345, 14, 9) = 547
	Key=Key+1
EndIf
If GetItemAtXY(1345, 14, 10) = 548
	Key=Key+1
EndIf
If GetItemAtXY(1345, 15, 8) = 546
	Key=Key+1
EndIf
If GetItemAtXY(1345, 15, 9) = 547
	Key=Key+1
EndIf
If GetItemAtXY(1345, 15, 10) = 546
	Key=Key+1
EndIf
If GetItemAtXY(1345, 16, 8) = 547
	Key=Key+1
EndIf
If GetItemAtXY(1345, 16, 9) = 546
	Key=Key+1
EndIf
If GetItemAtXY(1345, 16, 10) = 548
	Key=Key+1
EndIf
If Key = 9
	OpenDoor(1345, 8, 4)
	OpenDoor(1345, 9, 4)
	OpenDoor(1345, 11, 4)
	OpenDoor(1345, 12, 4)
	OpenDoor(1345, 8, 5)
	OpenDoor(1345, 9, 5)
	OpenDoor(1345, 10, 5)
	OpenDoor(1345, 11, 5)
	OpenDoor(1345, 12, 5)
	OpenDoor(1345, 8, 6)
	OpenDoor(1345, 9, 6)
	OpenDoor(1345, 10, 6)
	OpenDoor(1345, 11, 6)
	OpenDoor(1345, 12, 6)
EndIf

Continue = 1