微信跳一跳輔助Demo,信跳輔助Demo

來源:互聯網
上載者:User

跳一跳輔助Demo,信跳輔助Demo

  [原創] 前幾天沒事幹看別人一直在玩上線的那一個跳一跳小遊戲,玩著玩著老是掉下去,閑著沒事唄

就想了想做一個輔助程式的唄.不過先做的手動版的.自動版的有點麻煩.就不發了.用的Java寫的,也就一個蒙版.

下面就開始介紹我的小程式,沒好多東西,真正的代碼應該就是100行左右,沒啥難的.

  下面這是我的朋友們的跳一跳

也就這樣吧,因為wechat還是有那個仿作弊系統的,所以還是低調的吧...

話不多說,還是下面奉上我的code吧,說多了墨跡呢....

  1 package com.rain.jump.util;  2   3 import java.awt.event.MouseAdapter;  4 import java.awt.event.MouseEvent;  5 import java.io.IOException;  6 import javax.swing.JFrame;  7 import javax.swing.JLabel;  8   9 /** 10  * @classname JumpOneJump.java 11  * @package com.rain.jump.util 12  * @project Jump 13  * @author Rain  14  * @describe 跳一跳項目 15  * @version 1.0 16  * @date 2018年1月13日 下午12:06:07 17  */ 18 public class JumpOneJump extends JFrame{ 19     /** 20      *  21      */ 22     private static final long serialVersionUID = 1L; 23     //定義兩點座標 24     int x0,y0,x1,y1; 25     //設定滑鼠點擊是第一次還是... 26     boolean flag=true; 27     public JumpOneJump() 28     { 29         super("跳一跳");//調父類的方法 30         this.setSize(316,565); 31         this.setUndecorated(true); 32         //設定視窗置中 33         this.setLocationRelativeTo(null); 34         this.setOpacity(0.3f); 35         this.setAlwaysOnTop(true); 36         this.setVisible(true); 37         this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 38          39  40         JLabel jLabel=new JLabel(); 41         this.add(jLabel); 42          43         //給jLabel添加一個監聽 44         this.addMouseListener(new MouseAdapter() { 45             //當你滑鼠點擊的時候 46             public void mouseClicked(MouseEvent e){ 47                 //參數 滑鼠的事件來源 48                 //System.out.println(e); 49                 if(e.getButton()==MouseEvent.BUTTON3) 50                 { 51                     //System.out.println("哈哈哈"); 52                      53                      54                     if(flag) 55                     { 56                         x0=e.getX();  57                         y0=e.getY(); 58                         flag=false; 59                         System.out.println("第一次點擊的座標是:("+x0+","+y0+")"); 60                     } 61                     else{ 62                         x1=e.getX(); 63                         y1=e.getY(); 64                         flag=true; 65                         System.out.println("第二次點擊的座標是:("+x1+","+y1+")"); 66                         //取絕對值 67                         double _x=Math.abs(x0-x1); 68                         double _y=Math.abs(y0-y1); 69                         //開平方(兩點的距離) 70                         double dis = Math.sqrt(_x*_x+_y*_y); 71                         System.out.println(dis); 72                         //定義adb命令 73 //                        String cmd="adb shell input touchscreen " 74 //                                +"swipe 200 187 200 187 "+Math.round(dis*3); 75                         String cmd="adb shell input swipe 320 410 320 410 "+Math.round(dis*5); 76                         Runtime run = Runtime.getRuntime(); 77                          78                         try { 79                             //執行命令 80                             Process p=run.exec(cmd); 81                             System.out.println(cmd); 82                             p.waitFor(); 83                         } catch (IOException e1) { 84                             // TODO Auto-generated catch block 85                             e1.printStackTrace(); 86                         } catch (InterruptedException e1) { 87                             // TODO Auto-generated catch block 88                             e1.printStackTrace(); 89                         } 90                          91                     }//end else 92                      93                 }//end if 94             }//end mouseClick() 95         }); 96          97     } 98      99     //程式的入口100     public static void main(String[] args) {101         102         103         104          new JumpOneJump();105     }106 107 }

不過這個輔助用法還是有講究的呢...要配套ADB工具, 

還要那個就是配套的那個能在電腦上面操作手機的協助工具輔助,類似TC的套件呀,

還有就是手機得開USB調試(這個在開發人員模式中有的),然後看下串連上了電腦沒,win+R鍵然後在輸入cmd進入命令列模式,然後adb devices看有沒有串連上手機.

還是不懂的下面評論,然後告知你的...謝謝大家 了

再附上片,剛剛跳的.

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.