war3显血

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Windows.Forms;

using MouseKeyboardLibrary;
namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {

        #region DllImport
        [DllImport("User32.dll")]
        public static extern void keybd_event(Byte bVk, Byte bScan, Int32 dwFlags, Int32 dwExtraInfo);
        #endregion

         public Form1()
        {
            InitializeComponent();
        }
        int aa = 1;
        private void Form1_Load(object sender, EventArgs e)
        {
            button1.Text = "帮助";
            this.BackColor = Color.DarkCyan;
            label1.Text = "hook wait";
            KeyboardHook keyboardHook = new KeyboardHook();
            keyboardHook.KeyPress += new KeyPressEventHandler(keyboardHook_KeyPress);
            keyboardHook.Start();
        }
        void keyboardHook_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)Keys.Escape)
                this.Close();
            if (e.KeyChar == (char)Keys.W)
                df();
        }
        byte a = 219; //键盘上 [ 键的代码。按[可显示友方单位生命值。
        byte b =221;// 键盘上] 键的代码。按]可显示敌方单位生命值。

        public void df() {

            if (aa == 1)
            {

                keybd_event(a, 0, 0, 0);
                keybd_event(b, 0, 0, 0);
                label1.Text = "hook start";


                aa++;
            }
            else
            {

                keybd_event(a, 0, 2, 0);
                keybd_event(b, 0, 2, 0);
                label1.Text = "hook end";

                aa = 1;
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Esc:退出 ;W:显血","魔兽显血辅助->神之df作品");

        }


    }
}

//需要用到MouseKeyboardLibrary这个类文件,感兴趣的可以向我索取:573270407@qq.com
  • 刚毕业那阵子,风靡war3这个游戏,基本陪伴了我整个大学生活,甚至毕业后仍然陪伴了很长时间,直到现在,偶尔还是能看到有人玩这个
  • 那时一直喜爱魔兽争霸,于是自己写了个辅助
  • 是很久以前的事了
  • 那时很少用csdn,其实是因为那时还用不好csdn,所以很多代码都贴在新浪博客里
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值