cant temporarily stop event observations
I'm trying to automate a game on facebook by setting an observe region. The game is quite simple. eggs drop from the top of the screen and all you have to do is catch them at the bottom of the screen. The glove that catches them its move by the mouse. All the eggs have the same shape and size but they all have different design patterns so I can't do a search for a particular egg since all of them are different and the design appears randomly. Plus there must be thousands of designs.
So here is what I did:
I set up a rectangular region across the screen close to the glove. I then set up an regionX.onchage event. Once an egg crosses that region the glove is put underneath it. This is not a perfect solution because you can get multiple hits so the glove tends to jump around but, its good enough. The problem is that once you collect 100 eggs a button at the bottom of the screen shows up. You need to click that button and navigate through some menus to collect some of the eggs and ignore others. Here is where I'm having problems. It seems that the regionX.onchange keeps running so I can't navigate through this menu. I need for the program to stop searching for changes completely until I exit the egg collection menu. Below is part of the code. I'm omiting the searches for other buttons since they are commented out (not being used for now) anyways.
runGame = True
regionX = Region(
regionA = Region(
regionB = Region(
#Set the observations
#define pertinent functions
#Move glove to collect the eggs
for ch in event.getChanges():
#get the rarest eggs
#Check if 100 eggs have been collected