Example #1
0
        public void ShowPos()
        {
            //if (misshowpos)
            {
                Color color;
                for (int i = 0; i < mpixelone.mdatanum; i++)
                {
                    int j = 0;
                    //for (int j = 0; j < 5; j++)
                    {
                        if ((mpixelone.mpositions[i, j].X == 0) && (mpixelone.mpositions[i, j].X == 0))
                        {
                            continue;
                        }
                        //    break;

                        Point pt = mpixelone.mpositions[i, j];
                        //mdwgraph.drawRect(grap, pt);

                        color = mpixelone.getColor(pt);
                        DbMsg.Msg(i.ToString() + "pos (" + pt.X.ToString() + "," + pt.Y.ToString() + "), color " +
                                  "(" + color.R.ToString() + "," + color.G.ToString() + "," + color.B.ToString() + ")");
                    }
                }
            }
        }
Example #2
0
        public void showColor(Status index, float p)
        {
            int   idx   = (int)index;
            int   x     = mpositions[idx, 0].X + Convert.ToInt32(p * mthlen);
            Color color = getColor(x, mpositions[idx, 0].Y);

            DbMsg.Msg("color=" +
                      color.R.ToString() +
                      "," + color.G.ToString() +
                      "," + color.B.ToString());
        }
Example #3
0
        public void doLoot()
        {
            //int idx = (int)Status.loot1+mlootidx;

            DbMsg.Msg("do loot");
            //Point pt = mpositions[idx, mlootidx];
            mlootidx++;
            if (mlootidx >= 4)
            {
                mlootidx = 0;
            }

            //remember current position;
            Point curpos = new Point(0, 0);

            WinApis.GetCursorPos(ref curpos);

            for (int i = 0; i < 4; i++)
            {
                int idx = (int)Status.loot1 + i;// mlootidx;
                //pt = mwowmacro.getLootPos();
                //DbMsg.Msg("pos=" + pt.X.ToString() + "," + pt.Y.ToString());
                //if (j>0)
                {
                    Point pt = new Point(0, 0);// = mpositions[idx, 1];
                    //pt.X = mpositions[idx, 0].X;
                    //pt.Y = mpositions[idx, 0].Y;
                    pt = mpositions[idx, 0];
                    WinApis.ClientToScreen(this.getHwndDraw(), ref pt); // DrawFormMan._this.mformhwnd, ref pt);

                    MouseHelper.Click(1, pt.X, pt.Y);
                    DbMsg.Msg("mouse-click=" + pt.X.ToString() + "," + pt.Y.ToString());
                }
                //Thread.Sleep(10);
            }
            //MouseHelper.setPos(curpos);


            //return pt;
        }
Example #4
0
        public void AlignGrids()
        {
            DbMsg.Msg("align grids");
            //
            int dx    = 3;
            int dy    = 3;
            int xsize = mgridcol * dx * 2;
            int ysize = mgridrow * dy * 2;

            int[,] cdata = new int[ysize, xsize];

            this.fetchColors(cdata, xsize, ysize);

            // align;
            int xnum = this.alignColors(cdata, xsize);

            // set position;
            this.setGridPos(cdata, xnum, ysize);


            // align;
            DbMsg.Msg("align grids done");
        }
Example #5
0
        void Combat()
        {
            bool isevi   = false;
            bool issin   = true;
            bool isslice = false;

            int thp = GetVal(EgridRogue.thpcur);

#if DEBUG
            DbMsg.Msg("thp=" + thp.ToString());
#endif

            if (thp > 0)
            {
                int pt = GetVal(EgridRogue.ppoint);
#if DEBUG
                DbMsg.Msg("pt=" + pt.ToString() + "," + mslicecnt.ToString());
#endif

                if ((GetVal(EgridRogue.aslice) == 0))
                {
                    if ((thp > 70) && (pt < 3))
                    {
                        DbMsg.Msg("slice=true");
                        isslice = true;
                    }
                }

                if (thp < 40)
                {
                    isevi = true;
                }
                if (pt >= 5)
                {
                    isevi = true;
                }

                if (GetVal(EgridRogue.aauto) == 0)
                {
                    DoAction(EactionRogue.auto);
                }

                if (pt > 0)
                {
                    if (isslice)
                    {
                        DoAction(EactionRogue.slice);
                        DbMsg.Msg("slice");
                        //mslicecnt = 15;
                        issin = false;
                    }
                    else if (isevi)
                    {
                        DoAction(EactionRogue.eviscerate);
                        issin = false;
                    }
                }

                if (issin)
                {
                    DoAction(EactionRogue.sinister);
                }
            }
        }
