The production process of WeChat "jump and jump" plug-in

The production process of WeChat "jump and jump" plug-in

Recently, WeChat has released a "jump and jump" mini game, which is quite popular, but for a handicapped person like me, when my little hand slips, the chess pieces don't know where to fly. Then I'm mad, the ranking list has to be pulled to the end to see my name. The handicap is definitely not something that can be solved in a day or two. Then write a hang and let the computer press the screen for me with millisecond accuracy. Wouldn't it be nice? .

0. V1.0 artificial intelligence plug-in

I have seen several "jump and jump" aids on the Internet in the past two days. Some people have made robot fingers. Before each jump, use a ruler to measure the distance between two squares, and then press the corresponding robot finger according to this distance. time, the pawn successfully jumped to the next square.

This method is actually quite interesting. Things like this kind of robot should be fun, but firstly, I don’t have the equipment, so I’m a bit of a loser when I buy it and use it once. Second, I don’t know much about this thing, but I feel There should be no way to be particularly accurate in time control. Thirdly, I have adb, what do I want the robot to do.

The full name of Adb is Android Debug Bridge, which is generally used by those who have done mobile development. After this and that *()@…)¥&%@! *% A series of operations, enter adb in cmd, and see the result shown in Figure 1, which means that adb can be used.

Figure 1 adb runs successfully

Then take out your Android phone, enter the developer mode (usually, just poke something like a version in about the phone), turn on USB debugging, connect to the computer, enter adb devices in cmd, and see the picture The result shown in 2, then the mobile phone and adb are connected.

Figure 2 The device is connected successfully

There are quite a lot of functional commands in Adb, because to play "jump a jump", you need to long press the screen and release it to realize the jump of the chess piece, so what we want to do here is to send a message to the mobile phone through adb that can control the long press time. The long press command, then enter input in the adb shell to see, you will see this result:

The sources are:

      keyboard

      mouse

     joystick

     touchnavigation

      touchpad

     trackball

      dpad

      stylus

      gamepad

      touchscreen

The commands anddefault sources are:

      text <string> (Default:touchscreen)

      keyevent [--longpress] <key codenumber or name> ... (Default: keyboard)

      tap <x> <y> (Default:touchscreen)

      swipe <x1> <y1> <x2><y2> [duration(ms)] (Default: touchscreen)

      press (Default: trackball)

      roll <dx> <dy> (Default: trackball)

What we need here is swipe <x1> <y1> <x2> <y2> [duration(ms)](Default: touchscreen), which uses x and y to control the position of the press, that is, the coordinates. In fact, swipe is a sliding command, but this command can set duration (ms), which is accurate to milliseconds to control the pressing time, so this sliding command is used here.

Adb can be used, and the command is known, so open "jump" and try it. After starting the game, enter input swipe100 100 100 100 300 in adbshell, which means swiping from the (100, 100) position to the (100, 100) position, which takes 300ms, and found that the chessmen really jumped out, but it seems that the bounce is similar to mine , jumped off a matchbox and fell. Obviously, the most critical parameter here is the long press time. After many experiments, the relationship between the press time and the jumping distance is probably:

T=distance(mm)*23(ms/mm)

This distance is measured by a ruler. I would like to thank me for the set of rulers when I was learning mechanical drawing. I have not kept them until today. I will continue to use them for my grandson in the future. After all, my grandfather gave me such a set of rulers when I was a child. The digital application of 23 varies from person to person. The screen size of each mobile phone is different. The relationship between the absolute distance and the parameters measured directly on the screen with a ruler must also be different. Generally it should be around 20.

It is difficult to jump to the center point of the next block with this method, because the distance measured by the ruler is not very accurate, and the coefficient of 23 is definitely not accurate, but this method can at least guarantee immortality, each time there is 1 point, If you encounter Manhole Cover Magic convenience store records, you can also add a point. If you have enough patience, you can get the first place in the chart.

However, this V1.0 version is too stupid, and it will make people laugh when you take it out. Therefore, the V2.0 version needs to be launched urgently, but when it comes, I will have dinner after uploading it to CSDN. I will write it next time.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325390920&siteId=291194637
Recommended