Skip to content

Instantly share code, notes, and snippets.

@codetalks-new
Created February 25, 2015 14:17
Show Gist options
  • Save codetalks-new/0eb138c4c9ef180b8cb5 to your computer and use it in GitHub Desktop.
Save codetalks-new/0eb138c4c9ef180b8cb5 to your computer and use it in GitHub Desktop.
Alipay 自动抢红包脚本
# -*- coding: utf-8 -*-
from time import sleep,time
# Imports the monkeyrunner modules used by this program
from com.android.monkeyrunner import MonkeyRunner,MonkeyDevice
# Connects to the current device, returning a MonkeyDevice object
print("Waiting for connect...")
device = MonkeyRunner.waitForConnection()
print("Connected")
while True:
start = time()
for x in xrange(32,700,64):
for y in xrange(128,1080,64):
device.touch(x,y,MonkeyDevice.DOWN_AND_UP)
if y > 128 and y % 192 == 0:
sleep(0.002)
#print("touch One ",x,y)
end = time()
print("Scan finished seconds used ",(end - start))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment