示例#1
0
 private void CheckBox1_CheckedChanged(object sender, EventArgs e)
 {
     if (Title == "NP")
     {
         GolbalSetting.GetInstance().keyPress_NP[0] = this.checkBox_Enable.Checked;
         GolbalSetting.GetInstance().keyPress_NP[1] = this.checkBox1.Checked;
         GolbalSetting.GetInstance().keyPress_NP[2] = this.checkBox2.Checked;
         GolbalSetting.GetInstance().keyPress_NP[3] = this.checkBox3.Checked;
         GolbalSetting.GetInstance().keyPress_NP[4] = this.checkBox4.Checked;
         GolbalSetting.GetInstance().keyPress_NP[5] = this.checkBox5.Checked;
         GolbalSetting.GetInstance().NPPercent      = comboBox1.SelectedIndex;
     }
     else if (Title == "HP")
     {
         GolbalSetting.GetInstance().keyPress_HP[0] = this.checkBox_Enable.Checked;
         GolbalSetting.GetInstance().keyPress_HP[1] = this.checkBox1.Checked;
         GolbalSetting.GetInstance().keyPress_HP[2] = this.checkBox2.Checked;
         GolbalSetting.GetInstance().keyPress_HP[3] = this.checkBox3.Checked;
         GolbalSetting.GetInstance().keyPress_HP[4] = this.checkBox4.Checked;
         GolbalSetting.GetInstance().keyPress_HP[5] = this.checkBox5.Checked;
         GolbalSetting.GetInstance().HPPercent      = comboBox1.SelectedIndex;
     }
     else if (Title == "SP")
     {
         GolbalSetting.GetInstance().keyPress_SP[0] = this.checkBox_Enable.Checked;
         GolbalSetting.GetInstance().keyPress_SP[1] = this.checkBox1.Checked;
         GolbalSetting.GetInstance().keyPress_SP[2] = this.checkBox2.Checked;
         GolbalSetting.GetInstance().keyPress_SP[3] = this.checkBox3.Checked;
         GolbalSetting.GetInstance().keyPress_SP[4] = this.checkBox4.Checked;
         GolbalSetting.GetInstance().keyPress_SP[5] = this.checkBox5.Checked;
         GolbalSetting.GetInstance().SPPercent      = comboBox1.SelectedIndex;
     }
 }
示例#2
0
 public Form1()
 {
     InitializeComponent();
     this.Text             = "guagua  1.0.0.8";
     this.notifyIcon1.Text = this.Text;
     trackBar_H.Value      = GolbalSetting.GetInstance().step_H;
     trackBar1_W.Value     = GolbalSetting.GetInstance().step_W;
 }
示例#3
0
 private void Form1_FormClosed(object sender, FormClosedEventArgs e)
 {
     foreach (var oi in m_objInfo)
     {
         oi.showWindow(true);
     }
     GolbalSetting.GetInstance().savetoConfig(m_objInfo);
 }
示例#4
0
 private void trackBar1_W_ValueChanged(object sender, EventArgs e)
 {
     if (!bInited)
     {
         return;
     }
     GolbalSetting.GetInstance().step_W = trackBar1_W.Value;
 }
 public static GolbalSetting GetInstance()
 {
     if (_gSettingInstance == null)
     {
         _gSettingInstance = new GolbalSetting();
     }
     return(_gSettingInstance);
 }
