principle:Because every time through the adventure model will have gold coins, and this action is very repetitive, even image recognition does not need to consider the use of procedures to replace artificial.
to put it simply, repeat the following steps:Interface open to challenge level: The fall of waste are-the witch recalls "click Next" click to start entry into the challenge interface. "Click on the top right-hand corner-auto-wait for the challenge to finish" to enter the challenge completion interface. "Click on the screen to continue" into the level reward interface. "Click again to challenge" again we need a program to replace our hand-click, you can think of using the ADB tool in the Android SDK, to send a clicking command to the phone.
ADB shell input tap x y
This is the command, if executed in the cmd command line
ADB shell input TAP 500 500
Will be in the mobile phone 500,500 position simulation click.
Environment Preparation:
download Android's platform-tools:
http://www.androiddevtools.cn/
Visit this URL to find here
After downloading your operating system, unzip it.
then configure the environment variables:
At the end of path plus the directory you extracted just now, D:\platform-tools is the directory I just unzipped. With the preceding string to be in English semicolon;
Code:Open the IDE to paste the following code:
#-*-Coding:utf-8-*-
import os from time
import sleep
repeat_times =
def tap_screen (x, y):
os.s Ystem (' adb shell input Tap {} {} '. format (x, y))
if __name__ = = ' __main__ ': for
I in range (repeat_times):
if (i > 0:
tap_screen (2489, 1307) # Challenge Print Again (
"Challenge start Again") Sleep
(5)
Tap_screen (2155, 1218) #闯关
print (Start through) sleep (
2764, tap_screen) #自动
print ("Auto button click")
TAP_ Screen (500,500) #点击屏幕继续
print ("Click to continue") Sleep
(5)
Tap_screen (2489, 1307) # Challenge Sleep again
(1)
Print (i)
Os.system's effect is the same as your command in CMD. Because now the strange proportion of mobile phones in endlessly, I use the 18.5:9 of Samsung S8, so all the coordinates are written dead, can be based on their own mobile phone to modify the above various coordinates and dormant time. Opening the display pointer position in the phone's developer mode will display the coordinates of the area you are currently touching.