Java Wechat Jump Operation Guide、選択した場所を指し示します。
この記事のアイデアは、ADBを介して携帯電話の操作を制御し、JFRAMEを作成してJavaを介して携帯電話の画面をカバーし、マウスを使用してジャンプの出発点とエンドポイントを取得し、ジャンプの距離とプレス時間(線形関係)の間の関係(線形関係)を取得し、ADBを使用して、断片的な結果に応じてプレスされた結果に応じて、ADBを使用することです。コンピューターの画面上のJFrameを上書きします)。
次のように、コードは非常に短いです。
パッケージジャンプ; java.awt.flowlayout; Import java.awt.event.mouseadapter; Import java.awt.event.mouseevent; Import javax.swing.jframe; Import javax.swing.jlabel; @suppresswarnings( "Serial")Public Class Jumpjump Extends Jlabel j {private Jlabel;ブールフラグ= false; int x0、y0、x1、y1; public jumpjump(){super( "wechatジャンプ"); //新しいウィンドウを作成this.setundecorated(true); this.setopacity(0.7f); this.setsize(320,580); // this.setVisible(true); // visible // this.dispose(); this.setLocationRelativeto(null); this.tofront(); this.setlayout(new flowlayout(flowlayout.center)); this.setDefaultCloseoperation(jframe.exit_on_close); Jlabel label = new Jlabel( "右クリック"); this.add(label); this.addmouseListener(new Mouseadapter(){public void mouseclicked(mousevent e){if(e.getbutton()== mouseevent.button3){// 3は右クリックif(!flag){x0 = e.getx(); y0 = e.gety(); + " + y0; settext(dis)*false cmd = " (例外e1){e1.printstacktrace()out.println(e1)}}}}}}}}}}}}}}}}} } public static void main(string [] args){new JumpJump(); }}次のコードは透明性を設定します:
this.setundecorated(true); this.setopacity(0.7f);
X0 Y0は、マウスが初めてクリックするポイントの座標であり、X1 Y1は2番目の座標です。最初のクリックであろうと2回目のクリックであろうと、フラグによって決定されます。
この段落は、CMD操作を制御するためのコードであるため、毎回CMDで入力する必要はありません。
string cmd = "adbシェル入力タッチスクリーンスワイプ170 187 170 187"+math.round(dis*4.6); Runtime run = runtime.getRuntime(); try {process pr = run.exec(cmd); System.out.println(cmd); pr.waitfor(); } catch(例外E1){e1.printstacktrace(); System.out.println(e1); }ここでの係数は、継続的なテストを通じて自分で調整する必要があります。つまり、最後の係数4.6は単独で調整できます。
string cmd = "adbシェル入力タッチスクリーンスワイプ170 187 170 187"+math.round(dis*4.6);
操作方法は非常に簡単です。チェスピースの現在の位置を一度右クリックしてから、着陸位置をもう一度右クリックします。
その他のコンテンツについては、特別なトピック「Jump on Wechat」を参照して学習できます。
上記はこの記事のすべての内容です。みんなの学習に役立つことを願っています。誰もがwulin.comをもっとサポートすることを願っています。