- UID
- 101955
- 帖子
- 651
- 主題
- 3
- 精華
- 0
- 積分
- 2
- 楓幣
- 2
- 威望
- -1
- 存款
- 0
- 贊助金額
- 0
- 推廣
- 0
- GP
- 1
- 閱讀權限
- 10
- 性別
- 保密
- 在線時間
- 60 小時
- 註冊時間
- 2015-5-5
- 最後登入
- 2017-8-25
|
本帖最後由 as798792 於 2015-8-2 16:33 編輯
聲明:部分使用網路上的方法,程式碼缺少部分自行填寫(座標必修改)
這是很簡單的前台處理,後台若需要自行修改
所使用一個struct包住其他struct一個小封裝,在宣告同時省了不少時間,操作碼只需要2個,若還有需要自行上網
請自行修改才能達成掛機效果
因為沒甚麼時間用,若有時間會直接附上完整exe可調式的
主要使用:波比50W數據+亞台龍欸
數據執行器自行抓取或做一個小外掛搭配使用(小外掛可快速達成後台效果)
還必須使用Thread,多執行緒
主要視窗:
using System;
using System.Drawing;
using System.windows.Forms;
using System.Diagnostics;
using System.Threading;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
//Process[] pros = Process.GetProcessesByName("MapleStory");
//IntPtr pGame = pros[0].MainWindowHandle;
Cursor.Position = new Point(807, 64);
Thread.Sleep(200);
Mouse.LeftClick();
Thread.Sleep(200);
Cursor.Position = new Point(985, 321);
Thread.Sleep(200);
Mouse.LeftClick();
Thread.Sleep(200);
Cursor.Position = new Point(695, 503);
Thread.Sleep(200);
Mouse.LeftClick();
Thread.Sleep(200);
System.Diagnostics.Process.Start(@"這裡使用龍欸");
Cursor.Position = new Point(809, 448);
}
}
}
Mouse.cs:
using System.Threading;
using System.Runtime.InteropServices;
static public class Mouse
{
[DllImport("user32.dll", SetLastError = true)]
public static extern Int32 SendInput(Int32 cInputs, ref INPUT pInputs, Int32 cbSize);
[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 28)]
public struct INPUT
{
[FieldOffset(0)]
public INPUTTYPE dwType;
[FieldOffset(4)]
public MOUSEINPUT mi;
[FieldOffset(4)]
public KEYBOARDINPUT ki;
[FieldOffset(4)]
public HARDWAREINPUT hi;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct MOUSEINPUT
{
public Int32 dx;
public Int32 dy;
public Int32 mouseData;
public MOUSEFLAG dwFlags;
public Int32 time;
public IntPtr dwExtraInfo;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct KEYBOARDINPUT
{
public Int16 wVk;
public Int16 wScan;
public KEYBOARDFLAG dwFlags;
public Int32 time;
public IntPtr dwExtraInfo;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct HARDWAREINPUT
{
public Int32 uMsg;
public Int16 wParamL;
public Int16 wParamH;
}
public enum INPUTTYPE : int
{
Mouse = 0,
Keyboard = 1,
Hardware = 2
}
[Flags()]
public enum MOUSEFLAG : int
{
LEFTDOWN = 0x2,
LEFTUP = 0x4,
}
[Flags()]
public enum KEYBOARDFLAG : int
{
EXTENDEDKEY = 1,
KEYUP = 2,
UNICODE = 4,
SCANCODE = 8
}
static public void LeftDown()
{
INPUT leftdown = new INPUT();
leftdown.dwType = 0;
leftdown.mi = new MOUSEINPUT();
leftdown.mi.dwExtraInfo = IntPtr.Zero;
leftdown.mi.dx = 0;
leftdown.mi.dy = 0;
leftdown.mi.time = 0;
leftdown.mi.mouseData = 0;
leftdown.mi.dwFlags = MOUSEFLAG.LEFTDOWN;
SendInput(1, ref leftdown, Marshal.SizeOf(typeof(INPUT)));
}
static public void LeftUp()
{
INPUT leftup = new INPUT();
leftup.dwType = 0;
leftup.mi = new MOUSEINPUT();
leftup.mi.dwExtraInfo = IntPtr.Zero;
leftup.mi.dx = 0;
leftup.mi.dy = 0;
leftup.mi.time = 0;
leftup.mi.mouseData = 0;
leftup.mi.dwFlags = MOUSEFLAG.LEFTUP;
SendInput(1, ref leftup, Marshal.SizeOf(typeof(INPUT)));
}
static public void LeftClick()
{
Thread.Sleep(200);
LeftDown();
Thread.Sleep(200);
LeftUp();
}
}
|
[發帖際遇]: as798792 因為參加「太陽花學運」被黨看見,而成功加入DDP側翼網軍,領取網軍獎勵 1 楓幣 |
幸運榜 / 衰神榜 |
-
總評分: 楓幣 -10
威望 -1
GP -1
查看全部評分
|