Esempio n. 1
0
        public ulong getEnemyNearPos(Position3D pos)
        {
            WowObject enemy = new WowObject();

            int currObjPtr = objectManager + FIRST_OBJECT;
            int currObj    = MemoryHandler.readInt(currObjPtr);

            int   LocalGUID  = 0xC0;
            Int64 playerGUID = MemoryHandler.readHexAsInt64(objectManager + LocalGUID);

            while (currObj != 0)
            {
                currObj = MemoryHandler.readInt(currObjPtr);

                enemy.Guid          = MemoryHandler.readUInt64((int)(currObj + ObjectOffsets.Guid));
                enemy.Type          = (short)(MemoryHandler.readUInt32((int)(currObj + ObjectOffsets.Type)));
                enemy.XPos          = MemoryHandler.readFloat((int)(currObj + ObjectOffsets.Pos_X));
                enemy.YPos          = MemoryHandler.readFloat((int)(currObj + ObjectOffsets.Pos_Y));
                enemy.ZPos          = MemoryHandler.readFloat((int)(currObj + ObjectOffsets.Pos_Z));
                enemy.CurrentHealth = MemoryHandler.readUint((int)(currObj + ObjectOffsets.Health));

                if (enemy.Type == 3 && enemy.CurrentHealth != 0)
                {
                    Position enemyPos = new Position(enemy.XPos, enemy.YPos);
                    if (5.0 > enemyPos.distance(pos.to2DPosition()))
                    {
                        return(enemy.Guid);
                    }
                }

                currObjPtr = currObj + NEXT_OBJECT;
            }

            return(0);
        }
Esempio n. 2
0
        public MineralVein[] getMineralVeinsAround()
        {
            int currObjPtr = objectManager + FIRST_OBJECT;
            int currObj    = MemoryHandler.readInt(currObjPtr);

            List <MineralVein> mineralsAround = new List <MineralVein>();

            while (currObj != 0)
            {
                currObj = MemoryHandler.readInt(currObjPtr);

                if (MineralVein.mineralIDs.Contains(MemoryHandler.readInt(currObj + MineralVein.TYPE_ID)))
                {
                    Position3D position = new Position3D(
                        MemoryHandler.readFloat(currObj + MineralVein.X),
                        MemoryHandler.readFloat(currObj + MineralVein.Y),
                        MemoryHandler.readFloat(currObj + MineralVein.Z));
                    if (!Bot.PROHIBITED_POSITIONS.Contains(position))
                    {
                        mineralsAround.Add(new MineralVein(position, MemoryHandler.readInt64(currObj + 0x30)));
                    }
                }
                currObjPtr = currObj + NEXT_OBJECT;
            }

            return(mineralsAround.ToArray());
        }
Esempio n. 3
0
        public bool isPlayerNear(Position3D playerPos)
        {
            int currObjPtr = objectManager + FIRST_OBJECT;
            int currObj    = MemoryHandler.readInt(currObjPtr);

            WowObject target = new WowObject();

            while (currObj != 0)
            {
                currObj = MemoryHandler.readInt(currObjPtr);

                target.Type = (short)(MemoryHandler.readUInt32((int)(currObj + ObjectOffsets.Type)));

                if (target.Type == 4)
                {
                    target.XPos = MemoryHandler.readFloat((int)(currObj + ObjectOffsets.Pos_X));
                    target.YPos = MemoryHandler.readFloat((int)(currObj + ObjectOffsets.Pos_Y));
                    target.ZPos = MemoryHandler.readFloat((int)(currObj + ObjectOffsets.Pos_Z));

                    float distance = playerPos.distance(new Position3D(target.XPos, target.YPos, target.ZPos));

                    if (160.0f > distance && 1.0f < distance)
                    {
                        return(true);
                    }
                }

                currObjPtr = currObj + NEXT_OBJECT;
            }

            return(false);
        }
