之前帮朋友写的一个小工具-征途2新浪卡全自动淘号工具+按钮精灵脚本
生活随笔
收集整理的這篇文章主要介紹了
之前帮朋友写的一个小工具-征途2新浪卡全自动淘号工具+按钮精灵脚本
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?
比較簡單的小工具
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Net; using System.Text.RegularExpressions; using System.IO;namespace Zt2SinaTaoKaTool {public partial class MainForm : Form{public MainForm(){InitializeComponent();}private int ka_ren_count = 10;private WebClient client = null;private StreamWriter sw = new StreamWriter("ka.txt", true);private void button1_Click(object sender, EventArgs e){button1.Enabled = false;button2.Enabled = true;textBox1.Enabled = false;try{ka_ren_count = Int32.Parse(textBox1.Text);}catch (Exception){ka_ren_count = 10;}//開始任務if (client == null){client = new WebClient();}else{if (client.IsBusy){client.Dispose();}client = new WebClient();}client.OpenReadCompleted += new OpenReadCompletedEventHandler(client_OpenReadCompleted);// Add a user agent header in case the // requested URI contains a query. client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");timer1.Start();}private int tao_count = 0;void client_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e){MainForm pThis = sender as MainForm;if (e.Result != null){using (e.Result){StreamReader reader = new StreamReader(e.Result);string s = reader.ReadToEnd();reader.Close();Regex reg = new Regex(@"本組卡號已經被[\d]{0,4}人淘過");Match match = reg.Match(s);if (match.Success){string value = match.Value;string int_value = value.Replace("本組卡號已經被", "").Replace("人淘過", "").Trim();if (int_value != ""){int ren = Convert.ToInt32(int_value);if (ren <= ka_ren_count){Regex reg_ka = new Regex("(.){5}-(.){5}-(.){5}-(.){5}");MatchCollection ka_matchs = reg_ka.Matches(s);if (ka_matchs.Count > 0){StreamWriter sw_single = new StreamWriter(string.Format("ka_{0}_{1}.txt", DateTime.Now.Ticks, int_value), true);string _tempLastKa = "";foreach (Match item in ka_matchs){string _ka = item.Value;if (_tempLastKa == _ka){continue;}_tempLastKa = _ka;sw.WriteLine(_ka);sw.Flush();sw_single.WriteLine(_ka);listBox1.Items.Add(_ka);}sw_single.Close();}}}}else{MessageBox.Show("網絡請求出錯了,重新打開試試!");}}tao_count++;label2.Text = tao_count.ToString();}}private void button2_Click(object sender, EventArgs e){timer1.Stop();client.OpenReadCompleted -= client_OpenReadCompleted;button1.Enabled = true;button2.Enabled = false;textBox1.Enabled = true;}private int timer_count = 0;private void timer1_Tick(object sender, EventArgs e){timer_count++;label4.Text = timer_count.ToString();if (timer_count >= 20){timer_count = 0;try{client.OpenReadAsync(new Uri("http://ka.sina.com.cn/index.php/request/pickNum/gid/722/itemId/3843/1371195204095"), this);}catch (Exception){MessageBox.Show("網絡異常,關了重試!");}}}private void listBox1_SelectedIndexChanged(object sender, EventArgs e){//System.Collections.Specialized.StringCollection s = new System.Collections.Specialized.StringCollection();//MessageBox.Show(listBox1.SelectedItem as string);//s.Add(listBox1.SelectedItem as string);Clipboard.SetDataObject(listBox1.SelectedItem as string);}private void MainForm_FormClosed(object sender, FormClosedEventArgs e){sw.Close();}} }?
按鈕精靈的腳本
Dim a SetSimMode 2VBS Dim fso,ts,text VBS Const ForReading = 1 VBS Set fso = CreateObject("Scripting.FileSystemObject") Set ts = fso.OpenTextFile("e:\ka_tool\ka.txt", ForReading)Rem Read_1 VBS kaTest=ts.ReadLine if kaTest="" or ts.AtEndOfStreamGoto Read_Over End IfLeftClick 1 /*左鍵,這是點NPC的*/'==========以下是按鍵精靈錄制的內容========== Delay 100 MoveTo 456, 337 Delay 30 MoveTo 452, 337 Delay 10 MoveTo 450, 337 Delay 30 MoveTo 442, 337 Delay 10 MoveTo 438, 337 Delay 30 MoveTo 431, 335 Delay 10 MoveTo 426, 335 Delay 30 MoveTo 424, 335 Delay 10 MoveTo 422, 334 Delay 30 MoveTo 419, 333 Delay 10 MoveTo 416, 333 Delay 30 MoveTo 414, 332 MoveTo 412, 331 Delay 20 MoveTo 408, 330 Delay 10 MoveTo 398, 328 Delay 10 MoveTo 385, 325 Delay 20 MoveTo 374, 321 Delay 100 MoveTo 357, 320 Delay 100 MoveTo 349, 319 Delay 200 MoveTo 342, 318 Delay 200 MoveTo 338, 318 MoveTo 336, 318 Delay 500 LeftDown 1 LeftClick 1 LeftUp 1 Delay 500 '==========以上是按鍵精靈錄制的內容========== a = left(kaTest, 23)//Plugin.Sys.SetCLB (a)//Delay 240 //KeyDown "Ctrl", 1 //Delay 150 //KeyDown "V", 1 //Delay 100 //KeyUp "V", 1 //Delay 30 //KeyUp "Ctrl", 1 SayString a KeyPress 13,1Delay 1000 /*延遲1秒*/KeyPress "Enter", 1 /*回車兌換*/Delay 2000 /*延遲1秒*///下面這句在屏幕區域范圍內截圖保存到("C:\PIC.bmp")里//Call Plugin.Pic.PrintScreen(369,274,716,422, "C:\PIC.bmp") FindPic 369,274,716,422,"Attachment:\2013621113659.bmp",0.9,intX,intYIf intX > 0 And intY > 0 Then Call Plugin.File.WriteFileEx("E:\ka_tool\ka_error.txt", a)Else Call Plugin.File.WriteFileEx("E:\ka_tool\ka_ok.txt", a)End IfKeyPress "Enter", 1 /*把彈出的那個兌換成功啊還有卡號錯誤那個框框按掉*/Delay 500'==========以下是按鍵精靈錄制的內容==========Delay 100MoveTo 336, 318MoveTo 338, 318Delay 20MoveTo 342, 318Delay 20MoveTo 349, 319Delay 10MoveTo 357, 320Delay 10MoveTo 374, 321Delay 20MoveTo 385, 325Delay 10MoveTo 398, 328Delay 10MoveTo 408, 330Delay 20MoveTo 412, 331Delay 30MoveTo 416, 333Delay 10MoveTo 419, 333Delay 30MoveTo 422, 334Delay 10MoveTo 424, 335Delay 30MoveTo 426, 335Delay 10MoveTo 431, 335Delay 30MoveTo 438, 337Delay 10MoveTo 442, 337Delay 30MoveTo 450, 337Delay 10MoveTo 452, 337 Delay 30 MoveTo 456, 337 Delay 100'==========以上是按鍵精靈錄制的內容========== Goto Read_1 Rem Read_OverVBS ts.Close?
轉載于:https://my.oschina.net/u/158055/blog/694696
總結
以上是生活随笔為你收集整理的之前帮朋友写的一个小工具-征途2新浪卡全自动淘号工具+按钮精灵脚本的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 前端 Vue3 + Vant3 + Vi
- 下一篇: <input>的maxlength、si