前幾天沒事干看別人一直在玩微信上線的那一個跳一跳小游戲,玩著玩著老是掉下去,閑著沒事唄就想了想做一個輔助程序的唄.不過先做的手動版的.自動版的有點麻煩.就不發了.用的Java寫的,也就一個蒙版.
下面就開始介紹我的小程序,沒好多東西,真正的代碼應該就是100行左右,沒啥難的.
下面這是我的微信朋友們的跳一跳
也就這樣吧,因為wechat還是有那個仿作弊系統的,所以還是低調的吧...
話不多說,還是下面奉上我的code吧,說多了墨跡呢....
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 微信跳一跳項目 * @version 1.0 * @date 2018年1月13日 下午12:06:07 */ public class JumpOneJump extends JFrame{ /** * */ private static final long serialVersionUID = 1L; //定義兩點坐標 int x0,y0,x1,y1; //設置鼠標點擊是第一次還是... boolean flag=true; public JumpOneJump() { super("微信跳一跳");//調父類的方法 this.setSize(316,565); this.setUndecorated(true); //設置窗口居中 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); //給jLabel添加一個監聽 this.addMouseListener(new MouseAdapter() { //當你鼠標點擊的時候 public void mouseClicked(MouseEvent e){ //參數 鼠標的事件源 //System.out.println(e); if(e.getButton()==MouseEvent.BUTTON3) { //System.out.println("哈哈哈"); if(flag) { x0=e.getX(); y0=e.getY(); flag=false; System.out.println("第一次點擊的坐標是:("+x0+","+y0+")"); } else{ x1=e.getX(); y1=e.getY(); flag=true; System.out.println("第二次點擊的坐標是:("+x1+","+y1+")"); //取絕對值 double _x=Math.abs(x0-x1); double _y=Math.abs(y0-y1); //開平方(兩點的距離) double dis = Math.sqrt(_x*_x+_y*_y); System.out.println(dis); //定義adb命令 // 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 { //執行命令 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() }); } //程序的入口 public static void main(String[] args) { new JumpOneJump(); } }
不過這個輔助用法還是有講究的呢...要配套ADB工具,
還要那個就是配套的那個能在電腦上面操作手機的輔助工具,類似TC的套件呀,
還有就是手機得開USB調試(這個在開發者模式中有的),然后看下連接上了電腦沒,win+R鍵然后在輸入cmd進入命令行模式,然后adb devices看有沒有連接上手機.
還是不懂的下面評論,然后告知你的...謝謝大家 了
再附上下圖片,剛剛跳的.
以上就是本次關于微信跳一跳JAVA腳本程序的全部內容,如果你還對這個小游戲的輔助有興趣,可以參閱VeVb武林網更多關于微信跳一跳的相關技術文章,感謝你對VeVb武林網的支持。
新聞熱點
疑難解答
圖片精選