Exemplo n.º 1
0
        public async Task <Monster> GetNextMonster(Hunt _hunt, List <Monster> mobs)
        {
            await _hunt.GatherMobTimes(mobs);

            return(mobs.OrderBy(m => m.MinutesToSpawn).First());
        }
Exemplo n.º 2
0
        /*
         * Action:
         * 1.) Butterfly Wing
         * 2.) More->MVP->Click Icon(find smokie+array*110-24)
         * 3.) Click Go
         * 4.) Wait for timer
         * 5.) Find~
         *
         *
         */
        public async Task <bool> ScheduleHunt(List <int> minutes)
        {
            // Find Minimum
            int minimumIndex = 0;
            //for (int i=0;i<minutes.Count;i++)
            //{
            //    if (minutes[i] <= minimumIndex)
            //    {
            //        minimumIndex = i; // Set Minimum
            //    }
            //}

            //minimumIndex = 4;

            var  spawnedMinis = new List <int>();
            bool alreadyOnMap = false;

            for (int i = 0; i < minutes.Count; i++)
            {
                if (minutes[i] == 0)
                {
                    spawnedMinis.Add(i);
                }
                if (minutes[i] <= minimumIndex)
                {
                    minimumIndex = i; // Set Minimum
                }
            }

            var location = await ai.Action.GetCurrentLocation();

            ai.Log.Info($"Location: {location}...");

            if (spawnedMinis.Count() > 1)
            {
                if (spawnedMinis.Where(m => m == 0 || m == 2).Any() && location == "Prontera South Gate")
                {
                    minimumIndex = spawnedMinis.Where(m => m == 0 || m == 2).First();
                    alreadyOnMap = true;
                }
                if (spawnedMinis.Where(m => m == 1 || m == 3).Any() && location == "Labyrinth Forest")
                {
                    minimumIndex = spawnedMinis.Where(m => m == 1 || m == 3).First();
                    alreadyOnMap = true;
                }
            }



            // Act if idle
            if (isIdle == true)
            {
                if (minimumIndex == 0 && location == "Prontera South Gate")
                {
                    alreadyOnMap = true;
                }
                else if (minimumIndex == 2 && location == "Prontera South Gate")
                {
                    alreadyOnMap = true;
                }
                else if (minimumIndex == 1 && location == "Labyrinth Forest")
                {
                    alreadyOnMap = true;
                }
                else if (minimumIndex == 3 && location == "Labyrinth Forest")
                {
                    alreadyOnMap = true;
                }
                else if (minimumIndex == 4 && location == "Prontera West Gate")
                {
                    alreadyOnMap = true;
                }
                if (alreadyOnMap)
                {
                    isIdle = false;
                    ai.Log.Info($"Hunting {ai.MobName_Mini[minimumIndex]}...");
                    await ai.waitForSpawn((minutes[minimumIndex] * 1000 * 60));

                    isIdle = true;
                }
                else
                {
                    isIdle = false;

                    await Task.Delay(500);
                    await ButterFlyWing();

                    var teleport = false;
                    if (teleport)
                    {
                        //var rotarTime = await ai.FindRotarZairo();
                        ////await ai.Action.GoToKafraAgent();
                        ////await ai.Action.ClickScript();
                        ////532, 331
                        //if (rotarTime == 0)
                        //{
                        //    await ai.Action.teleportToGoblinForest();
                        //    await ai.waitForSpawn(Math.Max(0, (0)));//- delay
                        //}
                        var active = true;
                        while (active)
                        {
                            //RotarZairo rotoZairo = new RotarZairo(ai);
                            Smokie      smokie      = new Smokie(ai);
                            MonsterList monsterList = new MonsterList(
                                //rotoZairo,
                                smokie
                                );
                            ScanMini scanMini = new ScanMini(ai, new OCR(), ai.Log);

                            var _hunt = new Hunt(scanMini);
                            var mobs  = monsterList.GetMonsterList();
                            await _hunt.GatherMobTimes(mobs);

                            await _hunt.HuntMonsters(mobs);
                        }
                    }
                    else
                    {
                        await RouteToMob(minimumIndex);
                    }
                    //int delay = getDelay(minimumIndex);
                    //await Task.Delay(delay);
                    await DelayOnLocation(minimumIndex);

                    await ai.waitForSpawn(Math.Max(0, (minutes[minimumIndex] * 1000 * 60)));//- delay

                    isIdle = true;
                }
            }
            return(true);
        }
Exemplo n.º 3
0
        private static async Task ScheduleHunt(Hunt _hunt, List <Monster> mobs)
        {
            await _hunt.GatherMobTimes(mobs);

            await _hunt.HuntMonsters(mobs);
        }