示例#6
0
        void findCB(ObjectInfo objectInfo)
        {
            objectInfo.setGraphics(this.CreateGraphics());
            GolbalSetting.GetInstance().updateConfig(ref objectInfo);
            m_objInfo.Add(objectInfo);
            Console.WriteLine(objectInfo.ToString());

            //listView1.Items.Add(objectInfo.userName);

            m_objInfoWorker.Add(new ObjectInfoWorker(objectInfo, autoEvent));
        }
        public void doWorkThread()
        {
            int X           = 0;
            int Y           = 0;
            int leftMove    = 100;
            int leftmoveCnt = 0;

            int[] narrX = new[] { +1, 0, -1, 0, +1, 0, -1, 0, +1, 0 };
            int[] narrY = new[] { 0, +1, 0, -1, 0, +1, 0, -1, 0, +1 };
            while (!bExit)
            {
                if (oi.enableWork)

                {
                    oi.pressAdd();
                    oi.pressZ();
                    oi.refeshObjInfo();
                }

                //RightAttack(center_X, center_y);

                for (int h = oi.Object_H * -1; h < 10; h += GolbalSetting.GetInstance().step_H)
                {
                    for (int w = oi.Object_W / 2 * -1; w < oi.Object_W / 2; w += GolbalSetting.GetInstance().step_W)
                    {
                        if (!oi.enableWork)
                        {
                            continue;
                        }
                        X = oi.center_X + w;
                        Y = oi.center_y + h;
                        if (oi.enableWork)
                        {
                            oi.attack(X, Y);
                            // oi.screenshotting();
                        }

                        autoEvent.WaitOne();
                    }
                }/**/

//                 int nOffsite = leftMove;
//                 int npos = leftmoveCnt % 10;
//
//                 nOffsite = leftMove * narrX[npos];
//
//                 oi.moveTo(oi.center_X + leftMove * narrX[npos], oi.center_y+ leftMove * narrY[npos]);
//                 Thread.Sleep(100);
//                 autoEvent.WaitOne();
//                 leftmoveCnt++;
            }
        }
 public void increaseHP()
 {
     //喝血
     if (GolbalSetting.GetInstance().keyPress_HP[0])
     {
         for (int i = 0; i < 5; i++)
         {
             if (GolbalSetting.GetInstance().keyPress_HP[i + 1])
             {
                 MouseEvent.pressKey(hWnd, Keys.D1 + i);
                 break;
             }
         }
     }
 }
示例#9
0
        private void UserControl1_Load(object sender, EventArgs e)
        {
            checkBox_Enable.Text = Title;
            if (Title == "HP")
            {
                checkBox_Enable.Checked = GolbalSetting.GetInstance().keyPress_HP[0];
                checkBox1.Checked       = GolbalSetting.GetInstance().keyPress_HP[1];
                checkBox2.Checked       = GolbalSetting.GetInstance().keyPress_HP[2];
                checkBox3.Checked       = GolbalSetting.GetInstance().keyPress_HP[3];
                checkBox4.Checked       = GolbalSetting.GetInstance().keyPress_HP[4];
                checkBox5.Checked       = GolbalSetting.GetInstance().keyPress_HP[5];
                comboBox1.SelectedIndex = GolbalSetting.GetInstance().HPPercent;
            }
            else if (Title == "SP")
            {
                checkBox_Enable.Checked = GolbalSetting.GetInstance().keyPress_SP[0];

                checkBox1.Checked       = GolbalSetting.GetInstance().keyPress_SP[1];
                checkBox2.Checked       = GolbalSetting.GetInstance().keyPress_SP[2];
                checkBox3.Checked       = GolbalSetting.GetInstance().keyPress_SP[3];
                checkBox4.Checked       = GolbalSetting.GetInstance().keyPress_SP[4];
                checkBox5.Checked       = GolbalSetting.GetInstance().keyPress_SP[5];
                comboBox1.SelectedIndex = GolbalSetting.GetInstance().SPPercent;
            }
            else if (Title == "NP")
            {
                checkBox_Enable.Checked = GolbalSetting.GetInstance().keyPress_NP[0];
                checkBox1.Checked       = GolbalSetting.GetInstance().keyPress_NP[1];
                checkBox2.Checked       = GolbalSetting.GetInstance().keyPress_NP[2];
                checkBox3.Checked       = GolbalSetting.GetInstance().keyPress_NP[3];
                checkBox4.Checked       = GolbalSetting.GetInstance().keyPress_NP[4];
                checkBox5.Checked       = GolbalSetting.GetInstance().keyPress_NP[5];
                comboBox1.SelectedIndex = GolbalSetting.GetInstance().NPPercent;
            }



            checkBox1.CheckedChanged       += CheckBox1_CheckedChanged;
            checkBox2.CheckedChanged       += CheckBox1_CheckedChanged;
            checkBox3.CheckedChanged       += CheckBox1_CheckedChanged;
            checkBox4.CheckedChanged       += CheckBox1_CheckedChanged;
            checkBox5.CheckedChanged       += CheckBox1_CheckedChanged;
            comboBox1.SelectedIndexChanged += CheckBox1_CheckedChanged;;
            checkBox_Enable.CheckedChanged += CheckBox1_CheckedChanged;
        }
