public async Task RunBot(Log log) { var active = true; AI ai = new AI(log); RotarZairo rotoZairo = new RotarZairo(ai); Smokie smokie = new Smokie(ai); EclipseSouthGate eclipseSG = new EclipseSouthGate(ai); EclipseLabyrinth eclipseL = new EclipseLabyrinth(ai); Mastering mastering = new Mastering(ai); VocalWestGate vocalWG = new VocalWestGate(ai); VagabondWolf vagabondWolf = new VagabondWolf(ai); Toad toad = new Toad(ai); VocalLabyrinth VocalL = new VocalLabyrinth(ai); DragonFly dragonFly = new DragonFly(ai); WoodGoblin woodGoblin = new WoodGoblin(ai); //toad //vagabond-wolf //dragon-fly //MonsterList monsterList = new MonsterList( // //rotoZairo // smokie // ); var monsterList = new List <Monster>() { smokie, eclipseSG, eclipseL, VocalL, mastering, vocalWG, rotoZairo, vagabondWolf, toad, woodGoblin, dragonFly }; ScanMini scanMini = new ScanMini(ai, new OCR(), ai.Log); var _hunt = new Hunt(scanMini); var mobs = monsterList;//monsterList.GetMonsterList(); while (active) { var nextMonster = await GetNextMonster(_hunt, mobs); bool arrived = await nextMonster.GoToLocation(); if (arrived) { await nextMonster.Hunt(); } //await ScheduleHunt(_hunt, mobs); } }
/* * 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); }
public Hunt( ScanMini scanMini ) { _scanMini = scanMini; }