Created
August 29, 2014 15:04
-
-
Save maluta/b253f3d7e7d08325c25b to your computer and use it in GitHub Desktop.
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
#/usr/bin/python | |
''' | |
My best score in 'Swing Copters' was using this code... :/ | |
https://play.google.com/store/apps/details?id=com.dotgears.swing&hl=en | |
** Tested only on LG Nexus 4 ** | |
To run just copy this file and run on terminal | |
# monkeyrunner swing_copters.py | |
Follow me @maluta | |
''' | |
from com.android.monkeyrunner import MonkeyRunner | |
from com.android.monkeyrunner import MonkeyDevice | |
import time # sleep | |
try: | |
device = MonkeyRunner.waitForConnection() | |
except: | |
print("Verify your USB cable and check if ADB is working correctly") | |
exit() | |
t = 0.45 # I've tested with '0.3', '0.5' and '0' without good results | |
while True: | |
try: | |
device.touch( 240, 875, MonkeyDevice.DOWN) | |
device.touch( 240, 875, MonkeyDevice.UP) | |
except: | |
print("touch error") | |
exit() | |
time.sleep(t) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment