The principle of

King of Glory adventure mode has a challenge mode, the first pass can get more gold, after the challenge or a small amount of gold, this is not a bug, only you don’t bother manual brute force can also brush gold.

Recommended level: Fallen Capital – Witch memories

This level uses the pure output hero to fight the BOSS in about 20 seconds, and can be completed in about 50 seconds. Each time you finish the level, you can get 19 gold coins. Before opening, I suggest you to experience manual customs clearance. This is how the game works.

In short, you need to perform the following steps:

  1. The interface opens to the challenge level: Fallen Wasteland – Witch Memories [Click Next]
  2. Enter the lineup adjustment interface and arrange the lineup in advance. [Click enter]
  3. The challenge screen is displayed. [Click on the upper right corner – Auto – Wait for the challenge to end]
  4. The challenge completion screen is displayed. [Click the screen to continue]
  5. Enter the level reward screen. [Click to challenge again]
  6. Go to the lineup adjustment screen and loop to step 1 or Step 2.

As long as you can simulate the screen click can complete the script of brushing gold coins, in android simulation interface click the most simple way is to use ADB to send commands, do not need root phone, do not need to install third-party software, convenient and fast. ADB command Click on screen coordinates [x, y] to use the command:

adb shell input tap x yCopy the code

I don’t know if IOS has similar tools and commands, but if it does, it’s easy to automatically swipe coins.

To prepare

  • This script is suitable for Android game area, requires a real Android phone.
  • USB debugging mode should be enabled for mobile phones to allow PC debugging.
  • The computer needs to install android drive, general pea pod or various butler can automatically help you install.
  • Your computer needs to have an ADB toolset, which is available in a number of ways.
  • ADB tools need to be added to the environment variable PATH for easy invocation.
  • Python needs to be installed on my computer, because that’s my scripting language of choice.

Professional development testers can also refer to my other two blogs:

  • Build Appium + Android automated test environment under Windows
  • Configure Appium+Android automated test environment on Mac OSX

If you just want to swipe gold, you just need to install the driver and ADB tools.

steps

If everything is right, the steps are simple.

Environmental testing

  1. Connect the phone with USB and allow the computer to debug the phone if a warning pops up.
  2. Using the commandadb devicesVerify adb and phone status are ready.
$ adb devices
List of devices attached
b******4        deviceCopy the code

Simulate clicking on the screen. For example, you can open the drawing software and run the following command:

adb shell input tap 500 500Copy the code

If all is well, then you will see that the drawing software has a point at coordinates (500,500).

Code implementation

The location of the screen to click through is fixed, and with comments we can do it in less than 30 lines of code.

def tap_screen(x, y): os.system('adb shell input tap {} {}'.format(x, y)) def do_money_work(): print('#0 start the game') tap_screen(1600, 970) sleep(3) print('#1 ready, go!!! ') tap_screen(1450, 910) sleep(15) print('#2 auto power on! ') tap_screen(1780, 40) for i in range(25): tap_screen(1000, 500) sleep(1) print('#3 do it again... \n') tap_screen(1430, 980) sleep(3)Copy the code

And then we write a pivot function to cycle through.

if __name__ == '__main__':
    for i in range(repeat_times):
        print('round #{}'.format(i + 1))
        do_money_work()Copy the code

si

If you like to use it, please visit the project address of this article:

  • Github.com/tobyqin/ko….

And then:

  1. Download projectkog.pyTo the local.
  2. Open the game, enter the challenge mode, witch recall, lineup adjustment interface.
  3. Adjust according to the phone’s performance and resolutionkog.pyParameter in. (Phone resolution, number of gold brushes, etc.)
  4. Run the following command to view the real-time operation effect on your mobile phone.
python kog.pyCopy the code

Note:

  1. Weekly gold coin upper limit 4200, need to be close to 4 hours, do not recommend a full brush, mobile phone and you have to rest.
  2. Inscriptions, phone performance, and hero selection all affect the speed of the game and the wait time.
  3. If you don’t want to be tethered to a USB cable, consider using a wireless connection to a real Android phone.

The statement

This script is purely for fun and exploration, I will not be responsible if you are banned for violating the rules of the game.

About the author: Python enthusiast, currently working on test development. Welcome to my blog
betacat.online, you can go to my public number when eating melon masses.