示例#10
0
        static void Main(string[] args)
        {
            if (args.Length > 0)
            {
                NativeMethods.AllocConsole();
                Console.WriteLine("kaishi....");

                /*   ObjecInfo_HP_SP_NP objMem1 = new ObjecInfo_HP_SP_NP(0x8f68);
                 * ObjecInfo_HP_SP_NP objMem2 = new ObjecInfo_HP_SP_NP(32752);
                 *
                 * while (true)
                 * {
                 *     objMem1.doRead();
                 *     objMem2.doRead();
                 *     Thread.Sleep(500);
                 * }/**/
            }
            GolbalSetting.GetInstance().LoadConfig();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
        public void refeshObjInfo()
        {
            objeMem_HP_SP_NP.doRead();

            objectInfoMoney.doRead();
            objJingYan.doRead();
            if (GolbalSetting.GetInstance().HPPercent *objeMem_HP_SP_NP.HPMax / 10 > objeMem_HP_SP_NP.HP)
            {
                Console.WriteLine("{0}>>life:{1} {2} ", this.userName, objeMem_HP_SP_NP.HP, objeMem_HP_SP_NP.HPMax);
                increaseHP();
            }

            if (GolbalSetting.GetInstance().SPPercent *objeMem_HP_SP_NP.spMax / 10 > objeMem_HP_SP_NP.sp)
            {
                Console.WriteLine("{0}>>sp:{1} {2} ", this.userName, objeMem_HP_SP_NP.sp, objeMem_HP_SP_NP.spMax);
                increaseSP();
            }

            if (GolbalSetting.GetInstance().NPPercent *objeMem_HP_SP_NP.npMax / 10 > objeMem_HP_SP_NP.np)
            {
                Console.WriteLine("{0}>>NP:{1} {2} ", this.userName, objeMem_HP_SP_NP.np, objeMem_HP_SP_NP.npMax);
                increaseNP();
            }
        }
        public void screenshotting()
        {
            int curTime = System.Environment.TickCount & Int32.MaxValue;

            if (curTime - lastUpdateTime < 2000)
            {
                return;
            }
            lastUpdateTime = curTime;

            if (bmp == null)
            {
                bmp            = new Bitmap(this.rt.Width(), this.rt.Height(), g);
                memoryGraphics = Graphics.FromImage(bmp);
                //  dc = memoryGraphics.GetHdc();
            }

            dc = memoryGraphics.GetHdc();
            bool success = PrintWindow(this.hWnd, dc, 0);

            memoryGraphics.ReleaseHdc(dc);
            // bmp now contains the screenshot
            //  bmp.Save("c:\\jpeg\\ccccc.jpg");
            float a = 0.6F;

            int hh        = 63;
            int firstLine = this.rt.Height() - 96;

            //14,701 33,763
            //52,701 63,763
            //81,701 92,763
            a = (10 - (GolbalSetting.GetInstance().HPPercent + 1)) / 10.0F;
            Color colorHP = bmp.GetPixel(22, Convert.ToInt32(hh * a + firstLine)); //判断 Color.B 是否为0


            if (colorHP.B != 0)
            {
                increaseHP();
                Console.WriteLine("{0},{1}>>life:{1} ", this.userName, a, colorHP.ToString());
            }

            a = (10 - (GolbalSetting.GetInstance().SPPercent + 1)) / 10.0F;
            Color colorSP = bmp.GetPixel(60, Convert.ToInt32(hh * a + firstLine)); //判断 Color.G 是否为0


            if (colorSP.G != 0)
            {
                increaseSP();
                Console.WriteLine("{0},{1}>>tec:{1} ", this.userName, a, colorSP.ToString());
            }

            a = (10 - (GolbalSetting.GetInstance().NPPercent + 1)) / 10.0F;
            Color colorNP = bmp.GetPixel(88, Convert.ToInt32(hh * a + firstLine)); //判断 Color.B 是否为0

            if (colorNP.B != 0)
            {
                increaseNP();
                Console.WriteLine("{0},{1}>>cPower:{2} ", this.userName, a, colorNP.ToString());
            }


            Console.WriteLine("{3}>>colorHP:{0} colorSP:{1} colorNP:{2}", colorHP.ToString(), colorSP.ToString(), colorNP.ToString(), a);
        }