context: using System;
  using System.Collections.Generic;
  using LeagueSharp;
  using LeagueSharp.Common;
  
  // This assembly was an experimental one to get use the LeagueSharp api. There is better assemblies for Elise out there. Since I don't play Elise anymore and she is weak, I will not work on improving this unless i have nothing better to do. 
  
  using EloBuddy; 
   using LeagueSharp.Common; 
   namespace SephElise
  {
      internal class Program
      {
          private const string ChampionName = "Elise";
          private static Orbwalking.Orbwalker Orbwalker;
          public static Spell Q, W, E, R, QS, WS, ES;
          public static float Qrange, Wrange, Erange;
  
          private static Menu Config;
          private static SpellSlot IgniteSlot;
          private static AIHeroClient Player;
          private static bool HumanForm;
          private static bool SpiderForm;
  
          public static void Main()
          {
              Game_OnGameLoad();
          }
  
          static void Game_OnGameLoad()
          {
  
              Player = ObjectManager.Player;
              if (Player.BaseSkinName != ChampionName && Player.BaseSkinName != "elisespider")
              {
                  return;
              }
  
              Q = new Spell(SpellSlot.Q, 625f);
              W = new Spell(SpellSlot.W, 950f);
              E = new Spell(SpellSlot.E, 1100f);
  
              QS = new Spell(SpellSlot.Q, 475f);
              WS = new Spell(SpellSlot.W, 0);
              ES = new Spell(SpellSlot.E, 750f);
              R = new Spell(SpellSlot.R, 0);
              W.SetSkillshot(0.25f, 100f, 1000, true, SkillshotType.SkillshotLine);
              E.SetSkillshot(0.25f, 55f, 1600, true, SkillshotType.SkillshotLine);
  
              IgniteSlot = Player.GetSpellSlot("SummonerDot");
  
  
              Config = new Menu("SephElise", "Elise", true);
  
  
              //TargetSelector
              var targetSelectorMenu = new Menu("Target Selector", "Target Selector");
              TargetSelector.AddToMenu(targetSelectorMenu);
              Config.AddSubMenu(targetSelectorMenu);
  
              //Orbwalker
              Config.AddSubMenu(new Menu("Orbwalking", "Orbwalking"));
              Orbwalker = new Orbwalking.Orbwalker(Config.SubMenu("Orbwalking"));
  
              //Combo
              Config.AddSubMenu(new Menu("Combo", "Combo"));
              Config.SubMenu("Combo").AddItem(new MenuItem("UseQHuman", "Use Q")).SetValue(true);
              Config.SubMenu("Combo").AddItem(new MenuItem("UseWHuman", "Use W")).SetValue(true);
              Config.SubMenu("Combo").AddItem(new MenuItem("UseEHuman", "Use E")).SetValue(true);
              Config.SubMenu("Combo").AddItem(new MenuItem("UseR", "Use R")).SetValue(true);
              Config.SubMenu("Combo").AddItem(new MenuItem("UseQSpider", "Use Q Spider")).SetValue(true);
              Config.SubMenu("Combo").AddItem(new MenuItem("UseWSpider", "Use W Spider")).SetValue(true);
              Config.SubMenu("Combo").AddItem(new MenuItem("UseESpider", "Use E Spider")).SetValue(true);
              Config.SubMenu("Combo").AddItem(new MenuItem("UseItems", "Use Items")).SetValue(true);
              Config.SubMenu("Combo")
                  .AddItem(new MenuItem("ComboMode", "Combo!").SetValue(new KeyBind(32, KeyBindType.Press)));
  
  
              //Harass
              Config.AddSubMenu(new Menu("Harass", "Harass"));
              Config.SubMenu("Harass").AddItem(new MenuItem("UseQHarass", "Use Q")).SetValue(true);
              Config.SubMenu("Harass").AddItem(new MenuItem("UseWHarass", "Use W")).SetValue(true);
              Config.SubMenu("Harass")
                  .AddItem(
                      new MenuItem("HarassMode", "Harass key").SetValue(new KeyBind("X".ToCharArray()[0],
                          KeyBindType.Press)));
  
              //Farm
              Config.AddSubMenu(new Menu("Farm/Clear", "Farm"));
              Config.SubMenu("Farm").AddItem(new MenuItem("UseQFarm", "Use Q (Spider)")).SetValue(true);
              Config.SubMenu("Farm").AddItem(new MenuItem("UseSpiderEFarm", "Use E (Spider)")).SetValue(false);
              Config.SubMenu("Farm").AddItem(new MenuItem("UseWFarm", "Use W (Spider)")).SetValue(true);
              Config.SubMenu("Farm")
                  .AddItem(
                      new MenuItem("FarmMode", "Farm Key").SetValue(new KeyBind("V".ToCharArray()[0], KeyBindType.Press)));
  
              //Kill Steal
              Config.AddSubMenu(new Menu("KillSteal", "Ks"));
              Config.SubMenu("Ks").AddItem(new MenuItem("KSMode", "Use KillSteal")).SetValue(true);
              Config.SubMenu("Ks").AddItem(new MenuItem("UseQKs", "Use Q")).SetValue(true);
              Config.SubMenu("Ks").AddItem(new MenuItem("UseWKs", "Use W")).SetValue(true);
              Config.SubMenu("Ks").AddItem(new MenuItem("UseQKsSpider", "Use Q (Spider)")).SetValue(true);
              Config.SubMenu("Ks").AddItem(new MenuItem("UseWKsSpider", "Use W (Spider)")).SetValue(true);
              Config.SubMenu("Ks").AddItem(new MenuItem("UseEKsSpider", "Use E (Spider)")).SetValue(true);
              Config.SubMenu("Ks").AddItem(new MenuItem("UseIgnite", "Use Ignite")).SetValue(true);
  
  
              //Drawings
              Config.AddSubMenu(new Menu("Drawings", "Drawings"));
              Config.SubMenu("Drawings").AddItem(new MenuItem("DrawQ", "Draw Q")).SetValue(true);
              Config.SubMenu("Drawings").AddItem(new MenuItem("DrawW", "Draw W")).SetValue(true);
              Config.SubMenu("Drawings").AddItem(new MenuItem("DrawE", "Draw E")).SetValue(true);
  
              Config.AddToMainMenu();
  
              Game.OnUpdate += OnGameUpdate;
              Drawing.OnDraw += OnDraw;
              Chat.Print("<font color='#1d87f2'>SephElise has been Loaded.</font>");
          }
  
  
          private static void OnDraw(EventArgs args) 
          {
              if (Player.IsDead)
              {
                  return;
              }
              if (Config.Item("DrawQ").GetValue<bool>()) 
              {
                  Render.Circle.DrawCircle(ObjectManager.Player.Position, Qrange, System.Drawing.Color.White);
              }
              if (Config.Item("DrawW").GetValue<bool>())
              {
                  Render.Circle.DrawCircle(ObjectManager.Player.Position, Wrange, System.Drawing.Color.Red);
              }
              if (Config.Item("DrawE").GetValue<bool>())
              {
                  Render.Circle.DrawCircle(ObjectManager.Player.Position, Erange, System.Drawing.Color.Blue);
              }
  
          }
  
          private static void OnGameUpdate(EventArgs args)
          {
              Orbwalker.SetAttack(true);
              CheckForm();
  
              if (Config.Item("ComboMode").GetValue<KeyBind>().Active)
              {
                  Combo();
              }
              if (Config.Item("HarassMode").GetValue<KeyBind>().Active)
              {
                  Harass();
              }
              if (Config.Item("FarmMode").GetValue<KeyBind>().Active)
              {
                  Farm();
                  JungleFarm();
              }
              if (Config.Item("KSMode").GetValue<bool>())
              {
                  KillSteal();
              }
          }
  
          private static void Harass()
          {
              AIHeroClient target = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Magical);
              if (target != null)
              {
                  if (HumanForm)
                  {
                      if (Player.Distance(target) <= Q.Range && Config.Item("UseQHarass").GetValue<bool>() && Q.IsReady())
                      {
                          Q.Cast(target);
                      }
  
                      if (Player.Distance(target) <= W.Range && Config.Item("UseWHarass").GetValue<bool>() &&
                          W.IsReady())
                      {
                          W.Cast(target);
                      }
                  }
              }
          }
  
  
          private static void JungleFarm()
          {
              List<Obj_AI_Base> mobs = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, W.Range,
                  MinionTypes.All, MinionTeam.Neutral, MinionOrderTypes.Health);
  
              if (Config.Item("UseQFarm").GetValue<bool>())
              {
                  foreach (Obj_AI_Base minion in mobs)
                      if (HumanForm)
                      {
                          if (QS.IsReady() && minion.IsValidTarget() && Player.Distance(minion) <= Q.Range)
                          {
                              Q.Cast(minion);
                          }
                          if (W.IsReady() && minion.IsValidTarget() && Player.Distance(minion) <= W.Range)
                          {
                              W.Cast();
                          }
                          if (!Q.IsReady() && !W.IsReady())
                          {
                              R.Cast();
                          }
                      }
                  if (!HumanForm)
                  {
                      foreach (Obj_AI_Base minion in mobs)
                      {
                          if (QS.IsReady() && minion.IsValidTarget() && Player.Distance(minion) <= QS.Range)
                          {
                              QS.Cast(minion);
                          }
                          if (WS.IsReady() && minion.IsValidTarget() && Player.Distance(minion) <= WS.Range)
                          {
                              WS.Cast();
                          }
                          if (ES.IsReady() && minion.IsValidTarget() && Player.Distance(minion) <= ES.Range &&
                              Config.Item("UseSpiderEFarm").GetValue<bool>())
                          {
                              ES.Cast(minion);
                          }
                      }
                  }
              }
          }
  
          private static void Farm()
          {
              List<Obj_AI_Base> allminions = MinionManager.GetMinions(Player.ServerPosition, Q.Range);
  
              if (Config.Item("UseQFarm").GetValue<bool>())
              {
                  foreach (Obj_AI_Base minion in allminions) { 
                      if (HumanForm)
                      {
                          if (QS.IsReady() && minion.IsValidTarget() && Player.Distance(minion) <= Q.Range)
                          {
                              Q.Cast(minion);
                          }
                          if (W.IsReady() && minion.IsValidTarget() && Player.Distance(minion) <= W.Range)
                          {
                              W.Cast();
                          }
                          R.Cast();
                      }
                  if (!HumanForm)
                  {
                      if (QS.IsReady() && minion.IsValidTarget() && Player.Distance(minion) <= QS.Range)
                      {
                          QS.Cast(minion);
                      }
                      if (WS.IsReady() && minion.IsValidTarget() && Player.Distance(minion) <= WS.Range)
                      {
                          WS.Cast();
                      }
                      if (ES.IsReady() && minion.IsValidTarget() && Player.Distance(minion) <= ES.Range &&
                          Config.Item("UseSpiderEFarm").GetValue<bool>())
                      {
                          ES.Cast(minion);
                      }
                  }
              }
          }
          }
  
  
          private static void KillSteal()
          {
              AIHeroClient target = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Magical);
  
gt:             if (target != null)