100 lines of java-written WeChat jump Helper Program, 100 lines of java

Source: Internet
Author: User

100 lines of java-written skip- programs, 100 lines of java

A few days ago, I had nothing to do to watch the one-hop little game that someone else had been playing online. I always fell down when I was playing the game and thought about a Helper Program. but the first manual version. the automatic version is a little troublesome. it will not be sent. it is written in Java.

Next I will introduce my small program. There are not many things, and the real code should be around 100 lines, which is not difficult.

Below is a hop from my friends.

That's it, Because wechat still has the cheating system, so we should keep a low profile...

If you don't talk much about it, let's look at my code below. If you have more ink, then ....

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: hop-on Project
* @ Version 1.0
* @ Date 12:06:07, January 1, January 13, 2018
*/
Public class JumpOneJump extends JFrame {
/**
*
*/
Private static final long serialVersionUID = 1L;
// Define two-point coordinates
Int x0, y0, x1, y1;
// Set whether the mouse is clicked for the first time or...
Boolean flag = true;
Public JumpOneJump ()
{
Super (""); // Method for calling the parent class
This. setSize (316,565 );
This. setUndecorated (true );
// Set the center of the window
This. setLocationRelativeTo (null );
This. setOpacity (0.3f );
This. setAlwaysOnTop (true );
This. setVisible (true );
This. setdefaclocloseoperation (JFrame. EXIT_ON_CLOSE );
JLabel jLabel = new JLabel ();
This. add (jLabel );
// Add a listener to the jLabel
This. addMouseListener (new MouseAdapter (){
// When you click
Public void mouseClicked (MouseEvent e ){
// Event source with parameter mouse
// 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 + ")");
// Obtain the absolute value
Double _ x = Math. abs (x0-x1 );
Double _ y = Math. abs (y0-y1 );
// Square (distance between two points)
Double dis = Math. sqrt (_ x * _ x + _ y * _ y );
System. out. println (dis );
// Define the 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.exe c (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 ()
});
}

// Program entry
Public static void main (String [] args ){
New JumpOneJump ();
}
}

However, we still have to pay attention to this auxiliary usage. we need to provide the ADB tool,

And that is the auxiliary tool supporting mobile phone operations on the computer, similar to the TC kit,

In addition, You Have To Enable USB debugging on the mobile phone (which is available in developer mode). Then, check whether the computer is connected. Press win + R and Enter cmd to enter the command line mode, then, check whether the device is connected to the mobile phone.

I still don't understand the following comments, and I will tell you... Thank you!

Attach the film, just jumped.

The above is all about the Skip JAVA script program. If you are still interested in the help of this game, refer to the help house

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.