Esempio n. 4
0
        public void takeOff()
        {
            //ChatWriter.send(MemoryHandler.process.MainWindowHandle, "/run if IsMounted() == nil then CallCompanion('MOUNT', " + mountNum + ") end");//"/click MultiBarRightButton1"

            if (getCurrRage() > 0)
            {
                System.Console.WriteLine("megtámadtak, bladestorm");
                ChatWriter.hitKey(ChatWriter.THREE);
                ChatWriter.hitKey(ChatWriter.THREE);
                ChatWriter.hitKey(ChatWriter.TWO);
                Thread.Sleep(8000);
                ChatWriter.hitKey(ChatWriter.FOUR);
                Thread.Sleep(2000);
            }

            ChatWriter.hitKey(ChatWriter.ONE);
            Thread.Sleep(2500);

            MemoryHandler.writeFloat(CTM_X, MemoryHandler.readFloat(X));
            MemoryHandler.writeFloat(CTM_Y, MemoryHandler.readFloat(Y));
            MemoryHandler.writeFloat(CTM_Z, MemoryHandler.readFloat(Z) + 800.0f);
            MemoryHandler.writeInt(CTM_Action, 4);

            //néha nem repül fel egyből, hanem megáll 1 méterre a föld felett, ezért ujra kell kattintani
            Thread.Sleep(1000);
            MemoryHandler.writeInt(CTM_Action, 4);

            Thread.Sleep(10000);
        }
Esempio n. 5
0
        public void flyTo(Position position)
        {
            //míg az x,y távolság nagyobb mint 1 várok
            stopwatch.Reset();
            stopwatch.Start();
            while (
                (Math.Abs(MemoryHandler.readFloat(X) - position.x) > 10.0f ||
                 Math.Abs(MemoryHandler.readFloat(Y) - position.y) > 10.0f)
                )
            {
                //ha sokat baszakodik, akkor ujra felmountolok
                if (stopwatch.ElapsedMilliseconds > 60000)
                {
                    System.Console.WriteLine("nem nagyon jutok a célhoz, ujramountolok");
                    MemoryHandler.writeInt(CTM_Action, 11);
                    takeOff();
                    stopwatch.Reset();
                    stopwatch.Start();
                }

                MemoryHandler.writeFloat(CTM_X, position.x);
                MemoryHandler.writeFloat(CTM_Y, position.y);
                MemoryHandler.writeFloat(CTM_Z, MemoryHandler.readFloat(Z));
                MemoryHandler.writeFloat(CTM_Distance, 0.5f);
                MemoryHandler.writeInt(CTM_Action, 4);
                Thread.Sleep(200);
                //System.Console.WriteLine(MemoryHandler.readFloat(CTM_X) + ", " + MemoryHandler.readFloat(CTM_Y) + ", " + MemoryHandler.readFloat(CTM_Z));
                //System.Console.WriteLine(position.x + ", " + position.y);
                //System.Console.WriteLine(MemoryHandler.readFloat(X) + ", " + MemoryHandler.readFloat(Y));
            }
            MemoryHandler.writeInt(CTM_Action, 11);
            Thread.Sleep(400);
        }
Esempio n. 6
0
 public Position3D getPosition3D()
 {
     position3D.x = MemoryHandler.readFloat(X);
     position3D.y = MemoryHandler.readFloat(Y);
     position3D.z = MemoryHandler.readFloat(Z);
     return(position3D);
 }
