WOW World of Warcraft Automatic Lander

xiaoxiao2021-04-09  427

A few days ago, crazy in the World of Warcraft, for it, but 9C's 5th district, let the players are depressed, guarding the sword queue 800 every day, still keeps the card machine, dropped the line, I am working every day, every day Going home at 6 o'clock in the evening, I have 8 o'clock on the line, MC, black e ah, AQL, etc., very depressed!

In order to play games on time, in order to carry out the principle of Warcraft, decide to develop a World of Warcraft automated lander to solve the urgent need, haha!

First define a class ViaStruct, used to store the path, wait time, and username, password!

using System; using System.Collections.Generic; using System.Text; using System.IO; using System.Windows.Forms; using System.Threading; using System.Diagnostics; namespace KeyBoardInput {[Serializable] public class ViaStruct {private string timer = ""; private string filepath = ""; private string username = ""; private string pwd = ""; private string timer2 = ""; public bool SuccessFlag = false; public ViaStruct () {SuccessFlag = ReadFormKBI ();}

#region attribute public string Timer {get {return timer;} set {timer = value;}} public string FilePath {get {return filepath;} set {filepath = value;}} public string UserName {get {return username;} set {username = value;}} public string pwd {get {rary pwd;}} public string timer2 {get {return Timer2;} set {timer2 = value;}} #ENDREGON

Private bool readformkbi () {streamreader sr = new streamreader ("info.txt"); if ((this.filepath = sr.readline ()) == null || this.filepath == "") {Return False;} this.timer = sr.readline (); this.timer2 = sr.readline (); this.username = sr.readline (); this.pwd = sr.readline (); sr.close (); sr.dispose ); Gc.collect (); return true;} public void WriteTokbi () {thread th = new thread (New ThreadStart (NewMethod)); th.start ();

Private vid newmethod () {Try {streamwriter sw = new streamwriter ("info.txt"); sw.writeline (this.filepath); sw.flush (); sw.writeline (this.timer); sw.flush () SW.WRITELINE (this.timer2); sw.flush (); sw.flush (); sw.writeline (this.PWD); sw.flush (); sw.close );

Messagebox.show ("written success!");} Catch (exception ex) {messagebox.show (ex. measureage);}}}}

Then write the Form1 window

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Diagnostics; using System.Threading;

Namespace Keyboardinput {

public partial class Form1: {ViaStruct via Form; Thread th; Thread ti; public Form1 () {InitializeComponent (); via = new ViaStruct ();} private void Form1_Load (object sender, EventArgs e) {this.textBox1.Text = via.username; this.textBox2.text = via.pwd; this.textbox3.text = via.filepath; this.textBox4.text = via.timer2; this.comboBOX1.Text = via.timer; th = new thread (new Thread ThreadStart (newMethod); th.start ();

Private void newmethod () {if (via.successflag) {TRY {thread.sleep (convert.Toint32 (Convert.TOINT32 (via.timal * 60 * 1000)))); // Waiting // VIA after the start .Timer time launched process.start (via.filepath); thread.Sleep (Convert.TOINT32 (Convert.TIMER2) * 60 * 1000)))))); // After the program is launched, Wait // VIA. Timer2 Time Enter Username Password} Catch (Exception EX) {IF (ex.gettype (). TOSTRING ()! = "System.threading.ThreadAbortexception") MessageBox.show (ex.Message "1");}}} via.successflag) {MySendKeys ();}} private void button1_Click (object sender, EventArgs e) {this.openFileDialog1.RestoreDirectory = true; if (this.openFileDialog1.ShowDialog () == DialogResult.OK) {this.textBox3.Text = this. OpenfileDialog1.filename;} // messagebox.show (Environment.currentDirectory);

Private void form1_minimumsizechanged (object sender, eventargs e) {this.visible = false;}

Private void mysendKeys () // Enter the username password {ForeArarararRay ()) {sendKeys.sendwait (ArrayValue.Tostring ()); thread.sleep (10);} sendKeys.sendwait (" {Tab} "); foreach (char Arrayvalue in via.pwd.tochararray ()) {sendKeys.sendwait (ArrayValue.Tostring ()); thread.sleep (10);} sendkeys.sendwait (" {enter} "); } Private void button2_click (object sender, eventargs e) // assigns VIA object {via.timer = this.combobox1.text; via.timer2 = this.textbox4.text; via.filepath = this.TextBox3.Text; VIA. Username = this.textBox1.text; via.pwd = this.textbox2.text; via.writtokbi ();

private void Form1_FormClosing (object sender, FormClosingEventArgs e) // thread after closing the window Release {if (th.ThreadState = System.Threading.ThreadState.Aborted!) th.Abort ();! if (ti = null && ti.ThreadState = System! .Threading.threadstate.aborted) Ti.abort ();

Private void Button3_Click (Object Sender, Eventargs E) {th.abort (); Ti = New Thread (New ThreadStart (); Ti.Start ();

Private void programimmediately () {if (via.successflag) {Try {process.start (via.filepath); thread.sleep (convert.Toint32 ((convert.todecimal (via.timal2) * 60 * 1000)));} Catch (Exception EX) {//messagebox.show(). Tostring ()); if (ex.gettype (). Tostring ()! = "System.threading.ThreadAbortext") MessageBox.show (EX. Message "1");}}}}}} {mysendKeys ();}}}}

Cut the shortcut to the process to copy in the boot, let it become a boot self-starter

The program is successful under the VS2005 WinXP system!

limitation:

1. Require the motherboard BIOS to support automatic boot;

2. The computer is connected to the Internet after booting;

3. Need support for .NET Framework2.0

转载请注明原文地址:https://www.9cbs.com/read-133112.html

New Post(0)