Esempio n. 1
0
        public static void GetGathering(List<Gathering> gather)
        {
            try
            {
                uint startAddress = MemoryLocations.Database["gathermap"];
                const uint length = 156;

                gather.Clear();

                for (uint i = 0; i <= length; i += 4)
                {
                    Gathering newChar = new Gathering(startAddress + i);

                    if (newChar.Valid)
                        gather.Add(newChar);
                }

            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Print("Problem getting gather");
            }
        }
Esempio n. 2
0
 public float DistanceFrom(Gathering otherChar)
 {
     //Refresh()
     return(Calculations.PointDistance(Coordinate, otherChar.Coordinate));
 }
Esempio n. 3
0
            private void InitializeGatheringSpot(Character user, GatheringWindow uiWindow, Gathering currentSpot)
            {
                user.Refresh();
                Debug.Print("User Status: " + user.Status.ToString() + "  -  " + user.Status.ToString("X"));
                currentSpot.Target();
                Thread.Sleep(100);

                while (uiWindow.RefreshPointers() == false)
                {

                    user.Refresh();

                    user.Heading = user.Coordinate.AngleTo(currentSpot.Coordinate);

                    Utilities.Keyboard.KeyBoardHelper.KeyDown(Keys.W);

                    if (user.Coordinate.Distance2D(currentSpot.Coordinate) > DistanceThreshold)
                    {
                        user.Heading = user.Coordinate.AngleTo(currentSpot.Coordinate);

                        Utilities.Keyboard.KeyBoardHelper.KeyDown(Keys.W);
                        continue;
                    }

                    Utilities.Keyboard.KeyBoardHelper.KeyUp(Keys.W);

                    Thread.Sleep(350);
                    user.Refresh();
                    user.Heading = user.Coordinate.AngleTo(currentSpot.Coordinate);

                    Debug.Print("Waiting for window...");
                    Utilities.Keyboard.KeyBoardHelper.KeyPress(Keys.NumPad0);
                    Thread.Sleep(750);
                }
            }
Esempio n. 4
0
 public float DistanceFrom(Gathering otherChar)
 {
     //Refresh()
     return Calculations.PointDistance(Coordinate, otherChar.Coordinate);
 }
Esempio n. 5
0
            private void GatherSpot(Character user, Gathering currentSpot)
            {
                currentSpot.Refresh();
                user.Refresh();

                if (user.Health_Current == 0)
                {
                    _botstage = BotStage.Nothing;
                    _navigation.Stop();
                    return;
                }

                if (user.Coordinate.Distance(currentSpot.Coordinate) < 0.5)
                {
                    user.Heading = user.Coordinate.AngleTo(currentSpot.Coordinate);

                    Utilities.Keyboard.KeyBoardHelper.KeyDown(Keys.S);
                    Thread.Sleep(150);
                    Utilities.Keyboard.KeyBoardHelper.KeyUp(Keys.S);
                }

                // We are close enough.. stop running
                //Utilities.Keyboard.KeyBoardHelper.KeyUp(Keys.W);

                if (currentSpot.IsHidden == false)
                {
                    Utilities.Keyboard.KeyBoardHelper.KeyPress(Keys.NumPad0);
                    Thread.Sleep(350);
                }
                else
                {
                    //_ignorelist.Clear();
                    _navigation.Resume();
                    _botstage = BotStage.Detection;
                }

                //// Check if we should ignore the monster because it has not been claimed for a while..
                //// This typically happens if monster is out of line of sight.
                //if (_claimwatch.Elapsed.Seconds > 7 && currentSpot.IsClaimed == false)
                //{
                //    _claimwatch.Stop();
                //    _ignorelist.Add(currentSpot.ID);

                //    _navigation.Resume();
                //    _botstage = BotStage.Detection;
                //}
            }