static void SpecialRopeClimbing(int coorX, bool isClimbToTop, int topBoundary, int floorY, int leftDistance, int rightDistance, DateTime time_start)
        {
            int CharacterX, CharacterY, CharacterStatus;

            CharacterStatus = Hack.ReadInt(MainWindow.process, MainWindow.CharacterStatusBaseAdr, MainWindow.CharacterStatusOffset);
            DateTime time_end = DateTime.Now; //計時結束 取得目前時間
                                              //後面的時間減前面的時間後 轉型成TimeSpan即可印出時間差
            double result = ((time_end - time_start)).TotalMilliseconds;

            if (result >= 5000 && isStand())
            {
                if (_threadOfTraining.Name == "Petri1hit")
                {
                    Attack(1);
                }
                else
                {
                    Attack(2);
                }
                time_start = DateTime.Now;
            }
            if (CharacterStatus < 14 || CharacterStatus > 17)
            {
                GoToNearX(coorX, leftDistance, rightDistance);
                Hack.KeyPress(WindowHwnd, MainWindow.keyJump);
                GoToXInAir(coorX, 4, true, true);
            }
            while (true)
            {
                CharacterX      = Hack.ReadInt(MainWindow.process, MainWindow.CharacterXBaseAdr, MainWindow.CharacterXOffset);
                CharacterY      = Hack.ReadInt(MainWindow.process, MainWindow.CharacterYBaseAdr, MainWindow.CharacterYOffset);
                CharacterStatus = Hack.ReadInt(MainWindow.process, MainWindow.CharacterStatusBaseAdr, MainWindow.CharacterStatusOffset);
                if (CharacterY > floorY)
                {
                    break;
                }
                else if ((isClimbToTop && (CharacterY <= topBoundary) && ((CharacterStatus < 14) || (CharacterStatus > 17))) ||
                         (isClimbToTop == false) && (CharacterY <= topBoundary))
                {
                    Thread.Sleep(1);
                    Hack.KeyUp(WindowHwnd, Keys.Up);
                    Hack.KeyUp(WindowHwnd, Keys.Right);
                    Hack.KeyUp(WindowHwnd, Keys.Left);
                    return;
                }
                else if (CharacterX >= coorX - 20 && CharacterX <= coorX + 20 && CharacterY <= floorY)
                {
                    Hack.KeyDown(WindowHwnd, Keys.Up);
                }
                else
                {
                    RopeClimbing(coorX, isClimbToTop, topBoundary, floorY, leftDistance, rightDistance);
                }
            }
        }
示例#2
0
 static void GoToFloor(int targetFloor) //腳踩地才能CALL
 {
     if (targetFloor - nowFloor == 0)
     {
         return;
     }
     else if (targetFloor - nowFloor > 1)
     {
         GoToFloor(targetFloor - 1);
     }
     else if (targetFloor - nowFloor < -1)
     {
         GoToFloor(targetFloor + 1);
     }
     if (targetFloor - nowFloor == 1)
     {
         int originFloor = nowFloor;
         while (originFloor == nowFloor)
         {
             Hack.KeyDown(WindowHwnd, Keys.Down);
             Thread.Sleep(50);
             Hack.KeyPress(WindowHwnd, MainWindow.keyJump);
             Thread.Sleep(30);
             Hack.KeyUp(WindowHwnd, Keys.Down);
         }
     }
     else if (targetFloor - nowFloor == -1)
     {
         int originFloor = nowFloor;
         while (originFloor == nowFloor)
         {
             if (targetFloor == 4)
             {
                 RopeClimbing(-498, true, 792, 1032, 60, 60);
             }
             else if (targetFloor == 3)
             {
                 RopeClimbing(-766, true, 552, 792, 60, 60);
             }
             else if (targetFloor == 2)
             {
                 RopeClimbing(-498, true, 312, 552, 60, 60);
             }
             else if (targetFloor == 1)
             {
                 RopeClimbing(-766, true, 72, 312, 60, 60);
             }
         }
     }
 }
示例#3
0
 static void GoToFloor(int targetFloor)
 {
     if (targetFloor == 2)
     {
         while (nowFloor != 2)
         {
             Hack.KeyDown(WindowHwnd, Keys.Down);
             Thread.Sleep(50);
             Hack.KeyPress(WindowHwnd, MainWindow.keyTeleport);
             Thread.Sleep(30);
             Hack.KeyUp(WindowHwnd, Keys.Down);
         }
     }
 }
示例#4
0
        internal static void bossing()
        {
            int CharacterX, CharacterY, CharacterStatus;
            int originX = getCharacterX();
            int originY = getCharacterY();

            while (true)
            {
                CharacterX      = getCharacterX();
                CharacterY      = getCharacterY();
                CharacterStatus = getCharacterStatus();
                if (Distance(0, CharacterY, 0, originY) > 100)
                {
                    SystemSounds.Beep.Play();
                    //Thread.Sleep(200);
                    break;
                }
                AutoKey.mre_KeyPresser.Reset();
                if (Distance(CharacterX, CharacterY, originX, originY) > 50)
                {
                    GoToX(originX, 8, false, false, 0);
                }
                if (bossingFaceTo == 1)
                {
                    while (CharacterStatus % 2 != 1)
                    {
                        CharacterStatus = getCharacterStatus();
                        Hack.KeyDown(WindowHwnd, Keys.Left);
                        Thread.Sleep(20);
                        Hack.KeyUp(WindowHwnd, Keys.Left);
                        Thread.Sleep(100);
                    }
                }
                else if (bossingFaceTo == 2)
                {
                    while (CharacterStatus % 2 != 0)
                    {
                        CharacterStatus = getCharacterStatus();
                        Hack.KeyDown(WindowHwnd, Keys.Right);
                        Thread.Sleep(20);
                        Hack.KeyUp(WindowHwnd, Keys.Right);
                        Thread.Sleep(100);
                    }
                }
                AutoKey.mre_KeyPresser.Set();
                Thread.Sleep(1);
            }
        }
 static void GoToFloor(int targetFloor)//腳踩地才能CALL
 {
     if (targetFloor - nowFloor == 0)
     {
         return;
     }
     else if (targetFloor - nowFloor > 1)
     {
         GoToFloor(targetFloor - 1);
     }
     else if (targetFloor - nowFloor < -1)
     {
         GoToFloor(targetFloor + 1);
     }
     if (targetFloor - nowFloor == 1)
     {
         int originFloor = nowFloor;
         while (originFloor == nowFloor)
         {
             Hack.KeyDown(WindowHwnd, Keys.Down);
             Thread.Sleep(50);
             Hack.KeyPress(WindowHwnd, MainWindow.keyTeleport);
             Thread.Sleep(30);
             Hack.KeyUp(WindowHwnd, Keys.Down);
         }
     }
     else if (targetFloor - nowFloor == -1)
     {
         int originFloor = nowFloor;
         while (originFloor == nowFloor)
         {
             if (targetFloor == 3)
             {
                 SpecialRopeClimbing(631, true, -136, 104, 60, 60, DateTime.Now);
             }
             else if (targetFloor == 2)
             {
                 SpecialRopeClimbing(765, true, -376, -136, 60, 60, DateTime.Now);
             }
             else if (targetFloor == 1)
             {
                 SpecialRopeClimbing(572, true, 572, -510, 60, 60, DateTime.Now);
             }
         }
     }
 }
示例#6
0
 static void gotoFloor(int targetFloor)
 {
     while (nowFloor != targetFloor)
     {
         if (targetFloor == 3)
         {
             while (nowFloor != 3)
             {
                 GoToX(0);
                 Hack.KeyDown(WindowHwnd, Keys.Down);
                 Thread.Sleep(50);
                 Hack.KeyPress(WindowHwnd, MainWindow.keyJump);
                 Thread.Sleep(30);
                 Hack.KeyUp(WindowHwnd, Keys.Down);
             }
         }
         if (Math.Abs(targetFloor - nowFloor) > 1)
         {
             gotoFloor(targetFloor - 1);
             gotoFloor(targetFloor + 1);
         }
         else if (targetFloor == 2 && nowFloor == 3)
         {
             GoToX(-290, 0, true, true, 2);
         }
         else if (targetFloor == 4 && nowFloor == 3)
         {
             GoToX(290, 0, true, true, 4);
         }
         else if (targetFloor == 1 && nowFloor == 2)
         {
             GoToX(-825, 0, true, true, 1);
         }
         else if (targetFloor == 5 && nowFloor == 4)
         {
             GoToX(770, 0, true, true, 5);
         }
     }
 }
 static void gotoFloor(int targetFloor)
 {
     while (nowFloor != targetFloor)
     {
         if (nowFloor == 0)
         {
             return;
         }
         else if (targetFloor - nowFloor > 1)
         {
             gotoFloor(targetFloor - 1);
         }
         else if (targetFloor - nowFloor < -1)
         {
             gotoFloor(targetFloor + 1);
         }
         else if (targetFloor == 2 && nowFloor == 1)
         {
             Hack.KeyDown(WindowHwnd, Keys.Down);
             Thread.Sleep(50);
             Hack.KeyPress(WindowHwnd, MainWindow.keyJump);
             Thread.Sleep(30);
             Hack.KeyUp(WindowHwnd, Keys.Down);
         }
         else if (targetFloor == 3 && nowFloor == 2)
         {
             Hack.KeyDown(WindowHwnd, Keys.Down);
             Thread.Sleep(50);
             Hack.KeyPress(WindowHwnd, MainWindow.keyJump);
             Thread.Sleep(30);
             Hack.KeyUp(WindowHwnd, Keys.Down);
         }
         else if (targetFloor == 2 && nowFloor == 3)
         {
             RopeClimbing(-330, false, -196, 104, 60, 60);
         }
     }
 }
示例#8
0
        internal static void SpecialRopeClimbing(int coorX, bool isClimbToTop, int topBoundary, int floorY, int leftDistance, int rightDistance)
        {
            int CharacterX, CharacterY, CharacterStatus;

            CharacterStatus = Hack.ReadInt(MainWindow.process, MainWindow.CharacterStatusBaseAdr, MainWindow.CharacterStatusOffset);
            if (isStand())
            {
                GoToNearX(coorX, leftDistance, rightDistance);
                if (nowFloor == 3)
                {
                    Hack.KeyPress(WindowHwnd, MainWindow.keyJump);
                    GoToXInAir(coorX, 4, true, true);
                }
            }

            CharacterX      = Hack.ReadInt(MainWindow.process, MainWindow.CharacterXBaseAdr, MainWindow.CharacterXOffset);
            CharacterY      = Hack.ReadInt(MainWindow.process, MainWindow.CharacterYBaseAdr, MainWindow.CharacterYOffset);
            CharacterStatus = Hack.ReadInt(MainWindow.process, MainWindow.CharacterStatusBaseAdr, MainWindow.CharacterStatusOffset);
            if (CharacterY > floorY)
            {
                return;
            }
            else if ((isClimbToTop && (CharacterY <= topBoundary) && ((CharacterStatus < 14) || (CharacterStatus > 17))) ||
                     (isClimbToTop == false) && (CharacterY <= topBoundary))
            {
                Thread.Sleep(1);
                Hack.KeyUp(WindowHwnd, Keys.Up);
                Hack.KeyUp(WindowHwnd, Keys.Right);
                Hack.KeyUp(WindowHwnd, Keys.Left);
                return;
            }
            else if (CharacterX >= coorX - 20 && CharacterX <= coorX + 20 && CharacterY <= floorY)
            {
                Hack.KeyDown(WindowHwnd, Keys.Up);
            }
        }
        static void training2hit()
        {
            int counter = 0;

            if (isOnRope() && getCharacterX() != 294)
            {
                RopeExiting(true);
            }
            //training start
            while (true)
            {
                if (counter % 6 == 0)
                {
                    //go to position start
                    GoToLocationInWater(294, 920, 8, true, true, 0);
                    //go to position end
                    AutoKey.mre_PickUp.Reset();
                    for (int i = 0; i < 25; i++)
                    {
                        Hack.KeyPress(WindowHwnd, MainWindow.keyCombo1);
                    }
                    Thread.Sleep(MainWindow.delayComboKey1);
                    for (int i = 0; i < 25; i++)
                    {
                        Hack.KeyPress(WindowHwnd, MainWindow.keyCombo2);
                    }
                    Thread.Sleep(MainWindow.delayComboKey2);
                    AutoKey.mre_PickUp.Set();
                    RopeExiting(true);
                    GoToLocationInWater(50, 887);
                }
                else if (counter % 3 == 0)
                {
                    //go to position start
                    GoToLocationInWater(294, 920, 8, true, true, 0);
                    //go to position end
                    AutoKey.mre_PickUp.Reset();
                    //for (int i = 0; i < 25; i++)
                    Hack.KeyDown(WindowHwnd, MainWindow.keySkill);
                    Thread.Sleep(1000);
                    Hack.KeyUp(WindowHwnd, MainWindow.keySkill);
                    AutoKey.mre_PickUp.Set();
                    RopeExiting(true);
                    GoToLocationInWater(50, 887);
                }
                GoToLocationInWater(-141, -141);
                Attack(1);
                GoToLocationInWater(-50, -110);
                Attack(1);
                GoToLocationInWater(-50, 185);
                Attack(2);
                GoToLocationInWater(-50, 561);
                Attack(1);
                GoToLocationInWater(-50, 776);
                Attack(1);
                GoToLocationInWater(-50, 996);
                Attack(1);
                GoToLocationInWater(-200, 1225);
                Attack(3);

                counter++;
            }
        }
示例#10
0
 static void gotoFloor(int targetFloor)
 {
     while (nowFloor != targetFloor)
     {
         if (nowFloor == 0)
         {
             return;
         }
         else if (targetFloor - nowFloor > 1)
         {
             gotoFloor(targetFloor - 1);
         }
         else if (targetFloor - nowFloor < -1)
         {
             gotoFloor(targetFloor + 1);
         }
         else if (targetFloor == 2 && nowFloor == 1)
         {
             GoToX(-39);
         }
         else if (targetFloor == 3 && nowFloor == 2)
         {
             GoToX(-50);
             Hack.KeyDown(WindowHwnd, Keys.Down);
             Thread.Sleep(50);
             Hack.KeyPress(WindowHwnd, MainWindow.keyTeleport);
             Thread.Sleep(30);
             Hack.KeyUp(WindowHwnd, Keys.Down);
         }
         else if (targetFloor == 4 && nowFloor == 3)
         {
             GoToX(533);
             Hack.KeyDown(WindowHwnd, Keys.Down);
             Thread.Sleep(50);
             Hack.KeyPress(WindowHwnd, MainWindow.keyTeleport);
             Thread.Sleep(30);
             Hack.KeyUp(WindowHwnd, Keys.Down);
         }
         else if (targetFloor == 5 && nowFloor == 4)
         {
             GoToX(-128);
             Hack.KeyDown(WindowHwnd, Keys.Down);
             Thread.Sleep(50);
             Hack.KeyPress(WindowHwnd, MainWindow.keyTeleport);
             Thread.Sleep(30);
             Hack.KeyUp(WindowHwnd, Keys.Down);
         }
         else if (targetFloor == 4 && nowFloor == 5)
         {
             GoToX(-128);
             Hack.KeyDown(WindowHwnd, Keys.Up);
             Thread.Sleep(50);
             Hack.KeyPress(WindowHwnd, MainWindow.keyTeleport);
             Thread.Sleep(30);
             Hack.KeyUp(WindowHwnd, Keys.Up);
         }
         else if (targetFloor == 3 && nowFloor == 4)
         {
             GoToX(615);
             Hack.KeyDown(WindowHwnd, Keys.Up);
             Thread.Sleep(50);
             Hack.KeyPress(WindowHwnd, MainWindow.keyTeleport);
             Thread.Sleep(30);
             Hack.KeyUp(WindowHwnd, Keys.Up);
         }
         else if (targetFloor == 2 && nowFloor == 3)
         {
             GoToX(-50);
             Hack.KeyDown(WindowHwnd, Keys.Up);
             Thread.Sleep(50);
             Hack.KeyPress(WindowHwnd, MainWindow.keyTeleport);
             Thread.Sleep(30);
             Hack.KeyUp(WindowHwnd, Keys.Up);
         }
         else if (targetFloor == 1 && nowFloor == 2)
         {
             int CharacterY = getCharacterY();
             if (CharacterY > -616)
             {
                 GoToX(-50);
                 Hack.KeyDown(WindowHwnd, Keys.Up);
                 Thread.Sleep(50);
                 Hack.KeyPress(WindowHwnd, MainWindow.keyTeleport);
                 Thread.Sleep(30);
                 Hack.KeyUp(WindowHwnd, Keys.Up);
             }
             GoToX(290);
         }
     }
 }
示例#11
0
        static void training1hit()
        {
            int counter = 0;

            Thread.Sleep(500);
            if (isOnRope() && getCharacterX() != -58)
            {
                RopeExiting(true);
            }
            //training start
            while (true)
            {
                if (counter % 8 == 0)
                {
                    //go to position start
                    while (getCharacterStatus() < 14 || getCharacterStatus() > 17 || CharacterX != -58 || getCharacterY() > 979)
                    {
                        if (getCharacterStatus() >= 14 && getCharacterStatus() <= 17 && CharacterX != -58)
                        {
                            RopeExiting(true);
                        }
                        GoToFloor(3);
                        if (CharacterX < 0)
                        {
                            SpecialRopeClimbing(-58, false, 979, 1180, 60, -60);
                        }
                        else if (CharacterX > 0)
                        {
                            SpecialRopeClimbing(-58, false, 979, 1180, -75, 75);
                        }
                    }
                    Hack.KeyUp(WindowHwnd, Keys.Up);
                    //go to position end
                    AutoKey.mre_PickUp.Reset();
                    for (int i = 0; i < 25; i++)
                    {
                        Hack.KeyPress(WindowHwnd, MainWindow.keyCombo1);
                    }
                    Thread.Sleep(MainWindow.delayComboKey1);
                    for (int i = 0; i < 25; i++)
                    {
                        Hack.KeyPress(WindowHwnd, MainWindow.keyCombo2);
                    }
                    Thread.Sleep(MainWindow.delayComboKey2);
                    AutoKey.mre_PickUp.Set();
                    GoToFloor(2);
                }
                else if (counter % 4 == 0)
                {
                    //go to position start
                    while (getCharacterStatus() < 14 || getCharacterStatus() > 17 || CharacterX != -58 || getCharacterY() > 979)
                    {
                        if (getCharacterStatus() >= 14 && getCharacterStatus() <= 17 && CharacterX != -58)
                        {
                            RopeExiting(true);
                        }
                        GoToFloor(3);
                        if (CharacterX < 0)
                        {
                            SpecialRopeClimbing(-58, false, 979, 1180, 60, -60);
                        }
                        else if (CharacterX > 0)
                        {
                            SpecialRopeClimbing(-58, false, 979, 1180, -75, 75);
                        }
                    }
                    Hack.KeyUp(WindowHwnd, Keys.Up);
                    //go to position end
                    AutoKey.mre_PickUp.Reset();
                    for (int i = 0; i < 50; i++)
                    {
                        Hack.KeyPress(WindowHwnd, MainWindow.keySkill);
                    }
                    AutoKey.mre_PickUp.Set();
                    GoToFloor(2);
                }
                else
                {
                    while (nowFloor != 2)
                    {
                        GoToFloor(2);
                    }
                }
                GoToX(180);
                Attack(1);
                GoToX(650);
                GoToX(878, 20, false, false, 0);
                Attack(1);
                if (CharacterX >= 773)
                {
                    GoToX(878);
                }
                GoToX(380);
                while (getCharacterY() > 1140 && nowFloor == 3)
                {
                    JumpingOver(350, true);
                }
                GoToX(25);
                Attack(1);

                /* if (counter % 6 == 0 && counter > 0)
                 * {
                 *   GoToFloor(1);
                 *   GoToX(-183);
                 * }*/


                counter++;
            }
        }
示例#12
0
 static void GoToFloor(int targetFloor)//腳踩地才能CALL
 {
     if (targetFloor - nowFloor == 0)
     {
         return;
     }
     else if (targetFloor - nowFloor > 1)
     {
         GoToFloor(targetFloor - 1);
     }
     else if (targetFloor - nowFloor < -1)
     {
         GoToFloor(targetFloor + 1);
     }
     if (targetFloor - nowFloor == 1)
     {
         int originFloor = nowFloor;
         while (originFloor == nowFloor)
         {
             GoToX(35, 8, true, false, 0);
             if (originFloor == nowFloor)
             {
                 Hack.KeyDown(WindowHwnd, Keys.Down);
                 Thread.Sleep(50);
                 Hack.KeyPress(WindowHwnd, MainWindow.keyJump);
                 Thread.Sleep(30);
                 Hack.KeyUp(WindowHwnd, Keys.Down);
             }
         }
     }
     else if (targetFloor - nowFloor == -1)
     {
         int originFloor = nowFloor;
         while (originFloor == nowFloor)
         {
             if (targetFloor == 3)
             {
                 RopeClimbing(-316, true, 1247, 1480, 60, 60);
                 if (nowFloor == 3)
                 {
                     upstairTeleport(1098);
                 }
             }
             else if (targetFloor == 2)
             {
                 while (getCharacterY() > 875 && nowFloor == 3)
                 {
                     if (CharacterX < 0)
                     {
                         SpecialRopeClimbing(-58, true, 875, 1257, 60, -60);
                     }
                     else if (CharacterX >= 0)
                     {
                         SpecialRopeClimbing(-58, true, 875, 1257, -75, 75);
                     }
                 }
                 if (nowFloor == 2)
                 {
                     upstairTeleport(774);
                 }
             }
             else if (targetFloor == 1)
             {
                 RopeClimbing(-21, true, 481, 780, 60, 60);
             }
         }
     }
 }
示例#13
0
        internal static new void GoToX(int coorX, int deviation, bool isTeleport, bool isWithUp, int targetFloor)
        {
            int CharacterX;
            int leftBoundary     = coorX - deviation;
            int rightBoundary    = coorX + deviation;
            int leftFarBoundary  = coorX - 150;
            int rightFarBoundary = coorX + 150;

            while (true)
            {
                CharacterX = Hack.ReadInt(MainWindow.process, MainWindow.CharacterXBaseAdr, MainWindow.CharacterXOffset);
                if (nowFloor == targetFloor)
                {
                    return;
                }
                else if (CharacterX >= leftBoundary && CharacterX <= rightBoundary)
                {
                    Hack.KeyUp(WindowHwnd, Keys.Up);
                    Hack.KeyUp(WindowHwnd, Keys.Down);
                    Hack.KeyUp(WindowHwnd, Keys.Left);
                    Hack.KeyUp(WindowHwnd, Keys.Right);
                    return;
                }
                else if (CharacterX < leftFarBoundary)
                {
                    Hack.KeyUp(WindowHwnd, Keys.Left);
                    Hack.KeyDown(WindowHwnd, Keys.Right);
                    if (isTeleport)
                    {
                        Hack.KeyPress(WindowHwnd, MainWindow.keyTeleport);
                    }
                }
                else if (CharacterX > rightFarBoundary)
                {
                    Hack.KeyUp(WindowHwnd, Keys.Right);
                    Hack.KeyDown(WindowHwnd, Keys.Left);
                    if (isTeleport)
                    {
                        Hack.KeyPress(WindowHwnd, MainWindow.keyTeleport);
                    }
                }
                else if (CharacterX > leftFarBoundary && CharacterX < leftBoundary)
                {
                    Hack.KeyUp(WindowHwnd, Keys.Left);
                    Hack.KeyDown(WindowHwnd, Keys.Right);
                    if (isWithUp)
                    {
                        Hack.KeyDown(WindowHwnd, Keys.Up);
                    }
                }
                else if (CharacterX > rightBoundary && CharacterX < rightFarBoundary)
                {
                    Hack.KeyUp(WindowHwnd, Keys.Right);
                    Hack.KeyDown(WindowHwnd, Keys.Left);
                    if (isWithUp)
                    {
                        Hack.KeyDown(WindowHwnd, Keys.Up);
                    }
                }
                Thread.Sleep(10);
            }
        }