Example #1
0
        public void fish()
        {
            if (fishCounter > 50)
            {
                destroyTillUncommon();
                fishCounter = 0;
            }

            ChatWriter.send(MemoryHandler.process.MainWindowHandle, "/click MultiBarRightButton3");
            Thread.Sleep(500);

            if (ObjectManager.sharedOM().getBobberBase() == -1)
            {
                System.Console.WriteLine("nincs bobber");
                return;
            }

            bobber = new Bobber(ObjectManager.sharedOM().getBobberBase());

            stopwatch.Reset();
            stopwatch.Start();
            while (stopwatch.ElapsedMilliseconds < 20000)
            {
                if (bobber.isBobbing())
                {
                    System.Console.WriteLine("bite");
                    MemoryHandler.writeInt64(Offset.MOUSE_OVER_GUID, (bobber.GUID));
                    ChatWriter.hitKey(ChatWriter.B);
                    fishCounter++;
                    return;
                }
                Thread.Sleep(100);
            }
        }
Example #2
0
 public Position3D getPosition3D()
 {
     position3D.x = MemoryHandler.readFloat(X);
     position3D.y = MemoryHandler.readFloat(Y);
     position3D.z = MemoryHandler.readFloat(Z);
     return(position3D);
 }
Example #3
0
        public static Position getRelativePosition(float x, float y)
        {
            if (zones == null)
            {
                createZones();
            }
            Zone zone = getZoneById(MemoryHandler.readInt(ZONE_ID));

            return(new Position(zone.getRelativeX(x), zone.getRelativeY(y)));
        }
Example #4
0
        static void Main(string[] args)
        {
            //a memoriaolvasó inicializálása
            MemoryHandler.createReader();
            Bot fishingBot = new Bot();

            fishingBot.startBotting(1);
            //ObjectManager.sharedOM().test();
            Thread.Sleep(1111113000);
        }
Example #5
0
 public void ressurrect()
 {
     ChatWriter.send(MemoryHandler.process.MainWindowHandle, "/script RepopMe()");
     Thread.Sleep(2000);
     MemoryHandler.writeInt64(Offset.MOUSE_OVER_GUID, ObjectManager.sharedOM().getSHGUID());
     Thread.Sleep(500);
     ChatWriter.hitKey(0x042);
     Thread.Sleep(6000);
     ChatWriter.send(MemoryHandler.process.MainWindowHandle, "/run SelectGossipOption(1) AcceptXPLoss()");
     Thread.Sleep(6000);
 }
Example #6
0
        public void clickToLoot(Position3D position, Int64 guid)
        {
            //az értékek beírása a memoriába
            MemoryHandler.writeInt64(Offset.MOUSE_OVER_GUID, guid);
            ChatWriter.hitKey(0x042);

            //MemoryHandler.writeInt(CTM_Action, 7);

            //amíg az action 4, azaz mozgásban van, addig várok
            while (MemoryHandler.readInt(Offset.CTM_Action) == 7)
            {
                Thread.Sleep(200);
            }
            Thread.Sleep(400);
        }
Example #7
0
        public void takeOff()
        {
            ChatWriter.send(MemoryHandler.process.MainWindowHandle, "/run if IsMounted() == nil then CallCompanion('MOUNT', " + mountNum + ") end");//"/click MultiBarRightButton1"
            Thread.Sleep(2500);

            MemoryHandler.writeFloat(Offset.CTM_X, MemoryHandler.readFloat(X));
            MemoryHandler.writeFloat(Offset.CTM_Y, MemoryHandler.readFloat(Y));
            MemoryHandler.writeFloat(Offset.CTM_Z, MemoryHandler.readFloat(Z) + 800.0f);
            MemoryHandler.writeInt(Offset.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(Offset.CTM_Action, 4);

            Thread.Sleep(15000);
        }
Example #8
0
        public bool objExists(Int64 GUID)
        {
            int currObjPtr = objectManager + FIRST_OBJECT;
            int currObj    = MemoryHandler.readInt(currObjPtr);

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

                if (GUID == MemoryHandler.readHexAsInt64(currObj + GUID_OFFS))
                {
                    return(true);
                }
                currObjPtr = currObj + NEXT_OBJECT;
            }
            return(false);
        }
