Yes, Python can make your king's glory gold coins explode!

Want to write a game auxiliary script (or plug-in?) For a long time. I've almost finished my work and exams these days. I'm free to write a script of brushing gold coins for the glory of the king for your reference.


principle

I think the script of the game should be similar. The process of playing the game is as follows:

When playing games with scripts, you can completely omit the intermediate steps:

So we just need to:

At a specific time, at a specific position, press the key.

Environment configuration

ADB tool (let computer use mobile phone)

Download address: https://adbshell.com/downloads/

If it's slow, it's better to find other resources

The download configuration will not be repeated.

Finally, a similar figure appears.

python and IDE

The following figure will not be repeated after downloading.

Many people learn python and don't know where to start.
After learning python and mastering the basic grammar, many people don't know where to find cases.
Many people who have done cases do not know how to learn more advanced knowledge.
So for these three types of people, I will provide you with a good learning platform, free video tutorials, e-books, and the source code of the course!
QQ group: 609616831

Steps to brush gold coins

1. The data line links the computer and enters the mobile developer mode (if not, Baidu can)

2. Start adb

Error 1: 5037 port is occupied. Just close the corresponding process

netstat -ano | findstr "5037"
taskkill /pid ((process number) -f

Error 2: the DLL is missing or does not enter the developer mode. Just move the DLL

Optional (0).Find Download adb Catalog, put adb.exe,AdbWinApi.dll put to C:\WINDOWS\System32 (lower)

1.Connect this machine C:\WINDOWS\System32 Lower adb.exe Copy files to C:\Windows\SysWOW64 Down.
 
2.Connect this machine C:\WINDOWS\System32 Lower AdbWinApi.dll Copy files to C:\Windows\SysWOW64 Down.

3. Open the glory of the king (if you are not a developer, you can turn to 5), cut a pile of pictures and view the pixels

You can see the pixels of Vientiane Tiangong (1755793). Click Vientiane Tiangong through the command adb shell input tap 1755 793.

The same applies to the following:

Pixels (211275)

Pixels (1231557)

Pixels (800567) (1393475) (1677675) (1791939)

Pixels (1697861)

Pixels (2175, 45)

Click auto (2117, 39)

(no drawing)

Wait 60s, skip (2175, 45)

(no figure)

Wait 10s and click the screen to continue (1000500)

Challenge again (20011011)

Just keep cycling.

4. The code is as follows:

# -*- coding: utf-8 -*-
# @Author  : daruida
# @Time    : 2021/1/8 15:38
import os
from time import sleep


#Click method
def click_screen(x, y):
    os.system('adb shell input tap {} {}'.format(x, y))


def repeat(zidong):
    print('Start the challenge')
    #Break through
    click_screen(1697, 861)
    sleep(10)

    #Skip
    print('Click skip')
    click_screen(2175, 45)
    sleep(1)

    #Automatic
    if zidong == 0:
        print('Click Auto')
        click_screen(2117, 39)
        zidong = 1

    #Finish
    sleep(60)
    print('It's over')

    #Skip
    click_screen(2175, 45)
    sleep(10)

    #Challenge complete
    print('Challenge complete\n\n')
    click_screen(1000, 500)
    sleep(1)

    #Challenge again
    print('Challenge again\n\n')
    click_screen(2001, 1011)
    sleep(1)
    repeat(zidong)

if __name__ == '__main__':
    zidong = 0
    print('Brush gold coin initialization....')
    click_screen(1755, 793)  #Vientiane heavenly palace
    sleep(1)
    click_screen(211, 275)   #Adventure play
    sleep(1)
    click_screen(1231, 557)  #Challenge
    sleep(2)
    print('Tongtian tower\n')
    click_screen(1393, 475)  #Tongtian tower
    sleep(1)
    click_screen(1677, 675)  #Master level
    sleep(1)
    click_screen(1791, 939)  #Next step
    print('Brush gold coin repetition stage...')
    repeat(zidong)

Of course... If the mobile phone network speed is fast, or the call speed is fast, you can shorten the sleep time

5. Encapsulated as exe

pyinstaller -F xxxx.py

6. After linking the mobile phone, open the king initialization interface and run exe

(if there is an error, just run it again.)

test

My combination: Sun CE + crazy iron + Xiao Jin

Automatically finish typing in 1min... 1000 + gold coins in 1h

Of course, if other groups play for too long, you can discuss with me that they may make mistakes

Isn't it beautiful to brush gold coins while sleeping, or to brush gold coins while watching station B~

Here I would like to recommend my own Python learning group: 609616831. All of them are learning python. If you want to learn or are learning python, you are welcome to join. Everyone is a software development party and shares dry goods from time to time (only related to Python software development), including a copy of the latest Python advanced materials and zero basic teaching in 2020 compiled by myself. Welcome to join us!

Tags: Python Programming Programmer

Posted by vidhu on Sat, 16 Apr 2022 05:02:14 +0930