Esempio n. 7
0
        public void takeOff()
        {
            stop();
            Thread.Sleep(500);

            mount();

            while (!isMounted())
            {
                while (ObjectManager.sharedOM().getEnemies().Count > 0)
                {
                    attack(ObjectManager.sharedOM().getEnemies()[0].Guid);
                    figth();
                }
                mount();
            }

            MemoryHandler.writeFloat(CTM_X, MemoryHandler.readFloat(X));
            MemoryHandler.writeFloat(CTM_Y, MemoryHandler.readFloat(Y));
            MemoryHandler.writeFloat(CTM_Z, MemoryHandler.readFloat(Z) + 800.0f);
            MemoryHandler.writeInt(CTM_Action, 4);

            //néha nem repül fel egyből, hanem megáll 1 méterre a föld felett, ezért ujra kell kattintani
            Thread.Sleep(1000);
            MemoryHandler.writeInt(CTM_Action, 4);

            Thread.Sleep(7000);
        }
Esempio n. 8
0
        public void clickToMove(float x, float y, float z = 0.0f)
        {
            //ha nem adok meg z értéket, akkor marad a magasság ugyanaz
            if (z == 0.0f)
            {
                z = MemoryHandler.readFloat(Z - 10);
            }

            //az értékek beírása a memoriába
            MemoryHandler.writeFloat(CTM_X, x);
            MemoryHandler.writeFloat(CTM_Y, y);
            MemoryHandler.writeFloat(CTM_Z, z);
            MemoryHandler.writeInt(CTM_Action, 4);
            //MemoryHandler.writeFloat(CTM_Distance, 0.5f);

            //amíg az action 4, azaz mozgásban van, addig várok
            while (MemoryHandler.readInt(CTM_Action) == 4)
            {
                Thread.Sleep(200);
            }
            Thread.Sleep(400);
        }
Esempio n. 9
0
        private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam)
        {
            if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN)
            {
                int vkCode = Marshal.ReadInt32(lParam);
                Console.WriteLine((Keys)vkCode);

                if (vkCode == 'X')
                {
                    using (StreamWriter w = File.AppendText("C:\\Users\\például Lilian\\Desktop\\locations.txt")) {
                        w.Write("new Position3D(" + (int)MemoryHandler.readFloat(X) + ", "
                                + (int)MemoryHandler.readFloat(Y) + ", "
                                + (int)MemoryHandler.readFloat(Z) +
                                "), ");
                        xHitted++;
                        if (xHitted % 3 == 0)
                        {
                            w.WriteLine();
                        }
                    }
                }
            }
            return(CallNextHookEx(_hookID, nCode, wParam, lParam));
        }
Esempio n. 10
0
        public void printTargetData(Position3D playerPos)
        {
            while (true)
            {
                int currObjPtr = objectManager + FIRST_OBJECT;
                int currObj    = MemoryHandler.readInt(currObjPtr);

                WowObject  target   = new WowObject();
                Position3D otherPos = new Position3D(0, 0, 0);

                while (currObj != 0)
                {
                    currObj = MemoryHandler.readInt(currObjPtr);


                    if (MemoryHandler.readUInt64((int)Globals.CURR_TARGET_GUID) == MemoryHandler.readUInt64((int)(currObj + ObjectOffsets.Guid)))
                    {
                        target.Guid = MemoryHandler.readUInt64((int)(currObj + ObjectOffsets.Guid));
                        target.Name = getMobNameFrmBase(currObj);

                        target.XPos = MemoryHandler.readFloat((int)(currObj + ObjectOffsets.Pos_X));
                        target.YPos = MemoryHandler.readFloat((int)(currObj + ObjectOffsets.Pos_Y));
                        target.ZPos = MemoryHandler.readFloat((int)(currObj + ObjectOffsets.Pos_Z));

                        otherPos = new Position3D(target.XPos, target.YPos, target.ZPos);
                    }

                    currObjPtr = currObj + NEXT_OBJECT;
                }

                System.Console.Clear();
                System.Console.WriteLine(target.Name + ", " + target.Guid);
                System.Console.WriteLine(playerPos.distance(otherPos));
                Thread.Sleep(200);
            }
        }
