public bool doTask(mainForm main_form, MemoryRW mc, Player player) { while (!player.inCombat && player.MobToLootCount > 0) { int counter = 0; while (counter++ < 10 && !player.inCombat) { Thread.Sleep(100); } mc.sendKeystroke(Keys.X); while (player.Pos.moved() && !player.inCombat) { Thread.Sleep(100); } if (player.inCombat) { return(true); } player.MobToLootCount--; Thread.Sleep(2000); } return(true); }
public bool doTask(mainForm main_form, MemoryRW mc, Player player) { Console.WriteLine(player.Target.isTargetFriendly()); if (player.inCombat && !player.Target.isTargetFriendly()) { return(true); } if (player.MobToLootCount > 0) { return(false); } DateTime mobSearchBreak = DateTime.Now; while ( (DateTime.Now - mobSearchBreak).TotalSeconds < 5 && !player.Target.isValidTarget(main_form) || player.Target.isTargetFriendly() && (DateTime.Now - mobSearchBreak).TotalSeconds < 5 ) { mc.sendKeystroke(Keys.Tab); Thread.Sleep(600); } while (!player.Target.isValidTarget(main_form) && player.Target.targetCurrentHP > 0) { mc.sendKeystroke(Keys.Escape); Thread.Sleep(50); } return(false); }
public bool doTask(mainForm main_form, MemoryRW mc, Player player) { if (checkForLowMP(main_form, player)) { mc.sendKeystroke(Keys.OemMinus); } Thread.Sleep(100); return(true); }
public IState doTasks(mainForm main_form, MemoryRW mc, Player player) { if (player.inCombat && main_form.cbAutoBattle.Checked) { return(new CombatState()); } Thread.Sleep(100); return(new IdleState()); }
public IState doTasks(mainForm main_form, MemoryRW mc, Player player) { /* * Update Form infos */ new UpdateCharInfoTask().doTask(main_form, player); new UpdateTargetInfo().doTask(main_form, player); /* * Revive incase you DIED Noob. */ if (new ReviveIfNeededTask().doTask(main_form, mc, player)) { return(new PreCombatState()); } /* * Check if you need to rest when yes set State to FindGameState */ if (new GetRestTask().doTask(main_form, mc, player)) { return(new PreCombatState()); } /* * Loot leftovers */ if (main_form.cbAutoLoot.Checked) { new AutoLootTask().doTask(main_form, mc, player); } /* * Buff yourself if buffs are set */ new BuffMyselfTask().doTask(main_form, mc, player); if (main_form.cbAutoTarget.Checked) { new FocusTargetTask().doTask(main_form, mc, player); } Thread.Sleep(100); if (main_form.cbAutoBattle.Checked) { return(new CombatState()); } return(new IdleState()); }
public bool doTask(mainForm main_form, MemoryRW mc, Player player) { Int32.TryParse(main_form.tbProcessID.Text, out int number); if (mc.Process_Handle(gameName, number, main_form.tbProcessName.Text, !(oldProcessNumber.Equals(main_form.tbProcessID.Text) && oldWindowName.Equals(main_form.tbProcessName.Text)))) { main_form.lblGameFound.Text = "Flo found"; oldProcessNumber = main_form.tbProcessID.Text; oldWindowName = main_form.tbProcessName.Text; return(true); } main_form.lblGameFound.Text = "Flo not found"; return(false); }
public IState doTasks(mainForm main_form, MemoryRW mc, Player player) { while (!new FindGameHandlerTask().doTask(main_form, mc, player)) { Thread.Sleep(500); return(new IdleState()); } Thread.Sleep(100); if (main_form.cbEnableCombatState.Checked && !player.PlayerName.Equals("")) { return(new PreCombatState()); } new UpdateCharInfoTask().doTask(main_form, player); new UpdateTargetInfo().doTask(main_form, player); return(new IdleState()); }
public bool doTask(mainForm main_form, MemoryRW mc, Player player) { if (player.inCombat) { return(true); } //Check if autoloot is checked then if the target name is not "NoTarget" if (main_form.cbAutoLoot.Checked && !player.Target.targetName.Contains("NoTarget")) { player.MobToLootCount++; } while (!player.Target.targetName.Contains("NoTarget") && player.Target.targetName.Length > 0) { mc.sendKeystroke(Keys.Escape); Thread.Sleep(100); } player.PlayerEngaged = false; return(false); }
public bool doTask(mainForm main_form, MemoryRW mc, Player player) { if (player.PlayerCurrentHP > 0 || !player.allowedToRevive(main_form)) { return(false); } Thread.Sleep(1000); while (player.PlayerCurrentHP <= 0 && player.PlayerName.Length >= 3) { mc.sendLeftClick(mc.getPixelsByPercent(50, 50), mc.getPixelsByPercent(50, 50)); Thread.Sleep(100); } player.Resting = false; player.MobToLootCount = 0; player.Buffed = false; main_form.lblDeathDate.Text = DateTime.Now.ToString("HH:mm:ss"); Thread.Sleep(1000); return(true); }
public IState doTasks(mainForm main_form, MemoryRW mc, Player player) { /* * Focus a Target when you do not have any */ if (new CheckCurrentTargetTask().doTask(main_form, mc, player)) { new EmergencyHPTask().doTask(main_form, mc, player); new EmergencyMPTask().doTask(main_form, mc, player); new AttackTargetTask().doTask(main_form, mc, player); new UpdateCharInfoTask().doTask(main_form, player); new UpdateTargetInfo().doTask(main_form, player); return(new CombatState()); } Thread.Sleep(100); return(new AfterCombatState()); }
public bool doTask(mainForm main_form, MemoryRW mc, Player player) { if (player.inCombat || player.Resting) { return(false); } Skill[] copy = new Skill[player.BuffArray.Count]; player.BuffArray.CopyTo(copy); foreach (Skill buff in copy) { int counter = 0; if (buff.skillCanBeUsed() || !player.Buffed) { counter = (int)buff.CastTime * 4; mc.sendKeystroke(buff.Hotkey); buff.LastTimeUsed = DateTime.Now; } do { if (player.inCombat) { return(false); } Thread.Sleep(250); } while (counter-- >= 0); } while (player.targetingMyself()) { mc.sendKeystroke(Keys.Escape); Thread.Sleep(100); } player.Buffed = true; return(true); }
public bool doTask(mainForm main_form, MemoryRW mc, Player player) { throw new NotImplementedException(); }
public bool doTask(mainForm main_form, MemoryRW mc, Player player) { //Check if in combat yes -> return false (not resting) incase you were resting, stand up and set resting to false if (player.inCombat) { if (player.Resting) { mc.sendKeystroke(Keys.Z); player.Resting = false; oldHP = -1; return(false); } else { return(false); } } if (player.Resting && oldHP > player.PlayerCurrentHP) { mc.sendKeystroke(Keys.Tab); return(true); } //Check if player is not resting but needs to rest if (!player.Resting && (getRestHP(main_form, player) || getRestMP(main_form, player))) { if (player.inCombat) { return(false); } //Try to avoid not being able to sit down when you killed an enemy with a cast time spell //Bot notices that an enemy died even befor shown in the client do { Thread.Sleep(200); } while (player.Pos.moved()); Thread.Sleep(2000); oldHP = player.PlayerCurrentHP; player.Resting = true; mc.sendKeystroke(Keys.Z); return(true); } //Check if player has finished resting if (player.Resting) { if (player.PlayerMaxHP == player.PlayerCurrentHP && player.PlayerMaxMP == player.PlayerCurrentMP) { oldHP = -1; mc.sendKeystroke(Keys.Z); player.Resting = false; Thread.Sleep(1500); return(false); } else { if (oldHP < player.PlayerCurrentHP) { oldHP = player.PlayerCurrentHP; } Thread.Sleep(200); return(true); } } return(false); }
public bool doTask(mainForm main_form, MemoryRW mc, Player player) { int counter = 400; if (!player.PlayerEngaged) { //Attack mc.sendKeystroke(Keys.Space); // Stop Moving //mc.sendKeystroke(Keys.S); player.PlayerEngaged = true; do { Thread.Sleep(50); }while (player.Pos.moved() && counter-- > 0); counter = 400; } Console.WriteLine((DateTime.Now - lastTimeUsedSpell).TotalSeconds); Console.WriteLine("DelayTime: " + delayTime); if (delayTime > 0) { if ((DateTime.Now - lastTimeUsedSpell).TotalSeconds <= delayTime) { return(true); } else { delayTime = 0; } } Skill[] copy = new Skill[player.AttArray.Count]; player.AttArray.CopyTo(copy); foreach (Skill attk in copy) { Console.WriteLine(attk.Hotkey); if (attk.attackCanBeUsed(player.Target, player)) { if (!player.inCombat) { return(false); } mc.sendKeystroke(attk.Hotkey); do { Thread.Sleep(50); }while (player.Pos.moved() && counter-- > 0); Console.WriteLine("Set Time Used"); attk.LastTimeUsed = DateTime.Now; lastTimeUsedSpell = attk.LastTimeUsed; Console.WriteLine(attk.CastTime); delayTime = attk.CastTime; //Thread.Sleep(2000); return(true); } } //Attack mc.sendKeystroke(Keys.Space); do { Thread.Sleep(50); }while (player.Pos.moved() && counter-- > 0); return(true); }