public static async Task <bool> FindSpecificTarget() { await HideCorpsesTask(); Keyboard.KeyPress(DESELECT_TARGETS_KEY); await Task.Delay(200); EQState currentState = EQState.GetCurrentEQState(); if (currentState.targetInfo.con != MonsterCon.NONE) { return(false); } Keyboard.KeyPress(DESELECT_TARGETS_KEY); await Task.Delay(200); Keyboard.KeyPress(FIND_SPECIAL_MOB_KEY); await Task.Delay(500); currentState = EQState.GetCurrentEQState(); if (currentState.targetInfo.con != MonsterCon.NONE && currentState.characterState != EQState.CharacterState.COMBAT) { return(true); } return(false); }
public static async Task <bool> PetPullTask() { // Find Target Keyboard.KeyPress(PET_ATTACK_KEY); await Task.Delay(500); Keyboard.KeyPress(PET_ATTACK_KEY); await Task.Delay(500); Keyboard.KeyPress(PET_ATTACK_KEY); await Task.Delay(500); // wait until they hit target EQState currentState = EQState.GetCurrentEQState(); while (currentState.targetHealth > 0.98) { await Task.Delay(300); currentState = EQState.GetCurrentEQState(); } // pull back Keyboard.KeyPress(PET_BACK_KEY); await Task.Delay(500); Keyboard.KeyPress(PET_BACK_KEY); await Task.Delay(500); Keyboard.KeyPress(PET_BACK_KEY); await Task.Delay(1000); Keyboard.KeyPress(PET_BACK_KEY); await Task.Delay(1000); // wait till they get back await Task.Delay(500); return(true); }
public static async Task <bool> RestUntilFullyHealedTask() { float hpThreshold = 0.98f; EQState currentState = EQState.GetCurrentEQState(); if (currentState.health >= hpThreshold) { return(true); } // rest Keyboard.KeyPress(REST_KEY); await Task.Delay(1000); while (currentState.health < hpThreshold) { await Task.Delay(2000); currentState = EQState.GetCurrentEQState(); if (!(currentState.characterState == EQState.CharacterState.SITTING || currentState.characterState == EQState.CharacterState.POISONED) && currentState.targetHealth > 0.02) { Console.WriteLine("CS:" + currentState.characterState); return(false); } } return(true); }
public static async Task <bool> SpamZeroTask(int fullManaBarsToSpam) { await FocusOnEQWindowTask(); int timesSpammed = 0; while (timesSpammed < fullManaBarsToSpam) { timesSpammed++; EQState currentState = EQState.GetCurrentEQState(); while (currentState.mana > 0.10) { Keyboard.KeyPress(FIND_SPECIAL_MOB_KEY); await Task.Delay(500); Keyboard.KeyPress(FIND_SPECIAL_MOB_KEY); await Task.Delay(500); Keyboard.KeyPress(FIND_SPECIAL_MOB_KEY); await Task.Delay(8000); currentState = EQState.GetCurrentEQState(); } await RestUntilFullManaTask(); } return(true); }
public static async Task <bool> LevelSkillUntilDeadTask() { await LevelUpSkillTask(); await Task.Delay(5000); EQState currentState = EQState.GetCurrentEQState(); return(currentState.targetHealth <= 0.00); }
public static async Task <bool> NukeTask() { Keyboard.KeyPress(NUKE_KEY); await Task.Delay(1000); Keyboard.KeyPress(NUKE_KEY); await Task.Delay(1000); Keyboard.KeyPress(NUKE_KEY); await Task.Delay(1000); EQState currentState = EQState.GetCurrentEQState(); return(currentState.targetHealth <= 0.00); }
public static async Task <bool> NukeUntilDeadTask() { EQState currentState = EQState.GetCurrentEQState(); int nukeAttempts = 1; while (currentState.targetHealth > 0.00 && nukeAttempts < 50) { nukeAttempts++; await NukeTask(); currentState = EQState.GetCurrentEQState(); } return(true); }
public static async Task <bool> WaitUntilDeadTask() { EQState currentState = EQState.GetCurrentEQState(); int attempts = 0; while (currentState.targetHealth > 0.00 && currentState.targetInfo.con != MonsterCon.NONE && attempts < 150) { attempts++; await Task.Delay(100); currentState = EQState.GetCurrentEQState(); } await Task.Delay(50); return(true); }
public static EQState GetCurrentEQState() { EQState currentEQState = new EQState(); Bitmap bm = EQScreen.GetEQBitmap(); currentEQState.mana = GetManaPercentFilled(bm); currentEQState.health = GetHealthPercentFilled(bm); currentEQState.targetHealth = GetTargetHealthPercentFilled(bm); currentEQState.petHealth = GetPetHealthPercentFilled(bm); currentEQState.targetInfo = GetTargetMonster(bm); currentEQState.characterState = GetCharacterState(bm); currentEQState.minutesSinceMidnight = GetMinutesSinceMidnight(); bm.Dispose(); mostRecentState = currentEQState; return(currentEQState); }
// Macro should be close to // /target a_ public static async Task <bool> FindAnyTargetWithMacroTask() { int findTargetAttempts = 1; while (findTargetAttempts < 5) { // Find Target Keyboard.KeyPress(FIND_NORMAL_MOB_KEY); await Task.Delay(1500); EQState currentState = EQState.GetCurrentEQState(); if (currentState.targetInfo.con != MonsterCon.NONE) { return(true); } findTargetAttempts++; } return(false); }
public static async Task <bool> FindNearestTargetTask(bool cycleCamera = false, MonsterCon minCon = MonsterCon.GREY, MonsterCon maxCon = MonsterCon.RED) { Keyboard.KeyPress(DESELECT_TARGETS_KEY); await Task.Delay(200); int findTargetAttempts = 1; int maxFindAttempts = 100; while (findTargetAttempts <= 100) { // Find Target Keyboard.KeyPress(TARGET_NEAREST_MOB_KEY); await Task.Delay(500); EQState currentState = EQState.GetCurrentEQState(); bool conInCorrectRange = ((int)currentState.targetInfo.con >= (int)minCon && (int)currentState.targetInfo.con <= (int)maxCon); Console.WriteLine(String.Format("min {0} max {1} target {2} in range? {3}", (int)minCon, (int)maxCon, (int)currentState.targetInfo.con, conInCorrectRange)); if ((int)currentState.targetInfo.con >= (int)minCon && (int)currentState.targetInfo.con <= (int)maxCon) { return(true); } if (currentState.targetInfo.con != MonsterCon.NONE) { Keyboard.KeyPress(DESELECT_TARGETS_KEY); await Task.Delay(200); } //if (currentState.targetInfo.con != MonsterCon.NONE) { return true; } findTargetAttempts++; if (findTargetAttempts % 10 == 0) { // change camera view if (cycleCamera) { Keyboard.KeyPress(CHANGE_CAMERA_ANGLE_KEY); await Task.Delay(500); } } } return(false); }
public static async Task <bool> PetAttackTask() { // Find Target Keyboard.KeyPress(PET_ATTACK_KEY); await Task.Delay(500); // wait until they hit target EQState currentState = EQState.GetCurrentEQState(); int attackTargetAttempts = 1; while (currentState.targetHealth > 0.98 && attackTargetAttempts <= 10) { attackTargetAttempts++; if (attackTargetAttempts % 3 == 0) { Keyboard.KeyPress(PET_ATTACK_KEY); } await Task.Delay(1000); currentState = EQState.GetCurrentEQState(); } return(true); }
async Task <bool> DmgShieldLoopTask() { updateStatus("Kicking off core gameplay loop"); lastFarmingLimitTime = DateTimeOffset.Now.ToUnixTimeMilliseconds(); EQState currentEQState = EQState.GetCurrentEQState(); PlayerState currentPlayerState = PlayerState.WAITING_TO_FOCUS; while (currentPlayerState != PlayerState.EXITING_CORE_GAMEPLAY_LOOP) { if (EQScreen.currentCharacterName != "Yoyokazoo") { await Task.Delay(100); continue; } await EQTask.FocusOnEQWindowTask(); currentEQState = EQState.GetCurrentEQState(); // always update EQState here? switch (currentPlayerState) { case PlayerState.WAITING_TO_FOCUS: updateStatus("Focusing on EQ Window"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.FocusOnEQWindowTask(), PlayerState.FOCUSED_ON_EQ_WINDOW, PlayerState.EXITING_CORE_GAMEPLAY_LOOP); break; case PlayerState.FOCUSED_ON_EQ_WINDOW: updateStatus("Focused on EQ Window"); await EQTask.HideCorpsesTask(); currentPlayerState = PlayerState.CHECK_FARMING_TIME_LIMIT; break; case PlayerState.CHECK_FARMING_TIME_LIMIT: updateStatus("Checking farming time limit"); currentPlayerState = PlayerState.WAITING_FOR_MANA; if (!CurrentTimeInsideDuration(lastFarmingLimitTime, FARMING_LIMIT_TIME_MILLIS)) { currentPlayerState = PlayerState.EXITING_CORE_GAMEPLAY_LOOP; } break; case PlayerState.WAITING_FOR_MANA: updateStatus("Resting for mana"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.RestUntilFullManaTask(), PlayerState.CHECKING_FOR_PYZJN, PlayerState.WAITING_FOR_MANA); break; case PlayerState.CHECKING_FOR_PYZJN: updateStatus("Checking for Pyzjn"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.FindSpecificTarget(), PlayerState.KILLING_TARGET_ASAP, PlayerState.FINDING_SUITABLE_TARGET); break; case PlayerState.KILLING_TARGET_ASAP: updateStatus("Killing target ASAP"); SlackHelper.SendSlackMessageAsync("Killing Lockjaw, check for loot"); await EQTask.PetAttackTask(); await EQTask.NukeTask(); await EQTask.EnterCombatTask(); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.NukeUntilDeadTask(), PlayerState.CHECK_FARMING_TIME_LIMIT, PlayerState.CHECK_FARMING_TIME_LIMIT); break; case PlayerState.FINDING_SUITABLE_TARGET: updateStatus("Finding Suitable Target"); bool foundTargetResult = await EQTask.FindAnyTargetWithMacroTask(); currentPlayerState = ChangeStateBasedOnBool(foundTargetResult, PlayerState.CASTING_DMG_SHIELD_ON_PET, PlayerState.CHECK_FARMING_TIME_LIMIT); break; case PlayerState.CASTING_DMG_SHIELD_ON_PET: updateStatus("Casting Damage Shield on target"); if (!CurrentTimeInsideDuration(lastDmgShieldCastTime, DMG_SHIELD_TIME_MILLIS)) { lastDmgShieldCastTime = DateTimeOffset.Now.ToUnixTimeMilliseconds(); await EQTask.DamageShieldBotTask(); } await Task.Delay(5000); await EQTask.DeselectTargetTask(); currentPlayerState = PlayerState.CHECK_FARMING_TIME_LIMIT; break; } EQScreen.SetNextCharacter(); } updateStatus("Exited Core Gameplay, attempting to camp"); await EQTask.CampTask(); EQScreen.SetNextCharacter(); return(true); }
async Task <bool> DruidLoopTask() { updateStatus("Kicking off druid loop"); EQState currentEQState = EQState.GetCurrentEQState(); PlayerState currentPlayerState = PlayerState.WAITING_TO_FOCUS; while (currentPlayerState != PlayerState.EXITING_CORE_GAMEPLAY_LOOP) { if (EQScreen.currentCharacterName != "Durdle") { await Task.Delay(100); continue; } await EQTask.FocusOnEQWindowTask(); currentEQState = EQState.GetCurrentEQState(); // always update EQState here? switch (currentPlayerState) { case PlayerState.WAITING_TO_FOCUS: updateStatus("Focusing on EQ Window"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.FocusOnEQWindowTask(), PlayerState.FOCUSED_ON_EQ_WINDOW, PlayerState.EXITING_CORE_GAMEPLAY_LOOP); break; case PlayerState.FOCUSED_ON_EQ_WINDOW: updateStatus("Focused on EQ Window"); await EQTask.HideCorpsesTask(); currentPlayerState = PlayerState.CHECK_COMBAT_STATUS; break; case PlayerState.CHECK_FARMING_TIME_LIMIT: updateStatus("Checking farming time limit"); if (!CurrentTimeInsideDuration(lastFarmingLimitTime, FARMING_LIMIT_TIME_MILLIS)) { lastFarmingLimitTime = DateTimeOffset.Now.ToUnixTimeMilliseconds(); } currentPlayerState = PlayerState.CHECK_COMBAT_STATUS; break; case PlayerState.CHECK_COMBAT_STATUS: updateStatus("Checking combat status"); currentPlayerState = ChangeStateBasedOnBool(currentEQState.characterState == EQState.CharacterState.COMBAT, PlayerState.PULL_WITH_NUKE, PlayerState.WAITING_FOR_MANA); break; case PlayerState.PULL_WITH_NUKE: updateStatus("Pulling with Nuke"); await EQTask.PullWithSpellTask(); await EQTask.EnterCombatTask(); currentPlayerState = PlayerState.KILLING_TARGET_ASAP; break; case PlayerState.KILLING_TARGET_ASAP: updateStatus("Killing target ASAP"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.NukeTask(), PlayerState.ATTEMPT_TO_LOOT, PlayerState.KILLING_TARGET_ASAP); break; case PlayerState.WAITING_FOR_MANA: updateStatus("Resting for mana"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.RestUntilFullManaTask(), PlayerState.CASTING_BURNOUT_ON_PET, PlayerState.WAITING_FOR_MANA); break; case PlayerState.CASTING_BURNOUT_ON_PET: updateStatus("Casting skin like rock"); if (!CurrentTimeInsideDuration(lastSkinLikeRockCastTime, SKIN_LIKE_ROCK_MILLIS)) { lastSkinLikeRockCastTime = DateTimeOffset.Now.ToUnixTimeMilliseconds(); await EQTask.ApplyPetBuffTask(); await EQTask.RestTask(); } currentPlayerState = PlayerState.FINDING_SUITABLE_TARGET; break; case PlayerState.FINDING_SUITABLE_TARGET: updateStatus("Finding Suitable Target"); //bool foundTargetResult = await EQTask.FindNearestTargetTask(true); bool foundTargetResult = await EQTask.FindAnyTargetWithMacroTask(); currentPlayerState = ChangeStateBasedOnBool(foundTargetResult, PlayerState.PULL_WITH_NUKE, PlayerState.CHECK_COMBAT_STATUS); break; case PlayerState.ATTEMPT_TO_LOOT: updateStatus("Attempting to loot"); await EQTask.ScoochForwardTask(); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.LootTask(true), PlayerState.HIDE_CORPSES, PlayerState.HIDE_CORPSES); break; case PlayerState.HIDE_CORPSES: updateStatus("Hiding Corpses"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.HideCorpsesTask(), PlayerState.CHECK_FARMING_TIME_LIMIT, PlayerState.CHECK_FARMING_TIME_LIMIT); break; } EQScreen.SetNextCharacter(); } updateStatus("Exited Core Gameplay, attempting to camp"); await EQTask.CampTask(); EQScreen.SetNextCharacter(); return(true); }
async Task <bool> ClericLoopTask() { updateStatus("Kicking off cleric loop"); EQState currentEQState = EQState.GetCurrentEQState(); PlayerState currentPlayerState = PlayerState.WAITING_TO_FOCUS; while (currentPlayerState != PlayerState.EXITING_CORE_GAMEPLAY_LOOP) { // always update EQState here? switch (currentPlayerState) { case PlayerState.WAITING_TO_FOCUS: updateStatus("Focusing on EQ Window"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.FocusOnEQWindowTask(), PlayerState.FOCUSED_ON_EQ_WINDOW, PlayerState.EXITING_CORE_GAMEPLAY_LOOP); break; case PlayerState.FOCUSED_ON_EQ_WINDOW: updateStatus("Focused on EQ Window"); currentPlayerState = PlayerState.CHECK_COMBAT_STATUS; break; case PlayerState.CHECK_COMBAT_STATUS: updateStatus("Focused on EQ Window"); currentPlayerState = ChangeStateBasedOnBool(currentEQState.characterState == EQState.CharacterState.COMBAT, PlayerState.KILLING_TARGET_ASAP, PlayerState.WAITING_FOR_MANA); break; case PlayerState.KILLING_TARGET_ASAP: updateStatus("Killing target ASAP"); await EQTask.NukeTask(); await EQTask.EnterCombatTask(); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.NukeUntilDeadTask(), PlayerState.ATTEMPT_TO_LOOT, PlayerState.ATTEMPT_TO_LOOT); break; case PlayerState.WAITING_FOR_MANA: updateStatus("Resting for mana"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.RestUntilFullManaTask(), PlayerState.FINDING_SUITABLE_TARGET, PlayerState.WAITING_FOR_MANA); break; case PlayerState.FINDING_SUITABLE_TARGET: updateStatus("Finding Suitable Target"); bool foundTargetResult = await EQTask.FindNearestTargetTask(); //bool foundTargetResult = await EQTask.FindAnyTargetWithMacroTask(); currentPlayerState = ChangeStateBasedOnBool(foundTargetResult, PlayerState.KILLING_TARGET_ASAP, PlayerState.CHECK_COMBAT_STATUS); break; case PlayerState.ATTEMPT_TO_LOOT: updateStatus("Attempting to loot"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.LootTask(true), PlayerState.HIDE_CORPSES, PlayerState.HIDE_CORPSES); break; case PlayerState.HIDE_CORPSES: updateStatus("Hiding Corpses"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.HideCorpsesTask(), PlayerState.CHECK_COMBAT_STATUS, PlayerState.CHECK_COMBAT_STATUS); break; } } updateStatus("Exited Core Gameplay "); return(true); }
async Task <bool> PyzjnLoopTask() { updateStatus("Kicking off cleric loop"); EQState currentEQState = EQState.GetCurrentEQState(); PlayerState currentPlayerState = PlayerState.WAITING_TO_FOCUS; while (currentPlayerState != PlayerState.EXITING_CORE_GAMEPLAY_LOOP) { // always update EQState here? switch (currentPlayerState) { case PlayerState.WAITING_TO_FOCUS: updateStatus("Focusing on EQ Window"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.FocusOnEQWindowTask(), PlayerState.FOCUSED_ON_EQ_WINDOW, PlayerState.EXITING_CORE_GAMEPLAY_LOOP); break; case PlayerState.FOCUSED_ON_EQ_WINDOW: updateStatus("Focused on EQ Window"); currentPlayerState = PlayerState.CHECK_COMBAT_STATUS; break; case PlayerState.CHECK_COMBAT_STATUS: updateStatus("Focused on EQ Window"); currentPlayerState = ChangeStateBasedOnBool(currentEQState.characterState == EQState.CharacterState.COMBAT, PlayerState.KILLING_TARGET_ASAP, PlayerState.CASTING_BURNOUT_ON_PET); break; case PlayerState.KILLING_TARGET_ASAP: updateStatus("Killing target ASAP"); await EQTask.PetAttackTask(); await EQTask.EnterCombatTask(); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.NukeUntilDeadTask(), PlayerState.ATTEMPT_TO_LOOT, PlayerState.ATTEMPT_TO_LOOT); break; case PlayerState.CASTING_BURNOUT_ON_PET: updateStatus("Casting burnout on pet and setting timer"); if (!CurrentTimeInsideDuration(lastBurnoutCastTime, BURNOUT_TIME_MILLIS)) { lastBurnoutCastTime = DateTimeOffset.Now.ToUnixTimeMilliseconds(); await EQTask.ApplyPetBuffTask(); await EQTask.RestTask(); } currentPlayerState = PlayerState.PREPARED_FOR_BATTLE; break; case PlayerState.PREPARED_FOR_BATTLE: updateStatus("Prepared for battle, checking day/night"); currentPlayerState = ChangeStateBasedOnBool(currentEQState.minutesSinceMidnight < 21 || currentEQState.minutesSinceMidnight > 57, PlayerState.PREPARED_FOR_BATTLE_DAY, PlayerState.PREPARED_FOR_BATTLE_DAY); // because I target with macro now, just kill all the skellies break; case PlayerState.PREPARED_FOR_BATTLE_DAY: updateStatus("DAY looking for Pyzjn"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.FindSpecificTarget(), PlayerState.PYZJN_FOUND, PlayerState.NO_PYZJN_FOUND); break; case PlayerState.PYZJN_FOUND: updateStatus("PYZJN_FOUND"); int timesToAlert = 100; while (timesToAlert > 0) { //soundPlayer.Play(); if (timesToAlert % 50 == 0) { SlackHelper.SendSlackMessageAsync("Pyzjn Found!"); } timesToAlert--; await Task.Delay(2000); } break; case PlayerState.NO_PYZJN_FOUND: updateStatus("No pyzjn found, finding target"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.FindAnyTargetWithMacroTask(), PlayerState.TARGET_FOUND, PlayerState.CHECK_COMBAT_STATUS); break; case PlayerState.TARGET_FOUND: updateStatus("Target found, sending pet"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.PetAttackTask(), PlayerState.WAITING_FOR_PET_TO_KILL, PlayerState.CHECK_COMBAT_STATUS); break; case PlayerState.WAITING_FOR_PET_TO_KILL: updateStatus("Waiting for pet to kill"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.WaitUntilDeadTask(), PlayerState.ATTEMPT_TO_LOOT, PlayerState.ATTEMPT_TO_LOOT); break; case PlayerState.ATTEMPT_TO_LOOT: updateStatus("Attempting to loot"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.LootTask(true), PlayerState.HIDE_CORPSES, PlayerState.HIDE_CORPSES); break; case PlayerState.HIDE_CORPSES: updateStatus("Hiding Corpses"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.HideCorpsesTask(), PlayerState.CHECK_COMBAT_STATUS, PlayerState.CHECK_COMBAT_STATUS); break; } } updateStatus("Exited Core Gameplay "); return(true); }
async Task <bool> CoreGameplayLoopTask() { lastFarmingLimitTime = DateTimeOffset.Now.ToUnixTimeMilliseconds(); updateStatus("Kicking off core gameplay loop"); EQState currentEQState = EQState.GetCurrentEQState(); PlayerState currentPlayerState = PlayerState.WAITING_TO_FOCUS; EQScreen.currentCharacterName = "Yoyokazoo"; while (currentPlayerState != PlayerState.EXITING_CORE_GAMEPLAY_LOOP) { // always update EQState here? switch (currentPlayerState) { case PlayerState.WAITING_TO_FOCUS: updateStatus("Focusing on EQ Window"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.FocusOnEQWindowTask(), PlayerState.FOCUSED_ON_EQ_WINDOW, PlayerState.EXITING_CORE_GAMEPLAY_LOOP); break; case PlayerState.FOCUSED_ON_EQ_WINDOW: updateStatus("Focused on EQ Window"); currentPlayerState = PlayerState.CHECK_COMBAT_STATUS; break; // TODO: // SUMMONING_PET, // EQUIPPING_PET, case PlayerState.CHECK_COMBAT_STATUS: updateStatus("Focused on EQ Window"); currentPlayerState = ChangeStateBasedOnBool(currentEQState.characterState == EQState.CharacterState.COMBAT, PlayerState.KILLING_TARGET_ASAP, PlayerState.CHECK_FARMING_TIME_LIMIT); break; case PlayerState.KILLING_TARGET_ASAP: updateStatus("Killing target ASAP"); //await EQTask.PetAttackTask(); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.NukeUntilDeadTask(), PlayerState.ATTEMPT_TO_LOOT, PlayerState.ATTEMPT_TO_LOOT); break; // TODO: // SUMMONING_PET, // EQUIPPING_PET, case PlayerState.CHECK_FARMING_TIME_LIMIT: updateStatus("Checking farming time limit"); currentPlayerState = PlayerState.CHECK_PREPAREDNESS; if (!CurrentTimeInsideDuration(lastFarmingLimitTime, FARMING_LIMIT_TIME_MILLIS)) { currentPlayerState = PlayerState.EXITING_CORE_GAMEPLAY_LOOP; } break; case PlayerState.CHECK_PREPAREDNESS: updateStatus("Checking preparedness? nothing atm"); await EQTask.DeselectTargetTask(); currentPlayerState = ChangeStateBasedOnBool(currentEQState.petHealth > 0.05, PlayerState.CASTING_BURNOUT_ON_PET, PlayerState.CASTING_BURNOUT_ON_PET); break; currentPlayerState = PlayerState.CASTING_BURNOUT_ON_PET; // set timer /* * currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.ApplyPetBuffTask(), * PlayerState.TARGET_FOUND, * PlayerState.PREPARED_FOR_BATTLE) * ) */ break; case PlayerState.GTFO: updateStatus("PET DEAD GTFO"); await EQTask.GTFOTask(); currentPlayerState = PlayerState.EXITING_CORE_GAMEPLAY_LOOP; // set timer /* * currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.ApplyPetBuffTask(), * PlayerState.TARGET_FOUND, * PlayerState.PREPARED_FOR_BATTLE) * ) */ break; case PlayerState.CASTING_BURNOUT_ON_PET: updateStatus("Casting burnout on pet and setting timer2"); if (!CurrentTimeInsideDuration(lastBurnoutCastTime, BURNOUT_TIME_MILLIS)) { lastBurnoutCastTime = DateTimeOffset.Now.ToUnixTimeMilliseconds(); await EQTask.ApplyPetBuffTask(); } currentPlayerState = PlayerState.CASTING_ARCH_SHIELDING_ON_SELF; break; case PlayerState.CASTING_ARCH_SHIELDING_ON_SELF: updateStatus("Casting arch shielding on self and setting timer"); if (!CurrentTimeInsideDuration(lastArchShieldingCastTime, ARCH_SHIELDING_TIME_MILLIS)) { lastArchShieldingCastTime = DateTimeOffset.Now.ToUnixTimeMilliseconds(); await EQTask.ApplySelfBuffTask(); } currentPlayerState = PlayerState.WAITING_FOR_MANA; break; case PlayerState.WAITING_FOR_MANA: updateStatus("Resting for mana"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.RestUntilFullManaTask(), PlayerState.FINDING_SUITABLE_TARGET, PlayerState.WAITING_FOR_MANA); // set timer /* * currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.ApplyPetBuffTask(), * PlayerState.TARGET_FOUND, * PlayerState.PREPARED_FOR_BATTLE) * ) */ break; case PlayerState.PREPARED_FOR_BATTLE_NIGHT: updateStatus("NIGHT looking for Pyzjn"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.FindSpecificTarget(), PlayerState.PYZJN_FOUND, PlayerState.FINDING_SUITABLE_TARGET); break; case PlayerState.FINDING_SUITABLE_TARGET: updateStatus("Finding Suitable Target"); bool foundTargetResult = await EQTask.FindNearestTargetTask(false, MonsterCon.GREY); //bool foundTargetResult = await EQTask.FindAnyTargetWithMacroTask(); currentPlayerState = ChangeStateBasedOnBool(foundTargetResult, PlayerState.CASTING_DMG_SHIELD_ON_PET, PlayerState.CHECK_COMBAT_STATUS); // set timer /* * currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.ApplyPetBuffTask(), * PlayerState.TARGET_FOUND, * PlayerState.PREPARED_FOR_BATTLE) * ) */ break; case PlayerState.CASTING_DMG_SHIELD_ON_PET: updateStatus("Casting Damage Shield on Pet"); if (!CurrentTimeInsideDuration(lastDmgShieldCastTime, DMG_SHIELD_TIME_MILLIS)) { lastDmgShieldCastTime = DateTimeOffset.Now.ToUnixTimeMilliseconds(); await EQTask.ApplyDamageShieldTask(true); } await Task.Delay(500); await EQTask.FindNearestTargetTask(true); currentPlayerState = PlayerState.PULL_WITH_NUKE; // set timer /* * currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.ApplyPetBuffTask(), * PlayerState.TARGET_FOUND, * PlayerState.PREPARED_FOR_BATTLE) * ) */ break; case PlayerState.PULL_WITH_NUKE: updateStatus("NUKE PULLING"); await EQTask.NukeTask(); await Task.Delay(500); await EQTask.EnterCombatTask(); await EQTask.NukeTask(); await Task.Delay(500); currentPlayerState = PlayerState.KILLING_TARGET_ASAP; break; case PlayerState.PULL_WITH_PET_OUT: updateStatus("PULLING OUT WITH PET"); await EQTask.PetAttackTask(); currentPlayerState = PlayerState.KILLING_TARGET_ASAP; break; case PlayerState.PULL_WITH_PET_BACK: updateStatus("PULLING BACK WITH PET"); await EQTask.PetBackTask(); currentPlayerState = PlayerState.KILLING_TARGET_ASAP; break; case PlayerState.PREPARED_FOR_BATTLE: updateStatus("Prepared for battle, checking day/night"); currentPlayerState = ChangeStateBasedOnBool(currentEQState.minutesSinceMidnight < 21 || currentEQState.minutesSinceMidnight > 57, PlayerState.PREPARED_FOR_BATTLE_NIGHT, PlayerState.PREPARED_FOR_BATTLE_DAY); break; case PlayerState.PREPARED_FOR_BATTLE_DAY: updateStatus("DAY looking for Pyzjn"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.FindSpecificTarget(), PlayerState.PYZJN_FOUND, PlayerState.LEVEL_UP_SKILL); break; case PlayerState.LEVEL_UP_SKILL: updateStatus("Leveling up skill"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.LevelUpSkillTask(), PlayerState.PREPARED_FOR_BATTLE, PlayerState.PREPARED_FOR_BATTLE); break; case PlayerState.PYZJN_FOUND: updateStatus("PYZJN_FOUND"); int timesToAlert = 100; while (timesToAlert > 0) { //soundPlayer.Play(); if (timesToAlert % 50 == 0) { SlackHelper.SendSlackMessageAsync("Pyzjn found!"); } timesToAlert--; await Task.Delay(2000); } currentPlayerState = PlayerState.EXITING_CORE_GAMEPLAY_LOOP; await EQTask.CampTask(); break; case PlayerState.NO_PYZJN_FOUND: updateStatus("No pyzjn found, finding target"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.FindAnyTargetWithMacroTask(), PlayerState.TARGET_FOUND, PlayerState.PREPARED_FOR_BATTLE); break; case PlayerState.TARGET_FOUND: updateStatus("Target found, sending pet"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.PetAttackTask(), PlayerState.WAITING_FOR_PET_TO_KILL, PlayerState.PREPARED_FOR_BATTLE); break; case PlayerState.WAITING_FOR_PET_TO_KILL: updateStatus("Waiting for pet to kill"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.WaitUntilDeadTask(), PlayerState.PREPARED_FOR_BATTLE, PlayerState.PREPARED_FOR_BATTLE); break; case PlayerState.ATTEMPT_TO_LOOT: updateStatus("Attempting to loot"); Random r = new Random(); if (r.Next() % 2 == 0) { await EQTask.ScoochForwardTask(); } currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.LootTask(false), PlayerState.HIDE_CORPSES, PlayerState.HIDE_CORPSES); break; case PlayerState.HIDE_CORPSES: updateStatus("Hiding Corpses"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.HideCorpsesTask(), PlayerState.CHECK_COMBAT_STATUS, PlayerState.CHECK_COMBAT_STATUS); break; } } updateStatus("Exited Core Gameplay "); await EQTask.CampTask(); return(true); }
async Task <bool> RogueLoopTask() { int creaturesPulled = 0; int throwingDaggerStack = 0; lastFarmingLimitTime = DateTimeOffset.Now.ToUnixTimeMilliseconds(); updateStatus("Kicking off rogue loop"); EQState currentEQState = EQState.GetCurrentEQState(); PlayerState currentPlayerState = PlayerState.WAITING_TO_FOCUS; while (currentPlayerState != PlayerState.EXITING_CORE_GAMEPLAY_LOOP) { if (EQScreen.currentCharacterName != "Trakklo") { await Task.Delay(100); continue; } await EQTask.FocusOnEQWindowTask(); currentEQState = EQState.GetCurrentEQState(); switch (currentPlayerState) { case PlayerState.WAITING_TO_FOCUS: updateStatus("Focusing on EQ Window"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.FocusOnEQWindowTask(), PlayerState.FOCUSED_ON_EQ_WINDOW, PlayerState.EXITING_CORE_GAMEPLAY_LOOP); break; case PlayerState.FOCUSED_ON_EQ_WINDOW: updateStatus("Focused on EQ Window"); await EQTask.HideCorpsesTask(); currentPlayerState = PlayerState.CHECK_COMBAT_STATUS; break; case PlayerState.CHECK_FARMING_TIME_LIMIT: updateStatus("Checking farming time limit"); currentPlayerState = PlayerState.CHECK_COMBAT_STATUS; if (!CurrentTimeInsideDuration(lastFarmingLimitTime, FARMING_LIMIT_TIME_MILLIS)) { currentPlayerState = PlayerState.EXITING_CORE_GAMEPLAY_LOOP; } creaturesPulled++; if (creaturesPulled % 30 == 0) { SlackHelper.SendSlackMessageAsync("Out of daggers, go refill"); currentPlayerState = PlayerState.EXITING_CORE_GAMEPLAY_LOOP; } break; case PlayerState.CHECK_COMBAT_STATUS: updateStatus("Checking combat Status"); currentPlayerState = ChangeStateBasedOnBool(currentEQState.characterState == EQState.CharacterState.COMBAT, PlayerState.PREPARED_FOR_BATTLE, PlayerState.WAITING_FOR_MANA); break; case PlayerState.PREPARED_FOR_BATTLE: updateStatus("Killing target ASAP"); await EQTask.ScoochForwardTask(); await EQTask.PullWithThrowingWeaponTask(); await EQTask.EnterCombatTask(); await EQTask.EnterCombatTask(); await EQTask.EnterCombatTask(); currentPlayerState = PlayerState.KILLING_TARGET_ASAP; break; case PlayerState.KILLING_TARGET_ASAP: updateStatus("Killing target ASAP"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.LevelSkillUntilDeadTask(), PlayerState.ATTEMPT_TO_LOOT, PlayerState.KILLING_TARGET_ASAP); break; case PlayerState.WAITING_FOR_MANA: updateStatus("Resting until fuly healed"); await EQTask.RestUntilFullyHealedTask(); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.RestUntilFullyHealedTask(), PlayerState.FINDING_SUITABLE_TARGET, PlayerState.WAITING_FOR_MANA); break; if (currentEQState.characterState == EQState.CharacterState.COMBAT) { SlackHelper.SendSlackMessageAsync("Attacked while resting, something's probably wrong."); currentPlayerState = PlayerState.PREPARED_FOR_BATTLE; } case PlayerState.FINDING_SUITABLE_TARGET: updateStatus("Finding Suitable Target"); //bool foundTargetResult = await EQTask.FindNearestTargetTask(false); bool foundTargetResult = await EQTask.FindAnyTargetWithMacroTask(); currentPlayerState = ChangeStateBasedOnBool(foundTargetResult, PlayerState.PREPARED_FOR_BATTLE, PlayerState.CHECK_COMBAT_STATUS); break; case PlayerState.ATTEMPT_TO_LOOT: updateStatus("Attempting to loot"); //await EQTask.ScoochForwardTask(); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.LootTask(false), PlayerState.HIDE_CORPSES, PlayerState.HIDE_CORPSES); break; case PlayerState.HIDE_CORPSES: updateStatus("Hiding Corpses"); currentPlayerState = await ChangeStateBasedOnTaskResult(EQTask.HideCorpsesTask(), PlayerState.CHECK_FARMING_TIME_LIMIT, PlayerState.CHECK_FARMING_TIME_LIMIT); break; } EQScreen.SetNextCharacter(); } updateStatus("Exited Core Gameplay, attempting to camp"); await EQTask.CampTask(); EQScreen.SetNextCharacter(); return(true); }