public override void Stop() { if (thread != null && thread.IsAlive) { thread.Abort(); } AutoItX3Declarations.AU3_Send("{4 UP}{CTRLUP}", 0); Console.WriteLine("Auto laugh state changed off"); }
public void AutoSmiteFunc() { while (true) { foreach (Minion minion in Engine.GetAll <Minion>()) { //Console.WriteLine(unit.name); if (minion.name.StartsWith("SRU") && !minion.name.Contains("Mini") && !minion.name.Contains("Wall")) //temporary workaround for the new summoners rift { if (!minion.IsVisible()) //must be visible to smite { continue; } if (minion.hp > 0 && !minion.isDead) { MainChampion myHero = Champion.Me; if (myHero == null) { break; } if (minion.hp < minion.maxhp && myHero.DistanceFrom(minion) < SMITE_RANGE && Engine.CanCastSpell(smiteKey)) { Engine.FloatingText(minion, "Ready To Smite", MessageType.Red); Console.WriteLine("written ready to smite"); } int myLevel = myHero.level; if (myLevel < 1 || myLevel > 18) // happens sometimes when the game ends { break; } if (minion.hp <= smiteDmg[myLevel - 1]) { //check distance if (myHero.DistanceFrom(minion) < SMITE_RANGE && Engine.CanCastSpell(smiteKey)) { //maybe install a mouse hook to disable mouse movement while moving mouse and smiting Console.WriteLine("smiting " + minion.name + DateTime.Now); //move camera Engine.LookAtTarget(minion); AutoItX3Declarations.AU3_MouseMove(Win32.GetSystemMetrics(0) / 2, Win32.GetSystemMetrics(1) / 2, 0); AutoItX3Declarations.AU3_Send(smiteKey, 0); } } } } } System.Threading.Thread.Sleep(20); } }
public void AutoLaughFunc() { while (true) { IntPtr hWnd = Win32.FindWindow(null, "League of Legends (TM) Client"); if (Engine.IsLolRunning) { if (Win32.GetForegroundWindow() == hWnd) { AutoItX3Declarations.AU3_Send("{CTRLDOWN}4{CTRLUP}", 0); Console.WriteLine("Laugh"); } } else { Stop(); return; } System.Threading.Thread.Sleep(2000); } }