context: using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using DetuksSharp;
  using LeagueSharp;
  using DetuksSharp;
  using LeagueSharp.Common;
  
  using EloBuddy;
  namespace ARAMDetFull
  {
      class AutoLevelChamp
      {
          public static int[] abilitySequence;
          private static SpellSlot Smite;
          private static int lastLevelup = DeathWalker.now;
          public static string tipo = "";
  
          public static void setAutoLevel()
          {
              GetSequence();
          }
  
          public static int qOff = 0, wOff = 0, eOff = 0, rOff = 0;
          public static Obj_AI_Base Player = ObjectManager.Player;
  
          public static void LevelUpOff()
          {
              lastLevelup = DeathWalker.now;
              int qL = Player.Spellbook.GetSpell(SpellSlot.Q).Level + qOff;
              int wL = Player.Spellbook.GetSpell(SpellSlot.W).Level + wOff;
              int eL = Player.Spellbook.GetSpell(SpellSlot.E).Level + eOff;
              int rL = Player.Spellbook.GetSpell(SpellSlot.R).Level + rOff;
              if (qL + wL + eL + rL < ObjectManager.Player.Level)
              {
                  int[] level = new int[] { 0, 0, 0, 0 };
                  for (int i = 0; i < ObjectManager.Player.Level; i++)
                  {
                      level[abilitySequence[i] - 1] = level[abilitySequence[i] - 1] + 1;
                  }
                  if (qL < level[0]) ObjectManager.Player.Spellbook.LevelSpell(SpellSlot.Q);
                  if (wL < level[1]) ObjectManager.Player.Spellbook.LevelSpell(SpellSlot.W);
                  if (eL < level[2]) ObjectManager.Player.Spellbook.LevelSpell(SpellSlot.E);
                  if (rL < level[3]) ObjectManager.Player.Spellbook.LevelSpell(SpellSlot.R);
  
              }
          }
  
          private static void GetSequence()
          {
              Smite = SpellSlot.Unknown;
              if (Player.BaseSkinName == "Aatrox") abilitySequence = new int[] { 2, 3, 1, 2, 2, 4, 2, 3, 2, 3, 4, 3, 3, 1, 1, 4, 2, 2 };
              else if (Player.BaseSkinName == "AurelionSol") abilitySequence = new int[] { 1, 2, 1, 3, 1, 4, 1, 2, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3 };
              else if (Player.BaseSkinName == "Ahri") abilitySequence = new int[] { 3, 1, 2, 1, 1, 4, 1, 2, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3 };
              else if (Player.BaseSkinName == "Akali") abilitySequence = new int[] { 3, 1, 3, 2, 3, 4, 3, 1, 3, 1, 4, 1, 1, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Alistar") abilitySequence = new int[] { 1, 2, 1, 3, 1, 4, 1, 2, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3 };
              else if (Player.BaseSkinName == "Amumu") abilitySequence = new int[] { 3, 2, 3, 1, 3, 4, 3, 1, 3, 1, 4, 1, 1, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Anivia") abilitySequence = new int[] { 1, 3, 3, 1, 3, 4, 3, 2, 3, 1, 4, 1, 1, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Annie") abilitySequence = new int[] { 1, 2, 1, 2, 1, 4, 1, 3, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3 };
              else if (Player.BaseSkinName == "Ashe") abilitySequence = new int[] { 1, 2, 3, 1, 1, 4, 1, 2, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3 };
              else if (Player.BaseSkinName == "Azir") abilitySequence = new int[] { 2, 1, 1, 3, 1, 4, 1, 2, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3 };
              else if (Player.BaseSkinName == "Blitzcrank") abilitySequence = new int[] { 1, 3, 1, 2, 1, 4, 1, 2, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3 };
              else if (Player.BaseSkinName == "Bard") abilitySequence = new int[] { 1, 2, 1, 3, 1, 4, 1, 2, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3 };
              else if (Player.BaseSkinName == "Brand") abilitySequence = new int[] { 2, 1, 3, 2, 2, 4, 2, 3, 2, 3, 4, 3, 3, 1, 1, 4, 1, 1 };
              else if (Player.BaseSkinName == "Braum") abilitySequence = new int[] { 1, 3, 2, 1, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Caitlyn") abilitySequence = new int[] { 1, 2, 1, 2, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Cassiopeia") abilitySequence = new int[] { 1, 3, 3, 2, 3, 4, 3, 1, 3, 1, 4, 1, 1, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Chogath") abilitySequence = new int[] { 3, 1, 2, 3, 3, 4, 3, 2, 3, 2, 4, 2, 2, 1, 1, 4, 1, 1 };
              else if (Player.BaseSkinName == "Corki")
              {
                  var player = HeroManager.Player;
                  if (player.TotalMagicalDamage - player.BaseAbilityDamage > player.TotalAttackDamage - player.BaseAttackDamage)
                  {
                      abilitySequence = new int[] { 1, 2, 1, 3, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
                      tipo = " AP";
                  }
  
                  else
                  {
                      abilitySequence = new int[] { 3, 1, 2, 1, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
                      tipo = " AD";
                  }
              }
              else if (Player.BaseSkinName == "Darius") abilitySequence = new int[] { 2, 1, 3, 1, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Diana")
              {
                  rOff = -1;
                  if (Smite != SpellSlot.Unknown)
                  {
                      abilitySequence = new int[] { 2, 1, 1, 3, 1, 4, 1, 2, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3 };
                      tipo = " Jungler";
                  }
                  else
                  {
                      abilitySequence = new int[] { 2, 1, 2, 3, 1, 4, 1, 1, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3 };
                      tipo = " Lane";
                  }
              }
              else if (Player.BaseSkinName == "DrMundo") abilitySequence = new int[] { 1, 3, 1, 2, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Draven") abilitySequence = new int[] { 1, 3, 1, 2, 1, 4, 1, 2, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3 };
              else if (Player.BaseSkinName == "Elise") abilitySequence = new int[] { 2, 1, 3, 1, 1, 4, 1, 2, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3 };
              else if (Player.BaseSkinName == "Evelynn") abilitySequence = new int[] { 1, 3, 2, 1, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Ezreal")
              {
                  var player = HeroManager.Player;
                  if (player.TotalMagicalDamage - player.BaseAbilityDamage > player.TotalAttackDamage - player.BaseAttackDamage)
                  {
                      abilitySequence = new int[] { 1, 2, 3, 2, 2, 4, 2, 3, 2, 3, 4, 3, 3, 1, 1, 4, 1, 1 };
                      tipo = " AP";
                  }
                  else
                  {
                      abilitySequence = new int[] { 1, 3, 1, 3, 1, 4, 1, 3, 1, 3, 4, 3, 2, 2, 2, 4, 2, 2 };
                      tipo = " AD";
                  }
              }
              else if (Player.BaseSkinName == "Ekko")
              {
                  rOff = -1;
                  if (Smite != SpellSlot.Unknown)
                  {
                      abilitySequence = new int[] { 2, 1, 3, 1, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
                      tipo = " Jungler";
                  }
                  else
                  {
                      abilitySequence = new int[] { 1, 3, 2, 1, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
                      tipo = " Lane";
                  }
              }
              else if (Player.BaseSkinName == "FiddleSticks") abilitySequence = new int[] { 2, 3, 2, 1, 2, 4, 2, 3, 2, 3, 4, 3, 3, 1, 1, 4, 1, 1 };
              else if (Player.BaseSkinName == "Fiora") abilitySequence = new int[] { 1, 3, 2, 1, 1, 4, 1, 2, 1, 2, 4, 3, 3, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Fizz")
              {
                  rOff = -1;
                  if (Smite != SpellSlot.Unknown)
                  {
                      abilitySequence = new int[] { 2, 3, 1, 2, 2, 4, 2, 3, 2, 3, 4, 3, 3, 1, 1, 4, 1, 1 };
                      tipo = " Jungler";
                  }
                  else
                  {
                      abilitySequence = new int[] { 3, 2, 1, 3, 3, 4, 3, 2, 3, 2, 4, 2, 2, 1, 1, 4, 1, 1 };
                      tipo = " Lane";
                  }
              }
              else if (Player.BaseSkinName == "Galio") abilitySequence = new int[] { 1, 2, 3, 1, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Gangplank") abilitySequence = new int[] { 1, 3, 2, 1, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Garen") abilitySequence = new int[] { 1, 3, 1, 2, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Gnar") abilitySequence = new int[] { 1, 3, 2, 1, 1, 4, 1, 2, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3 };
              else if (Player.BaseSkinName == "Gragas") abilitySequence = new int[] { 3, 2, 1, 1, 1, 4, 1, 2, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3 };
              else if (Player.BaseSkinName == "Graves") abilitySequence = new int[] { 1, 3, 1, 2, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Hecarim")
              {
                  rOff = -1;
                  if (Smite != SpellSlot.Unknown)
                  {
                      abilitySequence = new int[] { 1, 2, 1, 3, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
                      tipo = " Jungler";
                  }
                  else
                  {
                      abilitySequence = new int[] { 1, 2, 3, 1, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
                      tipo = " Lane";
                  }
              }
              else if (Player.BaseSkinName == "Heimerdinger") abilitySequence = new int[] { 1, 2, 3, 1, 1, 4, 1, 2, 1, 2, 4, 2, 2, 3, 3, 4, 2, 2 };
              else if (Player.BaseSkinName == "Irelia") abilitySequence = new int[] { 1, 3, 2, 3, 3, 4, 3, 2, 3, 2, 4, 2, 2, 1, 1, 4, 1, 1 };
              else if (Player.BaseSkinName == "Ivern") abilitySequence = new int[] { 1, 3, 2, 1, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Illaoi") abilitySequence = new int[] { 1, 3, 2, 1, 1, 4, 1, 2, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3 };
              else if (Player.BaseSkinName == "Janna") abilitySequence = new int[] { 3, 2, 1, 3, 3, 4, 3, 2, 3, 2, 4, 2, 2, 1, 1, 4, 1, 1 };
              else if (Player.BaseSkinName == "JarvanIV")
              {
                  if (Smite != SpellSlot.Unknown)
                  {
                      abilitySequence = new int[] { 3, 1, 1, 2, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
                      tipo = " Jungler";
                  }
                  else
                  {
                      abilitySequence = new int[] { 1, 3, 1, 2, 1, 4, 1, 3, 1, 4, 3, 3, 2, 2, 4, 2, 2 };
                      tipo = " Lane";
                  }
              }
              else if (Player.BaseSkinName == "Jax")
              {
                  if (Smite != SpellSlot.Unknown)
                  {
                      abilitySequence = new int[] { 3, 2, 2, 1, 2, 4, 2, 3, 2, 3, 4, 3, 3, 1, 1, 4, 1, 1 };
                      tipo = " Jungler";
                  }
                  else
                  {
                      abilitySequence = new int[] { 3, 1, 2, 1, 1, 4, 1, 2, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3 };
                      tipo = " Lane";
                  }
              }
              else if (Player.BaseSkinName == "Jayce") { abilitySequence = new int[] { 1, 3, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 3, 3, 3, 3, 3 }; rOff = -1; }
              else if (Player.BaseSkinName == "Jinx") abilitySequence = new int[] { 1, 3, 1, 2, 1, 4, 1, 2, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3 };
              else if (Player.BaseSkinName == "Jhin") abilitySequence = new int[] { 2, 1, 1, 3, 1, 4, 1, 2, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3 };
              else if (Player.BaseSkinName == "Kindred") abilitySequence = new int[] { 2, 1, 1, 3, 1, 4, 1, 2, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3 };
              else if (Player.BaseSkinName == "Karma") { abilitySequence = new int[] { 1, 3, 1, 2, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 }; rOff = -1; }
              else if (Player.BaseSkinName == "Karthus") abilitySequence = new int[] { 1, 3, 1, 2, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Kassadin") abilitySequence = new int[] { 1, 2, 1, 3, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Katarina") abilitySequence = new int[] { 1, 3, 1, 2, 1, 4, 1, 2, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3 };
              else if (Player.BaseSkinName == "Kalista") abilitySequence = new int[] { 3, 1, 3, 2, 3, 4, 1, 3, 3, 1, 4, 1, 1, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Kayle") abilitySequence = new int[] { 3, 1, 2, 1, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Kennen") abilitySequence = new int[] { 1, 2, 3, 2, 2, 4, 2, 1, 2, 1, 4, 1, 1, 3, 3, 4, 3, 3 };
              else if (Player.BaseSkinName == "Khazix") abilitySequence = new int[] { 1, 2, 2, 3, 1, 4, 1, 1, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3 };
              else if (Player.BaseSkinName == "KogMaw") abilitySequence = new int[] { 2, 1, 2, 3, 2, 4, 2, 1, 2, 1, 4, 1, 1, 3, 3, 4, 3, 3 };
              else if (Player.BaseSkinName == "Leblanc") abilitySequence = new int[] { 2, 1, 2, 3, 2, 4, 2, 1, 2, 1, 4, 1, 1, 3, 3, 4, 3, 3 };
              else if (Player.BaseSkinName == "LeeSin") abilitySequence = new int[] { 1, 2, 3, 1, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Leona") abilitySequence = new int[] { 3, 1, 2, 2, 2, 4, 2, 1, 2, 1, 4, 1, 1, 3, 3, 4, 3, 3 };
              else if (Player.BaseSkinName == "Lissandra") abilitySequence = new int[] { 1, 2, 1, 3, 1, 4, 1, 2, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3 };
              else if (Player.BaseSkinName == "Lucian") abilitySequence = new int[] { 1, 3, 1, 2, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Lulu") abilitySequence = new int[] { 1, 3, 1, 2, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Lux") abilitySequence = new int[] { 1, 3, 3, 2, 3, 4, 3, 1, 3, 1, 4, 1, 1, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Malphite") abilitySequence = new int[] { 1, 2, 3, 1, 1, 4, 1, 2, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3 };
              else if (Player.BaseSkinName == "Malzahar") abilitySequence = new int[] { 3, 2, 1, 3, 3, 4, 3, 2, 3, 2, 4, 2, 2, 1, 1, 4, 1, 1 };
              else if (Player.BaseSkinName == "Maokai")
              {
                  if (Smite != SpellSlot.Unknown)
                  {
                      abilitySequence = new int[] { 3, 1, 2, 1, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
                      tipo = " Jungler";
                  }
                  else
                  {
                      abilitySequence = new int[] { 1, 3, 2, 1, 1, 4, 1, 2, 1, 2, 4, 2, 2, 3, 3, 4, 3, 3 };
                      tipo = " Lane";
                  }
              }
              else if (Player.BaseSkinName == "MasterYi") abilitySequence = new int[] { 1, 3, 1, 2, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "MissFortune") abilitySequence = new int[] { 3, 2, 3, 1, 3, 4, 3, 2, 3, 2, 4, 2, 2, 1, 1, 4, 1, 1 };
              else if (Player.BaseSkinName == "Mordekaiser") abilitySequence = new int[] { 2, 3, 1, 2, 2, 4, 2, 1, 2, 1, 4, 1, 1, 3, 3, 4, 3, 3 };
              else if (Player.BaseSkinName == "Morgana") abilitySequence = new int[] { 1, 3, 1, 2, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Nami") abilitySequence = new int[] { 1, 2, 2, 3, 2, 4, 2, 3, 2, 3, 4, 3, 3, 1, 1, 4, 1, 1 };
              else if (Player.BaseSkinName == "Nasus") abilitySequence = new int[] { 1, 2, 1, 3, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Nautilus") abilitySequence = new int[] { 1, 3, 2, 3, 3, 4, 3, 2, 3, 2, 4, 2, 2, 1, 1, 4, 1, 1 };
              else if (Player.BaseSkinName == "Nidalee") { abilitySequence = new int[] { 1, 2, 3, 1, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 3, 3 }; rOff = -1; }
              else if (Player.BaseSkinName == "Nocturne") abilitySequence = new int[] { 1, 2, 1, 3, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Nunu") abilitySequence = new int[] { 1, 3, 2, 1, 1, 4, 1, 3, 1, 3, 4, 3, 3, 2, 2, 4, 2, 2 };
              else if (Player.BaseSkinName == "Olaf")
              {
  
gt:                 if (Smite != SpellSlot.Unknown)