Example #9
0
        public Int64 getSHGUID()
        {
            int currObjPtr = objectManager + FIRST_OBJECT;
            int currObj    = MemoryHandler.readInt(currObjPtr);

            while (currObj != 0)
            {
                currObj = MemoryHandler.readInt(currObjPtr);
                if (SpiritHealer.SH_GUIDS.Contains(MemoryHandler.readHexAsInt64(currObj + GUID_OFFS)))
                {
                    return(MemoryHandler.readHexAsInt64(currObj + GUID_OFFS));
                }

                currObjPtr = currObj + NEXT_OBJECT;
            }

            return(0);
        }
Example #10
0
        public int getBobberBase()
        {
            int currObjPtr = objectManager + FIRST_OBJECT;
            int currObj    = MemoryHandler.readInt(currObjPtr);

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

                if (MemoryHandler.readHexAsInt64(currObj + 560) == Player.PLAYER_GUID)
                {
                    return(currObj);
                }

                currObjPtr = currObj + NEXT_OBJECT;
            }
            return(-1);
        }
Example #11
0
        public void clickToMove(Position3D position)
        {
            //az értékek beírása a memoriába
            MemoryHandler.writeFloat(Offset.CTM_X, position.x);
            MemoryHandler.writeFloat(Offset.CTM_Y, position.y);
            MemoryHandler.writeFloat(Offset.CTM_Z, position.z);
            MemoryHandler.writeInt(Offset.CTM_Action, 4);
            //MemoryHandler.writeFloat(CTM_Distance, 0.5f);

            //amíg az action 4, azaz mozgásban van, addig várok
            while (
                Math.Abs(MemoryHandler.readFloat(X) - position.x) > 10.0f &&
                Math.Abs(MemoryHandler.readFloat(Y) - position.y) > 10.0f
                )
            {
                Thread.Sleep(200);
            }
            Thread.Sleep(400);
        }
Example #12
0
        public void test()
        {
            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");

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

                    /*if (
                     *  MemoryHandler.readHexAsInt64(Offset.MOUSE_OVER_GUID) != 0 &&
                     *  MemoryHandler.readHexAsInt64(Offset.MOUSE_OVER_GUID) == MemoryHandler.readHexAsInt64(currObj + GUID_OFFS)
                     * ) {
                     *    System.Console.WriteLine(MemoryHandler.readInt(currObj + Offset.TYPE_ID));
                     * }*/

                    if (MemoryHandler.readHexAsInt64(currObj + 560) == 75435293781275187)
                    {
                        if (MemoryHandler.readInt(currObj + 0xBC) != 0)
                        {
                            System.Console.WriteLine(MemoryHandler.readInt16(currObj + 0xBC));
                            if (MemoryHandler.readInt16(currObj + 0xBC) == 1)
                            {
                                MemoryHandler.writeInt64(Offset.MOUSE_OVER_GUID, MemoryHandler.readHexAsInt64(currObj + GUID_OFFS));
                                ChatWriter.hitKey(0x42);
                            }
                        }
                    }

                    currObjPtr = currObj + NEXT_OBJECT;
                }
                Thread.Sleep(100);
            }
        }
Example #13
0
        public int getPlayerAddress()
        {
            int    LocalGUID  = 0xC0;
            String playerGUID = MemoryHandler.readHexAsString(objectManager + LocalGUID);

            Player.PLAYER_GUID = MemoryHandler.readHexAsInt64(objectManager + LocalGUID);

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

            while (currObj != 0)
            {
                currObj = MemoryHandler.readInt(currObjPtr);
                Int64 GUID = MemoryHandler.readHexAsInt64(currObj + GUID_OFFS);

                if (GUID == Player.PLAYER_GUID)
                {
                    return(currObj);
                }
                currObjPtr = currObj + NEXT_OBJECT;
            }
            return(0);
        }
