Created
August 8, 2016 01:44
-
-
Save steverichey/238888e6e8c46a9b37d894f767fefaae to your computer and use it in GitHub Desktop.
Automatic egg hatcher for Egg, Inc.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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