Esempio n. 11
0
        public void writeToFile()
        {
            while (true)
            {
                Console.Clear();

                int currObjPtr = objectManager + FIRST_OBJECT;
                int currObj    = MemoryHandler.readInt(currObjPtr);

                //System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\Users\például Lilian\Desktop\akarmi2.txt");

                int X = 236;
                int Y = 500;
                int Z = 480;


                while (currObj != 0)
                {
                    currObj = MemoryHandler.readInt(currObjPtr);
                    Position p = Zone.getRelativePosition(MemoryHandler.readFloat(currObj + X), MemoryHandler.readFloat(currObj + Y));
                    //if (/*p.x * 100 < 100 && p.y * 100 < 100 &&*/ MemoryHandler.readInt(currObj + 548) == 181557) {
                    //file.WriteLine(MemoryHandler.readHexAsInt64(currObj + 0x20));

                    /*if (MemoryHandler.readHexAsInt64(currObj + 48) == 75435293781275187) {
                     *  System.Console.WriteLine(MemoryHandler.readFloat(currObj + X) + ", " + MemoryHandler.readFloat(currObj + Y));
                     * }*/
                    //}

                    /*
                     *  if (MemoryHandler.readInt(currObj + 0x14) == 6500) {
                     *      Position p = Zone.getRelativePosition(MemoryHandler.readFloat(currObj + X), MemoryHandler.readFloat(currObj + Y));
                     *      file.WriteLine(p.x + ", " + p.y);
                     *  }*/
                    //file.WriteLine(currObj - 0x0AFA6DE0);

                    //file.WriteLine("-------------------------------");
                    //if (MemoryHandler.readInt(currObj + 548) == 181557) {

                    /* for (int i = 0; i < 1000; ++i) {
                     *   file.WriteLine(i + ":" + MemoryHandler.readHexAsInt64(currObj + 0x1 * i));
                     * }
                     * file.WriteLine("-------------------------------");*/
                    //}

                    /**/

                    /*while (true) {
                     *  System.Console.Clear();
                     *  System.Console.WriteLine(MemoryHandler.readString(0x0369A30C, 20));
                     *  Thread.Sleep(200);
                     * }*/

                    //System.Console.WriteLine(MemoryHandler.readString(currObj + 0x2, 10));

                    /*if (MemoryHandler.readHexAsInt64(0x00BD07A0) == MemoryHandler.readHexAsInt64(currObj + GUID_OFFS) &&
                     *  MemoryHandler.readHexAsInt64(0x00BD07A0) != 0
                     *  ) {*/
                    if (MemoryHandler.readHexAsInt64(currObj + 560) == 75435293781275187)
                    {
                        if (MemoryHandler.readInt(currObj + 0xBC) != 0)
                        {
                            System.Console.WriteLine(MemoryHandler.readInt16(currObj + 0xBC));
                            //Thread.Sleep(20000);
                        }
                    }

                    /*for (int i = 0; i < 10000; ++i) {
                     *  if (MemoryHandler.readHexAsInt64(currObj + 0x1 * i) == 75435293781275187) {
                     *      System.Console.WriteLine(i);
                     *  }
                     *  //file.WriteLine(MemoryHandler.readHexAsInt64(currObj + 0x1 * i));
                     * }*/
                    //}

                    currObjPtr = currObj + NEXT_OBJECT;
                }
                //System.Console.WriteLine(MemoryHandler.readHexAsString(0x00BD07A0));
                //file.Close();
                Thread.Sleep(10);
            }
        }
Esempio n. 12
0
 public float getZ()
 {
     return(MemoryHandler.readFloat(Z));
 }
Esempio n. 13
0
 public float getY()
 {
     return(MemoryHandler.readFloat(Y));
 }
Esempio n. 14
0
 public float getX()
 {
     return(MemoryHandler.readFloat(X));
 }
Esempio n. 15
0
 public Position getPosition()
 {
     position.x = MemoryHandler.readFloat(X);
     position.y = MemoryHandler.readFloat(Y);
     return(position);
 }