A few days ago, I had nothing to do and saw that others had been playing the jump game online on WeChat. I kept falling down while playing. When I was idle, I thought about making an auxiliary program. However, I made a manual version and automatic version first. I didn’t send it. I just wrote it in Java, which is just a mask.
Let’s start introducing my mini program. There are not many things, the real code should be about 100 lines, and there is nothing difficult.
Here is my WeChat friends' jump
That's it, because wechat still has the imitation cheating system, so it's better to be low-key...
Without further ado, let’s present my code below. I’ve talked too much about the ink...
package com.rain.jump.util;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.IOException;
import javax.swing.JFrame;
import javax.swing.JLabel;
/**
* @classname JumpOneJump.java
* @package com.rain.jump.util
* @project Jump
* @author Rain
* @describe WeChat jump project
* @version 1.0
* @date January 13, 2018 at 12:06:07 pm
*/
public class JumpOneJump extends JFrame{
/**
*
*/
private static final long serialVersionUID = 1L;
//Define the coordinates of two points
int x0,y0,x1,y1;
//Set if the mouse click is the first time or...
boolean flag=true;
public JumpOneJump()
{
super("WeChat jump");// Method to tune the parent class
this.setSize(316,565);
this.setUndecorated(true);
//Center the window
this.setLocationRelativeTo(null);
this.setOpacity(0.3f);
this.setAlwaysOnTop(true);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel jLabel=new JLabel();
this.add(jLabel);
//Add a listener to jLabel
this.addMouseListener(new MouseAdapter() {
//When your mouse clicks
public void mouseClicked(MouseEvent e){
//Standard mouse event source
//System.out.println(e);
if(e.getButton()==MouseEvent.BUTTON3)
{
//System.out.println("Hahaha");
if(flag)
{
x0=e.getX();
y0=e.getY();
flag=false;
System.out.println("The coordinates of the first click are: ("+x0+","+y0+")");
}
else{
x1=e.getX();
y1=e.getY();
flag=true;
System.out.println("The coordinates of the second click are: ("+x1+","+y1+")");
//Get the absolute value
double _x=Math.abs(x0-x1);
double _y=Math.abs(y0-y1);
//Open square (distance between two points)
double dis = Math.sqrt(_x*_x+_y*_y);
System.out.println(dis);
//Define adb command
// String cmd="adb shell input touchscreen"
// +"swipe 200 187 200 187 "+Math.round(dis*3);
String cmd="adb shell input swipe 320 410 320 410 "+Math.round(dis*5);
Runtime run = Runtime.getRuntime();
try {
//Execute the command
Process p=run.exec(cmd);
System.out.println(cmd);
p.waitFor();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}//end else
}//end if
}//end mouseClick()
});
}
//The entry of the program
public static void main(String[] args) {
new JumpOneJump();
}
}
However, this auxiliary usage is still of particular importance... It is necessary to provide ADB tools.
I also need the auxiliary tool that can operate mobile phones on computers, similar to TC's kit,
Also, the phone needs to be turned on and debugged (this is available in the developer mode), then check if it is connected to the computer, win+R keys and enter cmd to enter command line mode, and then adb devices to see if it is connected to the phone.
I still don't understand the following comments, and then I'll tell you... Thank you everyone
Attach the picture, I just jumped.
The above is all about the WeChat JAVA script program. If you are still interested in assisting this mini game, you can refer to Wulin.com for more relevant technical articles about WeChat JAVA.com. Thank you for your support for Wulin.com.