程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Brush king gold coins with Python code

編輯:Python

principle

There is a challenge mode in the adventure mode of King glory , You can get more gold coins for the first time , If you challenge again later, you will still get a small amount of gold coins , This is not bug, Only if you don't mind manual brute force, you can also brush gold coins .

Recommended level : The fallen wasteland - Witch memories

This level uses pure output heroes 20 You can play... In about seconds BOSS,50 You can pass the customs in about seconds , You can get rewards every time you repeat customs clearance 19 Gold coin . I suggest you go through the customs manually before opening and hanging up . This is the principle of the game .

Simply speaking , The following steps are required :

  1. The interface opens to the challenge level : The fallen wasteland - Witch memories 【 Click next 】
  2. Enter the lineup adjustment interface , Arrange the lineup in advance .【 Click to break through 】
  3. Enter the challenge interface .【 Click on the top right corner - Automatically - Wait for the challenge to end 】
  4. Enter the challenge completion interface .【 Click on the screen to continue 】
  5. Enter the level reward interface .【 Click challenge again 】
  6. Enter the lineup adjustment interface , Cycle to step 1 Or steps 2【 It seems to depend on the game area and version 】

As long as you can simulate the screen and click, you can complete the script of brushing gold coins , The easiest way to click on the Android simulation interface is to use ADB dispatch orders , Unwanted root mobile phone , No need to install third party software , Convenient and quick .ADB Command click screen coordinates [x, y] You can use commands :

adb shell input tap x y

IOS Whether there are similar tools and commands , I don't know , If so, it's easy to automatically brush gold coins .

Get ready

  • This script is applicable to Android game area , Need a real Android phone .
  • The phone needs to be turned on USB Debug mode , Allow the computer to debug .
  • The computer needs to be installed with Android driver , Generally, pea pods or various housekeepers can automatically help you pack them .
  • Computers need to have ADB Toolset , There are many ways to get .
  • ADB Tools need to add environment variables PATH in , Easy to call at any time .
  • It needs to be installed on the computer Python, Because this is the script language I chose .

If it's just to brush gold coins , Just install the drive and ADB Just tools .

step

If everything is ready , Then the steps are very simple .

Environmental testing

  1. use USB Connect the phone , If a warning pops up , Please allow the computer to debug the mobile phone .
  2. Use command adb devices test adb And the phone status is ready .
$ adb devices
List of devices attached
b******4 device

Analog click screen , For example, you can open the drawing software , And then run the command :

adb shell input tap 500 500

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

Code implementation

The screen position that needs to be clicked for customs clearance is fixed , With notes, we just need less than 30 Line code can 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(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)

Then we write a main function to cycle the money .

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

then :

  1. Download... From the project kog.py To local .
  2. Open the game , Enter challenge mode , Witch memories , Lineup adjustment interface .
  3. According to the performance and resolution of the mobile phone , adjustment kog.py Parameters in .( Cell phone resolution , Number of times to brush gold, etc )
  4. Run the following command , You can view the real-time operation effect on the mobile phone .
python kog.py

Be careful :

  1. The maximum amount of gold coins per week 4200, Need to get close to 4 Hours , It is not recommended to brush all at once , Both your cell phone and you have to rest .
  2. Inscription , Mobile phone performance , The choice of heroes will affect the speed of customs clearance , Fine tune your waiting time .
  3. If you don't want to be USB Data line binding , Consider using a wireless connection Android Real machine

Statement

This script is purely an experience of entertainment and exploration , If you are banned for violating the rules of the game , I'm not responsible for .


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved