Skip to content

Instantly share code, notes, and snippets.

@steverichey
Created August 8, 2016 01:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steverichey/238888e6e8c46a9b37d894f767fefaae to your computer and use it in GitHub Desktop.
Save steverichey/238888e6e8c46a9b37d894f767fefaae to your computer and use it in GitHub Desktop.
Automatic egg hatcher for Egg, Inc.
# Save as `egg.py`
# Run with `monkeyrunner egg.py`
# Must have Android SDK `tools` directory in your PATH
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice, MonkeyView
device = MonkeyRunner.waitForConnection()
# These will vary depending on your device!
x = 720
y = 2400
# These will vary depending on your hatchery refill rate, etc.
touch_duration = 22
untouch_duration = 15
while True:
device.touch(x, y, MonkeyDevice.DOWN)
MonkeyRunner.sleep(touch_duration)
device.touch(x, y, MonkeyDevice.UP)
MonkeyRunner.sleep(untouch_duration)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment