internal static void PickUp() { while (true) { Hack.KeyDown(MainWindow.WindowHwnd, MainWindow.keyPickUp); Thread.Sleep(50); mre_PickUp.WaitOne(); } }
internal static void KeyPresser() { while (MainWindow.keyWantToPress != System.Windows.Forms.Keys.None) { Hack.KeyDown(MainWindow.WindowHwnd, MainWindow.keyWantToPress); Thread.Sleep(50); mre_KeyPresser.WaitOne(); } }
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); } } }
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); } } } }
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); } } }
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); } } } }
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); } } }
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++; } }
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); } } }
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); } } } }
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); } }
internal static void bottingGobyShopping() { // Goby -> Aquarium while (Hack.ReadInt(MainWindow.process, MainWindow.MapIDBaseAdr, MainWindow.MapIDOffset) != 230000000) { int doorX, doorY, tempDoorX, tempDoorY; doorX = Hack.ReadInt(MainWindow.process, MainWindow.DoorXBaseAdr); doorY = Hack.ReadInt(MainWindow.process, MainWindow.DoorYBaseAdr); tempDoorX = doorX; tempDoorY = doorY; while (doorX == tempDoorX && doorY == tempDoorY) { doorX = Hack.ReadInt(MainWindow.process, MainWindow.DoorXBaseAdr); doorY = Hack.ReadInt(MainWindow.process, MainWindow.DoorYBaseAdr); Hack.KeyPress(WindowHwnd, MainWindow.keyDoor); Thread.Sleep(1000); } DateTime time_start = DateTime.Now; double result = 0; while (Hack.ReadInt(MainWindow.process, MainWindow.MapIDBaseAdr, MainWindow.MapIDOffset) == 230040100 && result < 8000) { GoToLocationInWater(doorX, doorY, 5, true, true, 230000000); DateTime time_end = DateTime.Now; //計時結束 取得目前時間 //後面的時間減前面的時間後 轉型成TimeSpan即可印出時間差 result = ((time_end - time_start)).TotalMilliseconds; } } AutoKey.mre_PickUp.Reset(); // Aquarium -> Aquarium Store while (Hack.ReadInt(MainWindow.process, MainWindow.MapIDBaseAdr, MainWindow.MapIDOffset) != 230000002) { while (Hack.ReadInt(MainWindow.process, MainWindow.MapIDBaseAdr, MainWindow.MapIDOffset) == 230000000) { GoToLocationInWater(190, 11, 5, true, true, 230000002); } } // Selling while (!Hack.CompareColor(WindowHwnd, 580, 174, "EE8844", "111111")) { int screenX, screenY; Hack.ClientToScreen(WindowHwnd, 267, 65, out screenX, out screenY); Hack.MoveTo(screenX, screenY);//seller of Aqua store Hack.LeftDoubleClick(); } selling(); // Aquarium Store -> Aquarium while (Hack.ReadInt(MainWindow.process, MainWindow.MapIDBaseAdr, MainWindow.MapIDOffset) != 230000000) { Hack.KeyDown(WindowHwnd, Keys.Up); while (Hack.ReadInt(MainWindow.process, MainWindow.MapIDBaseAdr, MainWindow.MapIDOffset) == 230000002) { GoToX(-349, 0, false, true, 230000000); Hack.KeyDown(WindowHwnd, Keys.Up); GoToX(-351, 0, false, true, 230000000); Hack.KeyDown(WindowHwnd, Keys.Up); GoToX(-347, 0, false, true, 230000000); Hack.KeyDown(WindowHwnd, Keys.Up); } } // Aquarium -> Goby while (Hack.ReadInt(MainWindow.process, MainWindow.MapIDBaseAdr, MainWindow.MapIDOffset) != 230040100) { GoToLocationInWater(195, 340, 5, true, true, 230040100); while (Hack.ReadInt(MainWindow.process, MainWindow.MapIDBaseAdr, MainWindow.MapIDOffset) == 230000000) { GoToLocationInWater(674, 340, 5, true, true, 230040100); } } AutoKey.mre_PickUp.Set(); }