Example #6
0
        public void doMacro2()
        {
            bool isevi   = false;
            bool issin   = true;
            bool isslice = false;

            if (mhealcnt > 0)
            {
                mhealcnt--;
            }
            if (mslicecnt > 0)
            {
                mslicecnt--;
            }
            if (mhealcnt > 0 || mslicecnt > 0)
            {
                DbMsg.Msg("meatcnt=" + mhealcnt.ToString() + ",slicent=" + mslicecnt.ToString());
            }

            //if(md2c.getVal(Wenum.tname1)!=0)
            if (mpixelone.isSameAll(WowRoguePixelOne.Status.target_title))// isTarget())
            {
                //DbMsg.Msg("target=true");
                if (mpixelone.isSame(WowRoguePixelOne.Status.target_health))// isTargetHealth((float)0.0))
                {
                    //DbMsg.Msg("dead");
                    //return;
                    if (!mpixelone.isSame(WowRoguePixelOne.Status.outmeleerange)) // isOutofRange())
                    {
                        if (mpixelone.isSame(WowRoguePixelOne.Status.rogue5p))    // isPoint5())
                        {
                            DbMsg.Msg("point5=true");
                            isevi = true;
                        }
                        if (!mpixelone.isSame(WowRoguePixelOne.Status.target_health, (float)0.4))// isTargetHealth((float)0.4))// blood <30%;
                        {
                            DbMsg.Msg("target blood < 0.4");
                            isevi = true;
                        }
                        else if (mpixelone.isSame(WowRoguePixelOne.Status.target_health, (float)0.6))
                        {
                            //if (!isSameAll(Status.slice))
                            if (mslicecnt == 0)
                            {
                                isslice = true;
                            }
                        }

                        //isslice = false;

                        // do
                        mhealcnt = 0;    // reset;

                        // start auto attack;
                        if (!mpixelone.isSameAll(WowRoguePixelOne.Status.auto))
                        {
                            //KeyHelper.SentKeyMof(Keys.Control, Keys.D9);
                            DoAction(EactionRogue.auto);
                        }

                        if (mpixelone.isSame(WowRoguePixelOne.Status.rogue1p))
                        {
                            if (isevi)
                            {
                                DoAction(EactionRogue.eviscerate);
                                issin = false;
                            }
                            else if (isslice && mpixelone.isSameAll(WowRoguePixelOne.Status.player_energy, (float)0.3))
                            {
                                DoAction(EactionRogue.slice);
                                issin     = false;
                                mslicecnt = 15;
                            }
                        }

                        if (issin)
                        {
                            if (!mpixelone.isSame(WowRoguePixelOne.Status.target_health, (float)0.2))
                            {
                                DbMsg.Msg("target-health<0.2");
                                //KeyHelper.SentKeyMof(Keys.Control, Keys.D2);
                                DoAction(EactionRogue.sinister);
                            }
                            else
                            {
                                //showColor(Status.player_energy, (float)0.5);
                                if (mpixelone.isSameAll(WowRoguePixelOne.Status.player_energy, (float)0.5))      // >60;
                                {
                                    DbMsg.Msg("energy>0.5");
                                    //KeyHelper.SentKeyMof(Keys.Control, Keys.D4);        // back;
                                    //KeyHelper.SentKeyMof(Keys.Control, Keys.D2);
                                    DoAction(EactionRogue.sinister);
                                }
                            }
                        }
                        //showColor(Status.slice);
                    }
                    mpixelone.resetLoot();
                }
                else
                {
                    if (mpixelone.isLoot())
                    {
                        mpixelone.doLoot();
                    }
                    else
                    {
                        mpixelone.resetLoot();
                    }
                }
            }
            else    // non target;
            {
                //bool iseat = false;
                if (mhealcnt == 0)
                {
                    if (mpixelone.isSame(WowRoguePixelOne.Status.phead))
                    {
                        if (!mpixelone.isSame(WowRoguePixelOne.Status.php0, (float)0.5) && !mpixelone.isSame(WowRoguePixelOne.Status.php10)) // isPHealth((float)0.5))
                        {
                            //KeyHelper.SentKeyMof(Keys.Control, Keys.D0);
                            DoAction(EactionRogue.heal);
                            mhealcnt = 30;
                        }
                    }
                }
                else if (mhealcnt > 0)
                {
                    //DbMsg.Msg("meatcnt=" + mhealcnt.ToString());
                    if (mhealcnt > 3)
                    {
                        if (mpixelone.isSame(WowRoguePixelOne.Status.php10))
                        {
                            mhealcnt = 3;
                        }
                    }

                    if (mhealcnt == 22)
                    {
                        //KeyHelper.SentKeyMof(Keys.None, Keys.C);//hide;
                        DoAction(EactionRogue.hide);
                    }
                    else if (mhealcnt == 3)
                    {
                        // stand up;
                        //KeyHelper.SentKeyMof(Keys.None, Keys.Space);
                        DoAction(EactionRogue.jump);
                    }
                    else if (mhealcnt == 1)
                    {
                        if (mpixelone.isSame(WowRoguePixelOne.Status.php0, (float)0.8) && mpixelone.isSameAll(WowRoguePixelOne.Status.roguehide))// isPHealth((float)0.8) && isHide())
                        {
                            //KeyHelper.SentKeyMof(Keys.None, Keys.C);
                            DoAction(EactionRogue.hide);
                        }
                    }
                }
            }
        }