Example #14
0
        public void clickToMove(Position position)
        {
            //az értékek beírása a memoriába
            MemoryHandler.writeFloat(Offset.CTM_X, position.x);
            MemoryHandler.writeFloat(Offset.CTM_Y, position.y);
            MemoryHandler.writeFloat(Offset.CTM_Z, MemoryHandler.readFloat(Z) - 10);
            MemoryHandler.writeInt(Offset.CTM_Action, 4);
            //MemoryHandler.writeFloat(CTM_Distance, 0.5f);

            //míg az x,y távolság nagyobb mint 1 várok
            while (
                Math.Abs(MemoryHandler.readFloat(X) - position.x) > 10.0f &&
                Math.Abs(MemoryHandler.readFloat(Y) - position.y) > 10.0f
                )
            {
                Thread.Sleep(200);
                System.Console.WriteLine(MemoryHandler.readFloat(Offset.CTM_X) + ", " + MemoryHandler.readFloat(Offset.CTM_Y) + ", " + MemoryHandler.readFloat(Offset.CTM_Z));
                //System.Console.WriteLine(position.x + ", " + position.y);
                System.Console.WriteLine(MemoryHandler.readFloat(X) + ", " + MemoryHandler.readFloat(Y));
            }
            MemoryHandler.writeInt(Offset.CTM_Action, 11);
            Thread.Sleep(400);
        }
Example #15
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(Offset.CTM_X, x);
            MemoryHandler.writeFloat(Offset.CTM_Y, y);
            MemoryHandler.writeFloat(Offset.CTM_Z, z);
            MemoryHandler.writeInt(Offset.CTM_Action, 4);

            //amíg az action 4, azaz mozgásban van, addig várok
            while (
                Math.Abs(MemoryHandler.readFloat(X) - position.x) > 10.0f &&
                Math.Abs(MemoryHandler.readFloat(Y) - position.y) > 10.0f
                )
            {
                Thread.Sleep(200);
            }
            Thread.Sleep(400);
        }
Example #16
0
 public int getMaxMana()
 {
     return(MemoryHandler.readInt(MAX_MANA));
 }
Example #17
0
        private ObjectManager()
        {
            int CurMgr = MemoryHandler.readInt(CUR_MGR_PTR);;

            objectManager = MemoryHandler.readInt(CurMgr + CUR_MGR_OFFSET);
        }
Example #18
0
 public bool isBobbing()
 {
     return(MemoryHandler.readInt16(baseAddr + IS_BOBING) == 1 ? true : false);
 }
Example #19
0
 public Bobber(int baseAddr)
 {
     this.baseAddr = baseAddr;
     GUID          = MemoryHandler.readHexAsInt64(baseAddr + GUID_OFFS);
 }
Example #20
0
 public float getZ()
 {
     return(MemoryHandler.readFloat(Z));
 }
Example #21
0
 public float getY()
 {
     return(MemoryHandler.readFloat(Y));
 }
Example #22
0
 public bool isMoving()
 {
     return(MemoryHandler.readInt(Offset.CTM_Action) == 4 ? true : false);
 }
Example #23
0
 public int getCurrMana()
 {
     return(MemoryHandler.readInt(CURR_MANA));
 }
Example #24
0
 public int getMaxHP()
 {
     return(MemoryHandler.readInt(MAX_HP));
 }
Example #25
0
 public int getCurrHP()
 {
     return(MemoryHandler.readInt(CURR_HP));
 }
Example #26
0
 public float getX()
 {
     return(MemoryHandler.readFloat(X));
 }
Example #27
0
 public Position getPosition()
 {
     position.x = MemoryHandler.readFloat(X);
     position.y = MemoryHandler.readFloat(Y);
     return(position);
 }