Python for King Glory coin script feature

Source: Internet
Author: User
Tags appium
King Glory a lot of friends want to buy scripts and hang like, want to more easily get gold coins and so on can buy heroes in the game, Python in our development is also very important, today to everyone is to write in Python language on the hand of the King glory Brush Coins of the script, Interested friends refer to the study under the hope to help everyone.

The King Glory Adventure Mode has a challenge mode, the first pass can get more gold coins, back to challenge or will get a small amount of gold, this is not a bug, only you do not wearies manual brute force can also brush gold.

Recommended levels: Fallen waste-witch memories

This level uses pure output hero 20 seconds or so can be played boss,50 seconds or so can customs clearance, each repeat clearance can be awarded 19 gold coins. It is recommended that you try a manual clearance before you open it. This is the game principle.

Simply put, you need to perform the following steps:

The interface opens to the challenge level: the Fallen scrap-witch memories "click Next"

Enter the lineup adjustment interface and arrange the lineup in advance. "Click through"

Enter the challenge screen. "Click on the top right corner-auto-wait for the challenge to end"

Enter the challenge completion screen. "Click on screen to continue"

Enter the level bonus screen. "Click to challenge Again"

Go to the lineup adjustment interface and cycle to step 1 or Step 2 "seemingly dependent on the game area and version"

As long as you can simulate the screen click to complete the brush coin script, in the Android simulation interface Click the simplest way is to use ADB to send commands, do not need root phone, do not need to install third-party software, convenient and fast. The ADB command taps the screen coordinates [x, y] to use the command:


ADB shell input tap x y

Whether IOS has similar tools and commands, I'm not sure if it's so easy to automate the coin-brush.

Get ready

This script is for the Android game area and requires a real Android phone.

The phone needs to turn on USB debug mode, allowing the computer to debug.

The computer needs to install the Android drive, the general pea pod or a variety of Butler can automatically help you to install.

The computer needs to have the ADB toolset, which can be obtained in many ways.

The ADB tool needs to be added to the environment variable path for easy invocation at any time.

I need to install Python on my computer, because this is the scripting language I chose.

Professional development Testers can also refer to my other two blog posts:

Build Appium + Android Automated test environment under Windows

Configuring the Appium+android Automated test environment on Mac OSX

If you just want to brush coins, just install the driver and ADB tools.

Steps

If everything is available, then the steps are very simple.

Environmental testing

Connect your phone with USB, and allow your computer to debug your phone if a warning pops up.

Use the command ADB devices to verify that the ADB and phone status are ready.


$ adb deviceslist of devices attachedb******4    device

Simulate tapping the screen, such as you can open the Paint software, and then run the command:


ADB shell input TAP 500 500

If everything is OK, then you will see that the drawing software has a point in the position of coordinates (500,500).

Code implementation

Clearance needs to click on the screen location is fixed, plus comments we only need less than 30 lines of code to complete.


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 (970)  sleep (3)  print (' #1 ready, GO!!! ')  Tap_screen (1450, 910)  sleep (  ' #2 Auto Power on! ')  Tap_screen (1780, max) for  i in range:    tap_screen (+)    sleep (1)  print (' #3 do it again...\n ' )  Tap_screen (1430, 980)  sleep (3)

Then we write a main function to cycle through the money.


if __name__ = = ' __main__ ': for  I in range (repeat_times):    print (' Round #{} '. Format (i + 1))    Do_money_work ( )

And then:

Download kog.py to local in the project.

Open the game, enter the challenge mode, witch memories, lineup adjustment interface.

Adjust the parameters in the kog.py based on the phone's performance and resolution. (Phone resolution, number of brushes, etc.)

Run the following command to see the live run effect on your phone.

Python kog.py

Attention:

The weekly gold limit of 4200, takes close to 4 hours, does not recommend a full brush, mobile phone and you have to rest.

Inscriptions, mobile phone performance, hero selection will affect the clearance speed, self-tuning wait time.

If you don't want to be tied to a USB cable, consider using a wireless connection to the Android real machine.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.