Example #1
0
 /// <summary>
 ///  Selects <paramref name="rop2"/> into the given <paramref name="hdc"/>.
 /// </summary>
 public Rop2Scope(IntPtr hdc, R2 rop2)
 {
     _hdc         = hdc;
     _previousRop = SetROP2(hdc, rop2);
 }
Example #2
0
        public static void Combo()
        {
            var target = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Physical);

            if (target != null)
            {
                if (Menu.Config.Item("q.combo").IsActive())
                {
                    if (Q.CanCast(target))
                    {
                        if (target.IsMoving && target.GetWaypoints().Count >= 2)
                        {
                            //var qpred = Q.GetPrediction(target);
                            var x = target.Position.Extend(Prediction.GetPrediction(target, Q.Delay).UnitPosition, 300);

                            if (Q.IsInRange(x))
                            {
                                Q.Cast(x);
                                return;
                            }
                        }

                        var qpred = Q.GetPrediction(target);
                        if (qpred.Hitchance >= HitChance.Dashing)
                        {
                            Q.Cast(qpred.CastPosition);
                        }
                    }
                }

                if (Menu.Config.Item("e.combo").IsActive())
                {
                    if (E.IsReady() && Player.IsFacing(target))
                    {
                        E.Cast(target);
                    }
                }
            }

            if (Menu.Config.Item("r.combo").IsActive() && Menu.Config.Item("r.combo.stacks").GetValue <Slider>().Value < R.Instance.Ammo)
            {
                if (R.IsReady())
                {
                    var r2 = Player.HasBuff("corkimissilebarragecounterbig");
                    if (!r2)
                    {
                        var rtarget = TargetSelector.GetTarget(R.Range, TargetSelector.DamageType.Magical);
                        if (rtarget == null)
                        {
                            return;
                        }
                        var pred = R.GetPrediction(rtarget);
                        if (R.CanCast(rtarget))
                        {
                            switch (pred.Hitchance)
                            {
                            case HitChance.High:
                            case HitChance.VeryHigh:
                            case HitChance.Immobile:
                                R.Cast(pred.CastPosition);
                                break;

                            case HitChance.Collision:
                                var colliding =
                                    pred.CollisionObjects.OrderBy(o => o.Distance(Player.ServerPosition)).ToList();
                                if (colliding[0].Distance(rtarget.ServerPosition) <= 200 + colliding[0].BoundingRadius)
                                {
                                    R.Cast(pred.CastPosition);
                                }
                                break;
                            }
                        }
                    }
                    else
                    {
                        var rtarget = TargetSelector.GetTarget(R2.Range, TargetSelector.DamageType.Magical);
                        if (rtarget == null)
                        {
                            return;
                        }
                        var pred = R2.GetPrediction(rtarget);
                        if (R2.CanCast(rtarget))
                        {
                            switch (pred.Hitchance)
                            {
                            case HitChance.High:
                            case HitChance.VeryHigh:
                            case HitChance.Immobile:
                                R2.Cast(pred.CastPosition);
                                break;

                            case HitChance.Collision:
                                var colliding =
                                    pred.CollisionObjects.OrderBy(o => o.Distance(Player.ServerPosition)).ToList();
                                if (colliding[0].Distance(rtarget.ServerPosition) <= 200 + colliding[0].BoundingRadius)
                                {
                                    R.Cast(pred.CastPosition);
                                }
                                break;
                            }
                        }
                    }
                }
            }
        }
Example #3
0
        private static void ComboLogic()
        {
            if (ComboW)
            {
                var t = EntityManager.Heroes.Enemies.Find(x => x.IsValidTarget(W.Range) && !x.HasBuffOfType(BuffType.SpellShield));

                if (t != null)
                {
                    if (W.IsReady() && !Orbwalker.CanAutoAttack)
                    {
                        W.Cast();
                    }
                }
            }

            if (E.IsReady())
            {
                var t = EntityManager.Heroes.Enemies.Where(e => e.IsValidTarget(E.Range + myHero.GetAutoAttackRange()));

                if (t == null)
                {
                    return;
                }

                var t12 = t.OrderByDescending(e => TargetSelector.GetPriority(e)).FirstOrDefault();

                if (t12 != null)
                {
                    if (myHero.Distance(t12) > myHero.GetAutoAttackRange() + 20)
                    {
                        E.Cast(t12.ServerPosition);
                    }
                }
                if (ComboE == 0)
                {
                    var t1 = t.OrderByDescending(e => TargetSelector.GetPriority(e)).FirstOrDefault();

                    if (t1 != null)
                    {
                        E.Cast(t1.ServerPosition);
                    }
                }
                else if (ComboE == 1)
                {
                    if (t != null)
                    {
                        E.Cast(Game.CursorPos);
                    }
                }
            }

            if (ComboR)
            {
                if (R1.IsReady())
                {
                    if (useR1 && !myHero.HasBuff("RivenFengShuiEngine"))
                    {
                        var t = TargetSelector.GetTarget(900, DamageType.Physical);
                        if (t == null)
                        {
                            return;
                        }
                        if (t.Distance(myHero.ServerPosition) < E.Range + myHero.AttackRange && myHero.CountEnemiesInRange(500) >= 1)
                        {
                            R1.Cast();
                        }
                    }

                    if (myHero.HasBuff("RivenFengShuiEngine"))
                    {
                        var t = TargetSelector.GetTarget(900, DamageType.Physical);
                        if (t == null)
                        {
                            return;
                        }
                        if (t.ServerPosition.Distance(myHero.ServerPosition) < 850)
                        {
                            switch (R2Mode)
                            {
                            case 0:
                                if (Rdame(t, t.Health) > t.Health && t.IsValidTarget(R2.Range) && t.Distance(myHero.ServerPosition) < 600)
                                {
                                    CastR2 = true;
                                }
                                else
                                {
                                    CastR2 = false;
                                }
                                break;

                            case 1:
                                if (t.HealthPercent < 25 && t.Health > Rdame(t, t.Health) + Damage.GetAutoAttackDamage(myHero, t) * 2)
                                {
                                    CastR2 = true;
                                }
                                else
                                {
                                    CastR2 = false;
                                }
                                break;

                            case 2:
                                if (t.IsValidTarget(R2.Range) && t.Distance(myHero.ServerPosition) < 600)
                                {
                                    CastR2 = true;
                                }
                                else
                                {
                                    CastR2 = false;
                                }
                                break;

                            case 3:
                                CastR2 = false;
                                break;
                            }
                        }

                        if (CastR2)
                        {
                            R2.Cast(t);
                        }
                    }
                }
            }
        }
Example #4
0
 private static void Fight(string mode)
 {
     if (GetValue <bool>(mode, "P") && HaveP && Orbwalk.GetBestHeroTarget != null && Orbwalk.CanAttack)
     {
         return;
     }
     if (GetValue <bool>(mode, "Q") && Q.IsReady())
     {
         if (IsQOne)
         {
             var target = Q.GetTarget();
             if (target != null)
             {
                 var state = Q.Cast(target, PacketCast);
                 if (state.IsCasted())
                 {
                     return;
                 }
                 if (state == Spell.CastStates.Collision && GetValue <bool>(mode, "QCol") && Smite.IsReady())
                 {
                     var pred = Q.GetPrediction(target);
                     if (
                         pred.CollisionObjects.Count(
                             i => i.IsValid <Obj_AI_Minion>() && IsSmiteable((Obj_AI_Minion)i)) == 1 &&
                         CastSmite(pred.CollisionObjects.First()) && Q.Cast(pred.CastPosition, PacketCast))
                     {
                         return;
                     }
                 }
             }
         }
         else
         {
             var target = Q2.GetTarget(0, HeroManager.Enemies.Where(i => !HaveQ(i)));
             if (target != null &&
                 (QAgain(target) ||
                  ((target.HasBuffOfType(BuffType.Knockback) || target.HasBuffOfType(BuffType.Knockup)) &&
                   Player.Distance(target) > 300 && !R.IsReady()) || Q.IsKillable(target, 1) ||
                  !Orbwalk.InAutoAttackRange(target, 100) || (Orbwalk.InAutoAttackRange(target) && !HaveP)) &&
                 Q2.Cast(PacketCast))
             {
                 return;
             }
             if (target == null)
             {
                 var sub = Q2.GetTarget();
                 if (sub != null && ObjHaveQ.Any(i => i.Distance(sub) < Player.Distance(sub)) &&
                     Q2.Cast(PacketCast))
                 {
                     return;
                 }
             }
         }
     }
     if (GetValue <bool>(mode, "E") && E.IsReady())
     {
         if (IsEOne)
         {
             if (E.GetTarget() != null && E.Cast(PacketCast))
             {
                 return;
             }
         }
         else if (
             HeroManager.Enemies.Where(i => i.IsValidTarget(E2.Range) && HaveE(i))
             .Any(
                 i =>
                 EAgain(i) || !Orbwalk.InAutoAttackRange(i, 50) ||
                 (Orbwalk.InAutoAttackRange(i) && !HaveP)) && Player.Mana >= 50 &&
             E2.Cast(PacketCast))
         {
             return;
         }
     }
     if (GetValue <bool>(mode, "R") && R.IsReady())
     {
         var target = R.GetTarget(0, HeroManager.Enemies.Where(i => !HaveQ(i)));
         if (GetValue <bool>(mode, "Q") && Q.IsReady() && !IsQOne && target != null)
         {
             if (CanKill(target, GetQ2Dmg(target, R.GetDamage(target))) && R.CastOnUnit(target, PacketCast))
             {
                 return;
             }
         }
         else
         {
             target = R.GetTarget();
             if (target != null && R.IsKillable(target))
             {
                 if (R.CastOnUnit(target, PacketCast))
                 {
                     return;
                 }
             }
             else if (GetValue <bool>(mode, "RBehind"))
             {
                 foreach (
                     var enemy in HeroManager.Enemies.Where(i => i.IsValidTarget(R.Range) && !R.IsKillable(i)))
                 {
                     R2.UpdateSourcePosition(enemy.ServerPosition, enemy.ServerPosition);
                     if (
                         HeroManager.Enemies.Any(
                             i =>
                             i.IsValidTarget(R2.Range) && i.NetworkId != enemy.NetworkId &&
                             R2.WillHit(
                                 i, enemy.ServerPosition.Extend(Player.ServerPosition, -R2.Range),
                                 (int)enemy.BoundingRadius + 50) && R.IsKillable(i)) &&
                         R.CastOnUnit(enemy, PacketCast))
                     {
                         break;
                     }
                 }
             }
         }
     }
     if (GetValue <bool>(mode, "W") && W.IsReady() && Orbwalk.GetBestHeroTarget != null)
     {
         if (IsWOne)
         {
             if (Player.HealthPercent < GetValue <Slider>(mode, "WHpU").Value)
             {
                 W.Cast(PacketCast);
             }
         }
         else if (!Player.HasBuff("BlindMonkSafeguard") &&
                  (Player.HealthPercent < GetValue <Slider>(mode, "WHpU").Value || !HaveP))
         {
             W.Cast(PacketCast);
         }
     }
 }
Example #5
0
        public override void GameOnUpdate(EventArgs args)
        {
            if (R1.IsReady() && GetValue <bool>("UseRM"))
            {
                bool bigRocket = HasBigRocket();
                foreach (
                    AIHeroClient hero in
                    ObjectManager.Get <AIHeroClient>()
                    .Where(
                        hero =>
                        hero.IsValidTarget(bigRocket ? R2.Range : R1.Range) &&
                        R1.GetDamage(hero) * (bigRocket ? 1.5f : 1f) > hero.Health))
                {
                    if (bigRocket)
                    {
                        R2.Cast(hero, false, true);
                    }
                    else
                    {
                        R1.Cast(hero, false, true);
                    }
                }
            }

            if ((!ComboActive && !HarassActive) || !Orbwalking.CanMove(100))
            {
                return;
            }

            var useQ = GetValue <bool>("UseQ" + (ComboActive ? "C" : "H"));
            var useE = GetValue <bool>("UseE" + (ComboActive ? "C" : "H"));
            var useR = GetValue <bool>("UseR" + (ComboActive ? "C" : "H"));
            var rLim = GetValue <Slider>("Rlim" + (ComboActive ? "C" : "H")).Value;

            if (useQ && Q.IsReady())
            {
                var t = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Magical);
                if (t != null)
                {
                    if (Q.Cast(t, false, true) == Spell.CastStates.SuccessfullyCasted)
                    {
                        return;
                    }
                }
            }

            if (useE && E.IsReady())
            {
                var t = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Physical);
                if (t.IsValidTarget())
                {
                    if (E.Cast(t, false, true) == Spell.CastStates.SuccessfullyCasted)
                    {
                        return;
                    }
                }
            }

            if (useR && R1.IsReady() && ObjectManager.Player.Spellbook.GetSpell(SpellSlot.R).Ammo > rLim)
            {
                bool         bigRocket = HasBigRocket();
                AIHeroClient t         = TargetSelector.GetTarget(bigRocket ? R2.Range : R1.Range, TargetSelector.DamageType.Magical);

                if (t.IsValidTarget())
                {
                    if (bigRocket)
                    {
                        R2.Cast(t, false, true);
                    }
                    else
                    {
                        R1.Cast(t, false, true);
                    }
                }
            }
        }
Example #6
0
        protected override void Drawing_OnDraw(EventArgs args)
        {
            if (menu.Item("Draw_Disabled", true).GetValue <bool>())
            {
                return;
            }

            if (menu.Item("Draw_Q", true).GetValue <bool>())
            {
                if (Q.Level > 0)
                {
                    Render.Circle.DrawCircle(Player.Position, Q.Range, Q.IsReady() ? Color.Green : Color.Red);
                }
            }

            if (menu.Item("Draw_W", true).GetValue <bool>())
            {
                if (W.Level > 0)
                {
                    Render.Circle.DrawCircle(Player.Position, W.Range - 2, W.IsReady() ? Color.Green : Color.Red);
                }
            }

            if (menu.Item("Draw_E", true).GetValue <bool>())
            {
                if (E.Level > 0)
                {
                    Render.Circle.DrawCircle(Player.Position, E.Range, E.IsReady() ? Color.Green : Color.Red);
                }
            }

            if (menu.Item("Draw_R", true).GetValue <bool>())
            {
                if (R.Level > 0)
                {
                    Render.Circle.DrawCircle(Player.Position, R.Range, R.IsReady() ? Color.Green : Color.Red);
                }
            }


            if (menu.Item("Draw_R_Pred", true).GetValue <bool>() && R.IsReady())
            {
                if (countEnemiesNearPosition(Player.ServerPosition, R.Range + 500) < 2)
                {
                    var target = TargetSelector.GetTarget(R.Range, TargetSelector.DamageType.Magical);

                    if (target == null)
                    {
                        return;
                    }

                    var vector1 = target.ServerPosition - Vector3.Normalize(target.ServerPosition - Player.ServerPosition) * 300;

                    R2.UpdateSourcePosition(vector1, vector1);

                    var pred = R2.GetPrediction(target, true);

                    var midpoint = (Player.ServerPosition + pred.UnitPosition) / 2;
                    var vector2  = midpoint - Vector3.Normalize(pred.UnitPosition - Player.ServerPosition) * 300;

                    if (Player.Distance(target) < 400)
                    {
                        vector1 = midpoint + Vector3.Normalize(pred.UnitPosition - Player.ServerPosition) * 800;
                        if (!IsPassWall(pred.UnitPosition, vector1) && !IsPassWall(pred.UnitPosition, vector2))
                        {
                            Vector2 wts = Drawing.WorldToScreen(Player.Position);
                            Drawing.DrawText(wts[0], wts[1], Color.Wheat, "Hit: " + 1);

                            Vector2 wtsPlayer = Drawing.WorldToScreen(vector1);
                            Vector2 wtsPred   = Drawing.WorldToScreen(vector2);

                            Drawing.DrawLine(wtsPlayer, wtsPred, 1, Color.Wheat);
                            Render.Circle.DrawCircle(vector1, 50, Color.Aqua);
                            Render.Circle.DrawCircle(vector2, 50, Color.Yellow);
                            Render.Circle.DrawCircle(pred.UnitPosition, 50, Color.Red);
                        }
                    }
                    else if (!IsPassWall(pred.UnitPosition, vector1) && !IsPassWall(pred.UnitPosition, pred.CastPosition))
                    {
                        if (pred.Hitchance >= HitChance.Medium)
                        {
                            Vector2 wts = Drawing.WorldToScreen(Player.Position);
                            Drawing.DrawText(wts[0], wts[1], Color.Wheat, "Hit: " + 1);

                            Vector2 wtsPlayer = Drawing.WorldToScreen(vector1);
                            Vector2 wtsPred   = Drawing.WorldToScreen(pred.CastPosition);

                            Drawing.DrawLine(wtsPlayer, wtsPred, 1, Color.Wheat);
                            Render.Circle.DrawCircle(vector1, 50, Color.Aqua);
                            Render.Circle.DrawCircle(pred.CastPosition, 50, Color.Yellow);
                        }
                    }
                    return;
                }
                //-----------------------------------------------------------------Draw Ult Mec-----------------------------------------------
                int     maxHit = 0;
                Vector3 start  = Vector3.Zero;
                Vector3 end    = Vector3.Zero;
                Vector3 mid    = Vector3.Zero;
                //loop one
                foreach (var target in ObjectManager.Get <Obj_AI_Hero>().Where(x => x.IsValidTarget(R.Range)).OrderByDescending(GetComboDamage))
                {
                    //loop 2
                    foreach (
                        var enemy in
                        ObjectManager.Get <Obj_AI_Hero>()
                        .Where(
                            x =>
                            x.IsValidTarget(R.Range + 1000) && x.NetworkId != target.NetworkId &&
                            x.Distance(target) < 900)
                        .OrderByDescending(x => x.Distance(target)))
                    {
                        int hit = 2;

                        var targetPred = Prediction.GetPrediction(target, .25f);
                        var enemyPred  = Prediction.GetPrediction(enemy, .25f);

                        var midpoint = (enemyPred.CastPosition + targetPred.CastPosition) / 2;

                        var startpos = midpoint + Vector3.Normalize(enemyPred.CastPosition - targetPred.CastPosition) * 600;
                        var endPos   = midpoint - Vector3.Normalize(enemyPred.CastPosition - targetPred.CastPosition) * 600;

                        if (!IsPassWall(midpoint, startpos) && !IsPassWall(midpoint, endPos) && countEnemiesNearPosition(Player.ServerPosition, R.Range + 1000) > 2)
                        {
                            //loop 3
                            foreach (var enemy2 in ObjectManager.Get <Obj_AI_Hero>().Where(x => x.IsValidTarget(R.Range + 1000) && x.NetworkId != target.NetworkId && x.NetworkId != enemy.NetworkId && x.Distance(target) < 1000))
                            {
                                var enemy2Pred = Prediction.GetPrediction(enemy2, .25f);

                                Object[] obj       = VectorPointProjectionOnLineSegment(startpos.To2D(), endPos.To2D(), enemy2Pred.CastPosition.To2D());
                                var      isOnseg   = (bool)obj[2];
                                var      pointLine = (Vector2)obj[1];

                                if (pointLine.Distance(enemy2Pred.CastPosition.To2D()) < 100 + enemy2.BoundingRadius &&
                                    isOnseg)
                                {
                                    hit++;
                                }
                            }
                        }
                        if (hit > maxHit)
                        {
                            maxHit = hit;
                            start  = startpos;
                            end    = endPos;
                            mid    = midpoint;
                        }
                    }
                }

                if (maxHit >= 2)
                {
                    Vector2 wts = Drawing.WorldToScreen(Player.Position);
                    Drawing.DrawText(wts[0], wts[1], Color.Wheat, "Hit: " + maxHit);

                    Vector2 wtsPlayer = Drawing.WorldToScreen(start);
                    Vector2 wtsPred   = Drawing.WorldToScreen(end);

                    Drawing.DrawLine(wtsPlayer, wtsPred, 1, Color.Wheat);
                    Render.Circle.DrawCircle(start, 50, Color.Aqua);
                    Render.Circle.DrawCircle(end, 50, Color.Yellow);
                    Render.Circle.DrawCircle(mid, 50, Color.Red);
                }
                //---------------------------------------------------End drawing Ult Mec---------------------------------------
            }
        }
Example #7
0
        protected override void Game_OnGameUpdate(EventArgs args)
        {
            if (Player.IsDead)
            {
                return;
            }

            SmartKs();

            if (Menu.Item("FarmT", true).GetValue <KeyBind>().Active)
            {
                Harass();
            }

            if (Menu.Item("wAtk", true).GetValue <bool>())
            {
                AutoAtk();
            }

            switch (Orbwalker.ActiveMode)
            {
            case Orbwalking.OrbwalkingMode.Combo:
                Combo();
                break;

            case Orbwalking.OrbwalkingMode.Mixed:
                Harass();
                break;

            case Orbwalking.OrbwalkingMode.LaneClear:
                Farm();
                JungleClear();
                break;

            case Orbwalking.OrbwalkingMode.Flee:
                Escape();
                break;

            case Orbwalking.OrbwalkingMode.LastHit:
                break;

            case Orbwalking.OrbwalkingMode.Freeze:
                break;

            case Orbwalking.OrbwalkingMode.CustomMode:
                break;

            case Orbwalking.OrbwalkingMode.None:
                if (Menu.Item("insec", true).GetValue <KeyBind>().Active)
                {
                    Orbwalking.MoveTo(Game.CursorPos);

                    _insecTarget = TargetSelector.GetSelectedTarget();

                    if (_insecTarget != null)
                    {
                        if (_insecTarget.HasBuffOfType(BuffType.Knockup) ||
                            _insecTarget.HasBuffOfType(BuffType.Knockback))
                        {
                            if (Player.ServerPosition.Distance(_insecTarget.ServerPosition) < 200)
                            {
                                R2.Cast(InsecPosition);
                            }
                        }

                        Insec();
                    }
                }
                else
                {
                    InsecPosition = new Vector3(0, 0, 0);
                }

                if (Menu.Item("qeCombo", true).GetValue <KeyBind>().Active)
                {
                    var soldierTarget = TargetSelector.GetTarget(900, TargetSelector.DamageType.Magical);

                    Orbwalking.MoveTo(Game.CursorPos);

                    CastQe(soldierTarget, "Null");
                }
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Example #8
0
 public static partial R2 SetROP2(HDC hdc, R2 rop2);
Example #9
0
 public static extern R2 SetROP2(HDC hdc, R2 rop2);
Example #10
0
 public override int GetHashCode()
 {
     return(R1.GetHashCode() ^ R2.GetHashCode() ^ C.GetHashCode());
 }
Example #11
0
 public static extern IntPtr SetROP2(IntPtr hdc, R2 nDrawMode);
Example #12
0
        //  OutputArray _R, OutputArray _t, double distanceThresh, InputOutputArray _mask, OutputArray triangulatedPoints

        public static int RecoverPose(Mat E, PointF[] _points1, PointF[] _points2, Mat _cameraMatrix, double _distanceThresh, out Mat _R, out Mat _t, out Mat _PM)
        {
            Mat pointsMat1 = new Mat();
            Mat pointsMat2 = new Mat();
            Mat cameraMat  = new Mat();

            cameraMat = _cameraMatrix;


            _R  = new Mat();
            _t  = new Mat();
            _PM = new Mat();

            double[,] p1;
            double[,] p2;

            if (_points1.Length <= _points2.Length)
            {
                p1 = new double[_points1.Length, 2];
                p2 = new double[_points1.Length, 2];
            }
            else
            {
                p1 = new double[_points2.Length, 2];

                p2 = new double[_points2.Length, 2];
            }

            for (int i = 0; i < _points1.Length && i < _points2.Length; i++)
            {
                p1[i, 0] = (double)_points1[i].X;
                p1[i, 1] = (double)_points1[i].Y;

                p2[i, 0] = (double)_points2[i].X;
                p2[i, 1] = (double)_points2[i].Y;
            }


            Matrix <double> points1      = new Matrix <double>(p1);
            Matrix <double> points2      = new Matrix <double>(p2);
            Matrix <double> cameraMatrix = new Matrix <double>(cameraMat.Rows, cameraMat.Cols, cameraMat.NumberOfChannels);

            cameraMat.CopyTo(cameraMatrix);

            //Need points1.checkVector

            Debug.Assert(cameraMatrix.Rows == 3 && cameraMatrix.Cols == 3 && cameraMatrix.NumberOfChannels == 1);

            double fx = cameraMatrix[0, 0];
            double fy = cameraMatrix[1, 1];
            double cx = cameraMatrix[0, 2];
            double cy = cameraMatrix[1, 2];

            for (int i = 0; i < points1.Rows; i++)
            {
                points1[i, 0] = (points1[i, 0] - cx) / fx;
                points2[i, 0] = (points2[i, 0] - cx) / fx;
                points1[i, 1] = (points1[i, 1] - cy) / fy;
                points2[i, 1] = (points2[i, 1] - cy) / fy;
            }

            Matrix <double> temp1 = new Matrix <double>(points1.Cols, points1.Rows);
            Matrix <double> temp2 = new Matrix <double>(points2.Cols, points2.Rows);

            CvInvoke.Transpose(points1, temp1);
            CvInvoke.Transpose(points2, temp2);
            points1 = temp1;
            points2 = temp2;

            Matrix <double> R1;
            Matrix <double> R2;
            Matrix <double> t;

            DecomposeEssentialMat(E, out R1, out R2, out t); // we are doing decomposition of E


            double[,] I = { { 1, 0, 0, 0 },
                            { 0, 1, 0, 0 },
                            { 0, 0, 1, 0 } };

            Matrix <double> P0 = new Matrix <double>(I); // And we have 4 results
            Matrix <double> P1 = R1.ConcateHorizontal(t);
            Matrix <double> P2 = R2.ConcateHorizontal(t);
            Matrix <double> P3 = R1.ConcateHorizontal(t * (-1));
            Matrix <double> P4 = R2.ConcateHorizontal(t * (-1));

            // Do the cheirality check.
            // Notice here a threshold dist is used to filter
            // out far away points (i.e. infinite points) since
            // their depth may vary between positive and negtive.

            Mat[] allTriangulations = new Mat[4];
            int   good1             = Mask(P0, P1, points1, points2, _distanceThresh);
            int   good2             = Mask(P0, P2, points1, points2, _distanceThresh);
            int   good3             = Mask(P0, P3, points1, points2, _distanceThresh);
            int   good4             = Mask(P0, P4, points1, points2, _distanceThresh);



            if (good1 >= good2 && good1 >= good3 && good1 >= good4)
            {
                _R  = R1.Mat;
                _t  = t.Mat;
                _PM = P1.Mat;
                return(good1);
            }
            else if (good2 >= good1 && good2 >= good3 && good2 >= good4)
            {
                _R  = R2.Mat;
                _t  = t.Mat;
                _PM = P2.Mat;
                return(good2);
            }
            else if (good3 >= good1 && good3 >= good2 && good3 >= good4)
            {
                t   = t * (-1);
                _R  = R1.Mat;
                _t  = t.Mat;
                _PM = P3.Mat;
                return(good3);
            }
            else
            {
                t   = t * (-1);
                _R  = R2.Mat;
                _t  = t.Mat;
                _PM = P4.Mat;
                return(good4);
            }
        }
Example #13
0
        private static void Combo()
        {
            if (ComboMenu["ComboW"].Cast <CheckBox>().CurrentValue)
            {
                var t = EntityManager.Heroes.Enemies.Find(x => x.IsValidTarget(W.Range) && !x.HasBuffOfType(BuffType.SpellShield));

                if (t != null)
                {
                    if (W.IsReady() && !Orbwalker.CanAutoAttack)


                    {
                        W.Cast();
                    }

                    UseItems(t);
                    UseItems2(t);
                }
            }

            if (E.IsReady())
            {
                var t = EntityManager.Heroes.Enemies.Where(e => e.IsValidTarget(E.Range + myHero.GetAutoAttackRange()));

                if (t == null)
                {
                    return;
                }

                if (ComboMenu["ComboE"].Cast <CheckBox>().CurrentValue)
                {
                    var t1 = t.OrderByDescending(e => TargetSelector.GetPriority(e)).FirstOrDefault();

                    if (t1 != null)
                    {
                        E.Cast(t1.ServerPosition);
                    }
                }
            }

            {
                if (ComboMenu["RForce"].Cast <KeyBind>().CurrentValue)
                {
                    if (R1.IsReady())
                    {
                        if (ComboMenu["RForce"].Cast <KeyBind>().CurrentValue&& !myHero.HasBuff("RivenFengShuiEngine"))
                        {
                            var t = TargetSelector.GetTarget(700, DamageType.Physical);
                            if (t == null)
                            {
                                return;
                            }
                            if (t.Distance(myHero.ServerPosition) < E.Range + myHero.AttackRange && myHero.CountEnemiesInRange(500) >= 1)
                            {
                                R1.Cast();
                            }
                        }

                        if (myHero.HasBuff("RivenFengShuiEngine"))
                        {
                            var t = TargetSelector.GetTarget(900, DamageType.Physical);
                            if (t == null)
                            {
                                return;
                            }

                            {
                                if (ComboBox(ComboMenu, "UseRType") == 0)
                                {
                                    var target = TargetSelector.SelectedTarget;
                                    if (DamageIndicators.Rdmg(t, t.Health) > t.Health && t.IsValidTarget(R2.Range) && t.Distance(myHero.ServerPosition) < 600)
                                    {
                                        R2.Cast(t.ServerPosition);
                                    }
                                    else
                                    {
                                        CastR2 = false;
                                    }
                                }
                                else if (ComboBox(ComboMenu, "UseRType") == 1)
                                {
                                    var prediction = R2.GetPrediction(t);
                                    if (t.HealthPercent < 50 && t.Health > DamageIndicators.Rdmg(t, t.Health) + Damage.GetAutoAttackDamage(myHero, t) * 2)
                                    {
                                        R2.Cast(t.ServerPosition);
                                    }
                                    else
                                    {
                                        CastR2 = false;
                                    }
                                }

                                else if (ComboBox(ComboMenu, "UseRType") == 2)
                                {
                                    if (t.IsValidTarget(R2.Range) && t.Distance(myHero.ServerPosition) < 200)
                                    {
                                        R2.Cast(t.ServerPosition);
                                    }
                                    else
                                    {
                                        CastR2 = false;
                                    }
                                }
                                else if (ComboBox(ComboMenu, "UseRType") == 3)
                                {
                                    CastR2 = false;
                                }
                            }

                            if (CastR2)
                            {
                                R2.Cast(t);
                            }
                        }
                    }
                }
            }
        }
Example #14
0
 private static void ForceR2()
 {
     forceR2 = R2.IsReady() && R2.Name == IsSecondR;
     Core.DelayAction(() => forceR2 = false, 500);
 }
Example #15
0
        public static void Execute()
        {
            //////////////////////////////////////////////////////////////////////////////////////////
            var   target = TargetSelector.GetTarget(E.Range, DamageType.Physical);
            float dist   = (float)(Q.Range + player.MoveSpeed * 2.5);
            var   useQ   = ComboMenu.GetCheckBoxValue("qUse");
            var   useW   = ComboMenu.GetCheckBoxValue("wUse");
            var   useE   = ComboMenu.GetCheckBoxValue("eUse");
            var   useR   = ComboMenu.GetCheckBoxValue("rUse");
            var   cmbDmg = Program.ComboDamage(target);

            if (target == null || target.IsInvulnerable || target.MagicImmune)
            {
                return;
            }
            //////////////////////////////////////////////////////////////////////////////////////////

            if (ComboMenu.GetCheckBoxValue("itemss"))
            {
                Eclipse.Activator.Items.CastItems(target);
            }

            if (Program.ShacoClone && !Program.GhostDelay && ComboMenu["useClone"].Cast <CheckBox>().CurrentValue&& !MiscMenu["autoMoveClone"].Cast <CheckBox>().CurrentValue)
            {
                Program.moveClone();
            }

            if (Q.IsReady() && useQ && target.IsValidTarget(Q.Range))
            {
                Q.Cast(Prediction.Position.PredictUnitPosition(target, 500).To3D());
            }

            else
            {
                if (!Program.CheckWalls(target) || Utils.GetPath(player, target.Position) < dist)
                {
                    Q.Cast(player.Position.Extend(target.Position, Q.Range));
                }
            }

            if (W.IsReady() && useW)
            {
                if (target.IsValidTarget(W.Range + 250))
                {
                    Program.HandleW(target);
                }
            }

            if (useE && E.IsReady() && target.IsValidTarget(E.Range))
            {
                E.Cast(target);
            }

            if (useR && R.IsReady() && !Program.ShacoClone && target.HealthPercent < 60 &&
                cmbDmg < target.Health && target.HealthPercent > cmbDmg && target.HealthPercent > 25)
            {
                R2.Cast();
            }

            if (ComboMenu.GetCheckBoxValue("rLow") && R2.IsReady() && Player.Instance.HealthPercent <= ComboMenu.GetSliderValue("hpR"))
            {
                R2.Cast();
            }
        }
Example #16
0
    // Update is called once per frame
    void Update()
    {
        if (FindEnemyR)
        {
            Vector3 closeEnemyPos1;
            Vector3 closeEnemyPos2;
            Vector3 closeEnemyPos3;
            if (GameObject.FindGameObjectWithTag("EnemyR") != null)
            {
                CloseEn1       = FindClosestEnemyC1();
                CloseEn2       = FindClosestEnemyC2();
                CloseEn3       = FindClosestEnemyC3();
                closeEnemyPos1 = new Vector3(CloseEn1.transform.position.x, CloseEn1.transform.position.y, CloseEn1.transform.position.z);
                closeEnemyPos2 = new Vector3(CloseEn2.transform.position.x, CloseEn2.transform.position.y, CloseEn2.transform.position.z);
                closeEnemyPos3 = new Vector3(CloseEn3.transform.position.x, CloseEn3.transform.position.y, CloseEn3.transform.position.z);

                WhereToFireRC1 = closeEnemyPos1 - Fire_1.position;
                WhereToFireRC2 = closeEnemyPos2 - Fire_2.position;
                WhereToFireRC3 = closeEnemyPos3 - Fire_3.position;
            }
            else
            {
                time = 0;
            }
        }

        if (TimerOn)
        {
            time++;
            if (time == reload)
            {
                Vector3 FirePos_1 = Fire_1.position;
                //TempBulletRC1 = Instantiate (BulletRC1, FirePos_1, BulletRC1.transform.rotation) as GameObject;

                GameObject Bullet = ObjectPooling.pool.GetPoolObject_Bullet();
                if (Bullet == null)
                {
                    return;
                }

                Bullet.GetComponent <BulletCtrl> ().Enemy = CloseEn1;

                Bullet.transform.position = FirePos_1;


                Bullet.SetActive(true);
                R1.Play();
                Bullet.GetComponent <Rigidbody> ().velocity = WhereToFireRC1.normalized * bullectRSpeed;
                Bullet.GetComponent <TrailRenderer> ().Clear();
            }
            else if (time == reload * 2)
            {
                Vector3 FirePos_2 = Fire_2.position;

                //TempBulletRC2 = Instantiate (BulletRC2, FirePos_2, BulletRC2.transform.rotation);
                GameObject Bullet = ObjectPooling.pool.GetPoolObject_Bullet();
                if (Bullet == null)
                {
                    return;
                }

                Bullet.GetComponent <BulletCtrl> ().Enemy = CloseEn2;

                Bullet.transform.position = FirePos_2;


                Bullet.SetActive(true);
                R2.Play();
                Bullet.GetComponent <Rigidbody> ().velocity = WhereToFireRC2.normalized * bullectRSpeed;
                Bullet.GetComponent <TrailRenderer> ().Clear();
            }
            else if (time == reload * 3)
            {
                Vector3 FirePos_3 = Fire_3.position;
                //TempBulletRC3 = Instantiate (BulletRC3, FirePos_3, BulletRC3.transform.rotation);
                GameObject Bullet = ObjectPooling.pool.GetPoolObject_Bullet();
                if (Bullet == null)
                {
                    return;
                }

                Bullet.GetComponent <BulletCtrl> ().Enemy = CloseEn3;

                Bullet.transform.position = FirePos_3;

                Bullet.SetActive(true);
                R3.Play();
                Bullet.GetComponent <Rigidbody> ().velocity = WhereToFireRC3.normalized * bullectRSpeed;
                Bullet.GetComponent <TrailRenderer> ().Clear();

                time    = 0;
                TimerOn = false;
            }
        }
        else
        {
            FindEnemyR = false;
        }
    }
Example #17
0
    static void Main()
    {
        int    n = 5, m = 4;
        matrix A1  = new matrix(n, m);
        var    rnd = new Random(1);

        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < m; j++)
            {
                A1[i, j] = 2 * (rnd.NextDouble() - 0.5);
            }
        }
        WriteLine("____Assignment A1____");
        A1.print($"QR-decomposition:\nrandom {n}x{m} matrix A:");
        (matrix Q, matrix R1) = qrDecomp.qr_gs_decomp(A1);
        R1.print("matrix R:");
        matrix QTQ = Q.T * Q;
        matrix QR  = Q * R1;

        QTQ.print("Q^T*Q:");
        QR.print("Q*R:");
        if (A1.approx(QR))
        {
            WriteLine("Q*R=A, test passed");
        }
        else
        {
            WriteLine("Q*R!=A, test failed");
        }
        Write("\n\n");


        matrix A2 = new matrix(n, n);

        rnd = new Random(2);
        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < n; j++)
            {
                A2[i, j] = 2 * (rnd.NextDouble() - 0.5);
            }
        }
        vector b = new vector(n);

        rnd = new Random(3);
        for (int i = 0; i < n; i++)
        {
            b[i] = 2 * (rnd.NextDouble() - 0.5);
        }
        WriteLine("____Assignment A2____");
        A2.print($"Solving system of equations A*x=Q*R*x=b:\nrandom {n}x{n} matrix A:");
        (matrix Q2, matrix R2) = qrDecomp.qr_gs_decomp(A2);
        Q2.print("matrix Q:");
        R2.print("matrix R:");
        b.print("vector b:");
        vector x2  = qrDecomp.qr_gs_solve(Q2, R2, b);
        vector Ax2 = A2 * x2;

        x2.print("solution vector x:");
        Ax2.print("A*x:");
        if (b.approx(A2 * x2))
        {
            WriteLine("A*x=b, test passed");
        }
        else
        {
            WriteLine("A*x!=b, test failed");
        }
        Write("\n\n");


        matrix A3 = new matrix(n, n);

        rnd = new Random(4);
        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < n; j++)
            {
                A3[i, j] = 2 * (rnd.NextDouble() - 0.5);
            }
        }
        WriteLine("____Assignment B____");
        A3.print($"Decomposing A into Q*R:\nrandom {n}x{n} matrix A:");
        (matrix Q3, matrix R3) = qrDecomp.qr_gs_decomp(A3);
        Q3.print("matrix Q:");
        R3.print("matrix R:");
        matrix B = qrDecomp.qr_gs_inverse(Q3, R3);
        matrix I = new matrix(n, n);

        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < n; j++)
            {
                I[i, j] = 0;
                if (i == j)
                {
                    I[i, j] = 1;
                }
            }
        }
        I.print($"Idenity matrix I({n}):");
        B.print("Inverse matrix B:");
        matrix AB       = A3 * B;
        matrix AB_round = new matrix(n, n); // rounded matrix to 10th decimal to get a nicer output

        for (int i = 0; i <= n - 1; i++)
        {
            for (int j = 0; j <= n - 1; j++)
            {
                AB_round[i, j] = Math.Round((Double)AB[i, j], 10);
            }
        }
        AB_round.print("A*B:");
        if (AB.approx(I))
        {
            WriteLine("A*B=I, test passed");             // test is still with unrounded matrix
        }
        else
        {
            WriteLine("A*B!=I, test failed");
        }
        Write("\n\n");


        WriteLine("____Assignment C____");
        A2.print($"Givens rotation of the same coefficient matrix as in part A(2):\nrandom {n}x{m} matrix A:");
        matrix T = A2.copy();

        qrDecomp.qr_givens_decomp(T);
        T.print("Matrix with R in the upper trinagle and angles of the Givens rotation below, T:");
        b.print("Same vector b as in A(2):");
        vector Gb  = b.copy();
        vector x4  = qrDecomp.qr_givens_solve(T, Gb);
        vector Ax4 = A2 * x4;

        x4.print("solution vector x:");
        Ax4.print("A*x:");
        if (b.approx(A2 * x4))
        {
            WriteLine("A*x=b, test passed");
        }
        else
        {
            WriteLine("A*x!=b, test failed");
        }
        Write("\n\n");
    }
Example #18
0
        public void Inicio()
        {
            Point p = new Point();                      // Creamos un punto que nos ayudará a mover las reinas

            p.X         = 78;                           // Punto X inicial de la Reina 5
            p.Y         = 317;                          // Punto Y inicial de la Reina 5
            R5.Location = p;                            // Cambiamos la locación de la Reina 5

            p.X         = 78;                           // Punto X inicial de la Reina 4
            p.Y         = 258;                          // Punto Y inicial de la Reina 4
            R4.Location = p;                            // Cambiamos la locación de la Reina 4

            p.X         = 78;                           // Punto X inicial de la Reina 3
            p.Y         = 199;                          // Punto Y inicial de la Reina 3
            R3.Location = p;                            // Cambiamos la locación de la Reina 3

            p.X         = 78;                           // Punto X inicial de la Reina 2
            p.Y         = 140;                          // Punto Y inicial de la Reina 2
            R2.Location = p;                            // Cambiamos la locación de la Reina 2

            p.X         = 78;                           // Punto X inicial de la Reina 1
            p.Y         = 80;                           // Punto Y inicial de la Reina 1
            R1.Location = p;                            // Cambiamos la locación de la Reina 1
            R1.Refresh();                               // Refrescamos los pictureboxs para tener la imagen actual de como se verían

            for (int i = 0; i < 5; i++)                 // Ciclo que mueve la Reina 1
            {
                for (int j = 0; j < 5; j++)             // Ciclo que mueve la Reina 2
                {
                    for (int k = 0; k < 5; k++)         // Cliclo que mueve la Reina 3
                    {
                        for (int l = 0; l < 5; l++)     // Ciclo que mueve la Reina 2
                        {
                            for (int m = 0; m < 5; m++) // Ciclo que mueve la Reina 1
                            {
                                tablero[0] = i;         // Colocamos la Reina 1
                                tablero[1] = j;         // Colocamos la Reina 2
                                tablero[2] = k;         // Colocamos la Reina 3
                                tablero[3] = l;         // Colocamos la Reina 4
                                tablero[4] = m;         // Colocamos la Reina 5

                                Thread.Sleep(20);       // Asignamos la velocidad con la que se moverán las reinas

                                // Imprimir picturebox
                                if (Verificar())                                                                                                   // Sí la función devuelve verdadero
                                {
                                    if (MessageBox.Show("Encontró una solución", "!SOLUCION¡", MessageBoxButtons.OKCancel) == DialogResult.Cancel) // Mostramos un mensaje que dice sí queremos continuar o terminar el proceso
                                    {
                                        return;                                                                                                    // Sí damos click en "Cancelar" se tendrá que empezar de nuevo
                                    }
                                }

                                Tablero.Refresh();                    // Refrescamos a la imagen actual del Tablero

                                if (m + 1 != 5)                       // Si la Reina 5 está en la posición 5, no moveremos las reina
                                {
                                    p.X         = R5.Location.X + 59; // Cambiamos el punto X de la Reina 5
                                    p.Y         = R5.Location.Y;      // Cambiamos el punto Y de la Reina 5
                                    R5.Location = p;                  // Movemos la locación de la Reina 5
                                    R5.Refresh();                     // Refrescamos a la imagen actual de la Reina 5
                                }
                            } // Fin for de m

                            p.X         = 78;                     // Cambiamos el punto X al inicial de la Reina 5
                            p.Y         = 317;                    // Cambiamos el punto Y al inicial de la Reina 5
                            R5.Location = p;                      // Movemos la Reina 5 a su punto inicial

                            if (l + 1 != 5)                       // Si la Reina 4 está en la posición 5, no moveremos las reina
                            {
                                p.X         = R4.Location.X + 59; // Cambiamos el punto X de la Reina 4
                                p.Y         = R4.Location.Y;      // Cambiamos el punto Y de la Reina 4
                                R4.Location = p;                  // Movemos la locación de la Reina 4
                            }

                            R4.Refresh(); // Refrescamos a la imagen actual de la Reina 4
                        } // Fin for de l

                        p.X         = 78;                     // Cambiamos el punto X al inicial de la Reina 4
                        p.Y         = 258;                    // Cambiamos el punto Y al inicial de la Reina 4
                        R4.Location = p;                      // Movemos la Reina 4 a su punto inicial

                        if (k + 1 != 5)                       // Si la Reina 3 está en la posición 5, no moveremos las reina
                        {
                            p.X         = R3.Location.X + 59; // Cambiamos el punto X de la Reina 3
                            p.Y         = R3.Location.Y;      // Cambiamos el punto Y de la Reina 3
                            R3.Location = p;                  // Movemos la locación de la Reina 3
                        }

                        R3.Refresh(); // Refrescamos a la imagen actual de la Reina 3
                    } // Fin for de k

                    p.X         = 78;                     // Cambiamos el punto X al inicial de la Reina 3
                    p.Y         = 199;                    // Cambiamos el punto Y al inicial de la Reina 3
                    R3.Location = p;                      // Movemos la Reina 3 a su punto inicial

                    if (j + 1 != 5)                       // Si la Reina 2 está en la posición 5, no moveremos las reina
                    {
                        p.X         = R2.Location.X + 59; // Cambiamos el punto X de la Reina 2
                        p.Y         = R2.Location.Y;      // Cambiamos el punto Y de la Reina 2
                        R2.Location = p;                  // Movemos la locación de la Reina 2
                    }

                    R2.Refresh(); // Refrescamos a la imagen actual de la Reina 2
                } // Fin for de j

                p.X         = 78;                     // Cambiamos el punto X al inicial de la Reina 2
                p.Y         = 140;                    // Cambiamos el punto Y al inicial de la Reina 2
                R2.Location = p;                      // Movemos la Reina 2 a su punto inicial

                if (i + 1 != 5)                       // Si la Reina 1 está en la posición 5, no moveremos las reina
                {
                    p.X         = R1.Location.X + 59; // Cambiamos el punto X de la Reina 1
                    p.Y         = R1.Location.Y;      // Cambiamos el punto Y de la Reina 1
                    R1.Location = p;                  // Movemos la locación de la Reina 1
                }

                R1.Refresh(); // Refrescamos a la imagen actual de la Reina 1
            } // Fin for de i

            p.X         = 78; // Cambiamos el punto X al inicial de la Reina 1
            p.Y         = 80; // Cambiamos el punto Y al inicial de la Reina 1
            R1.Location = p;  // Movemos la Reina 1 a su punto inicial
            R1.Refresh();     // Refrescamos la imagen a la inicial
        }
Example #19
0
        /// <summary>
        /// Builds Rail Carrier Shipment.
        /// Original from https://ps.nafta.extra.fcagroup.com/sites/itb-ebus/shared%20Documents/404RailCarrierShipmentInformation.pdf
        /// </summary>
        static TS404 BuildRailCarrierShipment(string controlNumber)
        {
            var result = new TS404();

            //  Transaction Set Identifier Code
            //  = “404” (Rail Carrier Shipment Information)
            //  Transaction Set Control Number = 0001
            result.ST = new ST();
            result.ST.TransactionSetIdentifierCode_01 = "404";
            result.ST.TransactionSetControlNumber_02  = controlNumber.PadLeft(9, '0');

            //  Transaction Set Purpose Code = “00” (Original)
            //  Transportation Method/ Type Code = “R” (Rail)
            //  Shipment Method of Payment
            //  = “11” (Rule 11 Shipment)
            //  Standard Carrier Alpha Code = NS
            //  Weight Unit Code = ”L” (Pounds)
            //  Shipment Qualifier
            //  = “B” (Bill of Lading for Individual Shipment)
            //  Section Seven Code = “N” (Not in Effect)
            result.BX = new BX();
            result.BX.TransactionSetPurposeCode_01    = "00";
            result.BX.TransportationMethodTypeCode_02 = "R";
            result.BX.ShipmentMethodofPayment_03      = "11";
            result.BX.StandardCarrierAlphaCode_05     = "NS";
            result.BX.WeightUnitCode_06    = "L";
            result.BX.ShipmentQualifier_07 = "B";
            result.BX.SectionSevenCode_08  = "N";

            //  Shipment Weight Code
            //  = “A” (Shipper's Weight Agreement)
            //  Billing Code = “S” (Single Shipment Billing)
            result.BNX = new BNX();
            result.BNX.ShipmentWeightCode_01 = "A";
            result.BNX.BillingCode_03        = "S";

            //  Release Code = “R” (Released with Billing Data)
            //  Date = 03 / 01 / 2000
            //  Time = 11:16
            //  Time Code = “LT” (Local Time)
            result.M3 = new M3();
            result.M3.ReleaseCode_01 = "R";
            result.M3.Date_02        = "20000301";
            result.M3.Time_03        = "1116";
            result.M3.TimeCode_04    = "LT";

            //  Repeating N9
            result.N9 = new List <N9>();

            //  Reference Identification Qualifier
            //  = “BM” (Bill of Lading Number)
            //  Reference Identification = 2041247
            //  Date = 03 / 01 / 2000
            //  Time = 11:16
            //  Time Code = “LT” (Local Time)
            var n9 = new N9();

            n9.ReferenceIdentificationQualifier_01 = "BM";
            n9.ReferenceIdentification_02          = "2041247";
            n9.Date_04     = "20000301";
            n9.Time_05     = "1116";
            n9.TimeCode_06 = "LT";
            result.N9.Add(n9);

            //  Repeating N7 Loops
            result.N7Loop = new List <Loop_N7_404>();

            //  Begin N7 Loop
            var n7Loop1 = new Loop_N7_404();

            //  Equipment Initial = CR
            //  Equipment Number = 237522
            //  Weight = 80,503
            //  Weight Qualifier = “N” (Actual Net Weight)
            //  Equipment Description Code = “RR” (Rail Car)
            n7Loop1.N7 = new N7();
            n7Loop1.N7.EquipmentInitial_01         = "CR";
            n7Loop1.N7.EquipmentNumber_02          = "237522";
            n7Loop1.N7.Weight_03                   = "80503";
            n7Loop1.N7.WeightQualifier_04          = "N";
            n7Loop1.N7.EquipmentDescriptionCode_11 = "RR";

            //  Repeating M7
            n7Loop1.M7 = new List <M7>();

            //  Seal Number = 582127
            //  Seal Number = 582128
            var m7 = new M7();

            m7.SealNumber_01 = "582127";
            m7.SealNumber_02 = "582128";
            n7Loop1.M7.Add(m7);

            //  End N7 Loop
            result.N7Loop.Add(n7Loop1);

            //  City Name = WARREN
            //  State or Province Code = MI
            result.F9                        = new F9();
            result.F9.CityName_02            = "WARREN";
            result.F9.StateorProvinceCode_03 = "MI";

            //  City Name = VALLEY PARK
            //  State or Province Code = MO
            result.D9                        = new D9();
            result.D9.CityName_02            = "VALLEY PARK";
            result.D9.StateorProvinceCode_03 = "MO";

            //  Repeating N1 Loops
            result.N1Loop = new List <Loop_N1_404_3>();

            //  Begin N1 Loop 1
            var n1Loop1 = new Loop_N1_404_3();

            //  Entity Identifier Code = “11”
            //  (Party to be billed < AAR Accounting Rule 11 >)
            //  Name = CORPAY SOLUTIONS
            n1Loop1.N1 = new N1();
            n1Loop1.N1.EntityIdentifierCode_01 = "11";
            n1Loop1.N1.Name_02 = "CORPAY SOLUTIONS";

            //  Repeating N3
            n1Loop1.N3 = new List <N3>();

            //  Address Information
            //  = PO BOX 195199 / 2065 S CENTER RD
            var n31 = new N3();

            n31.AddressInformation_01 = "PO BOX 195199/2065 S CENTER RD";
            n1Loop1.N3.Add(n31);

            //  City Name = BURTON
            //  State or Province Code = MI
            //  Postal Code = 48519
            n1Loop1.N4                        = new N4();
            n1Loop1.N4.CityName_01            = "BURTON";
            n1Loop1.N4.StateorProvinceCode_02 = "MI";
            n1Loop1.N4.PostalCode_03          = "48519";

            //  End N1 Loop 1
            result.N1Loop.Add(n1Loop1);

            //  Begin N1 Loop 2
            var n1Loop2 = new Loop_N1_404_3();

            //  Entity Identifier Code = “CN” (Consignee)
            //  Name = ST LOUIS ASSEMBLY I
            //  Identification Code Qualifier
            //  = “93” (Code assigned by the organization
            //  originating the transaction set)
            //  Identification Code = 04087
            n1Loop2.N1 = new N1();
            n1Loop2.N1.EntityIdentifierCode_01 = "CN";
            n1Loop2.N1.Name_02 = "ST LOUIS ASSEMBLY I";
            n1Loop2.N1.IdentificationCodeQualifier_03 = "93";
            n1Loop2.N1.IdentificationCode_04          = "04087";

            //  Repeating N3
            n1Loop2.N3 = new List <N3>();

            //  Address Information
            //  = 1001 N HIGHWAY DRIVE
            var n32 = new N3();

            n32.AddressInformation_01 = "1001 N HIGHWAY DRIVE";
            n1Loop2.N3.Add(n32);

            //  City Name = FENTON
            //  State or Province Code = MO
            //  Postal Code = 63026
            n1Loop2.N4                        = new N4();
            n1Loop2.N4.CityName_01            = "FENTON";
            n1Loop2.N4.StateorProvinceCode_02 = "MO";
            n1Loop2.N4.PostalCode_03          = "63026";

            //  End N1 Loop 2
            result.N1Loop.Add(n1Loop2);

            //  Begin N1 Loop 3
            var n1Loop3 = new Loop_N1_404_3();

            //  Entity Identifier Code
            //  = “UC” (Ultimate Consignee)
            //  Name = ST LOUIS ASSEMBLY I
            //  Identification Code Qualifier
            //  = “93” (Code assigned by the organization
            //  originating the transaction set)
            //  Identification Code = 04087
            n1Loop3.N1 = new N1();
            n1Loop3.N1.EntityIdentifierCode_01 = "UC";
            n1Loop3.N1.Name_02 = "ST LOUIS ASSEMBLY I";
            n1Loop3.N1.IdentificationCodeQualifier_03 = "93";
            n1Loop3.N1.IdentificationCode_04          = "04087";

            //  Repeating N3
            n1Loop3.N3 = new List <N3>();

            //  Address Information
            //  = 1001 N HIGHWAY DRIVE
            var n33 = new N3();

            n33.AddressInformation_01 = "1001 N HIGHWAY DRIVE";
            n1Loop3.N3.Add(n33);

            //  City Name = FENTON
            //  State or Province Code = MO
            //  Postal Code = 63026
            n1Loop3.N4                        = new N4();
            n1Loop3.N4.CityName_01            = "FENTON";
            n1Loop3.N4.StateorProvinceCode_02 = "MO";
            n1Loop3.N4.PostalCode_03          = "63026";

            //  End N1 Loop 3
            result.N1Loop.Add(n1Loop3);

            //  Begin N1 Loop 4
            var n1Loop4 = new Loop_N1_404_3();

            //  Entity Identifier Code = “SH” (Shipper)
            //  Name = STERLING STAMPING
            //  Identification Code Qualifier
            //  = “93” (Code assigned by the organization
            //  originating the transaction set)
            //  Identification Code = 06215
            n1Loop4.N1 = new N1();
            n1Loop4.N1.EntityIdentifierCode_01 = "SH";
            n1Loop4.N1.Name_02 = "STERLING STAMPING";
            n1Loop4.N1.IdentificationCodeQualifier_03 = "93";
            n1Loop4.N1.IdentificationCode_04          = "06215";

            //  Repeating N3
            n1Loop4.N3 = new List <N3>();

            //  Address = 35777 VAN DYKE RD
            var n34 = new N3();

            n34.AddressInformation_01 = "35777 VAN DYKE RD";
            n1Loop4.N3.Add(n34);

            //  City Name = STERLING HEIGHTS
            //  State or Province Code = MI
            //  Postal Code = 48312
            n1Loop4.N4                        = new N4();
            n1Loop4.N4.CityName_01            = "STERLING HEIGHTS";
            n1Loop4.N4.StateorProvinceCode_02 = "MI";
            n1Loop4.N4.PostalCode_03          = "48312";

            //  End N1 Loop 4
            result.N1Loop.Add(n1Loop4);

            //  Repeating R2
            result.R2 = new List <R2>();

            //  Standard Carrier Alpha Code = NS
            //  Routing Sequence Code
            //  = “R” (Origin Carrier, Rule 11 Shipment)
            //  City Name = ESTL
            var r21 = new R2();

            r21.StandardCarrierAlphaCode_01 = "NS";
            r21.RoutingSequenceCode_02      = "R";
            r21.CityName_03 = "ESTL";
            result.R2.Add(r21);

            //  Standard Carrier Alpha Code = BNSF
            //  Routing Sequence Code
            //  = “1” (1st Carrier after Origin Carrier)
            var r22 = new R2();

            r22.StandardCarrierAlphaCode_01 = "BNSF";
            r22.RoutingSequenceCode_02      = "1";
            result.R2.Add(r22);

            //  Repeating LX Loops
            result.LXLoop = new List <Loop_LX_404>();

            //  Begin LX Loop
            var lxLoop1 = new Loop_LX_404();

            //  Assigned Number = 1
            lxLoop1.LX = new LX();
            lxLoop1.LX.AssignedNumber_01 = "1";

            //  Repeating L5
            lxLoop1.L5 = new List <L5>();

            //  Lading Line Item Number = 1
            //  Lading Description = AUTO PARTS
            //  Commodity Code = 3714993
            //  Commodity Code Qualifier
            //  = “T” (Standard Transportation Commodity
            //  Code<STCC>)
            var l5 = new L5();

            l5.LadingLineItemNumber_01   = "1";
            l5.LadingDescription_02      = "AUTO PARTS";
            l5.CommodityCode_03          = "3714993";
            l5.CommodityCodeQualifier_04 = "T";
            lxLoop1.L5.Add(l5);

            //  Repeating L0 Loops
            lxLoop1.L0Loop = new List <Loop_L0_404>();

            //  Begin L0 Loop
            var l0Loop1 = new Loop_L0_404();

            //  Lading Line Item Number = 1
            //  Weight = 80,503
            //  Weight Qualifier = “N” (Actual Net Weight)
            //  Lading Quantity = 42
            //  Packaging Form Code = “RCK” (Rack)
            l0Loop1.L0 = new L0();
            l0Loop1.L0.LadingLineItemNumber_01 = "1";
            l0Loop1.L0.Weight_04            = "80503";
            l0Loop1.L0.WeightQualifier_05   = "N";
            l0Loop1.L0.LadingQuantity_08    = "42";
            l0Loop1.L0.PackagingFormCode_09 = "RCK";

            //  End L0 Loop
            lxLoop1.L0Loop.Add(l0Loop1);

            //  End LX Loop
            result.LXLoop.Add(lxLoop1);

            return(result);
        }
Example #20
0
        public static void Load()
        {
            try
            {
                Principal = i.MainMenu.AddMenu("Championship Riven", "RivenAkr");
                Principal.Add("Skin", new CheckBox("Enable Skin Hack?", false));
                Principal.Add("SkinID", new Slider("Skin ID: {0}", 4, 0, 5));

                Q = Principal.AddSubMenu("Q Configs");
                Q.Add("Any", new CheckBox("Use on Laneclear/Jungleclear?"));
                Q.AddSeparator(2);
                Q.Add("Flee", new CheckBox("Use Q on Flee?"));

                W = Principal.AddSubMenu("W Configs");
                W.Add("Lane", new CheckBox("Use on Laneclear?"));
                W.Add("Jungle", new CheckBox("Use on Jungleclear?"));
                W.AddSeparator(2);
                W.Add("LaneMin", new Slider("Min {0} minions to use W on Laneclear", 3, 1, 6));

                E = Principal.AddSubMenu("E Configs");
                E.Add("Flee", new CheckBox("Use E on Flee?"));
                E.Add("Jungle", new CheckBox("Use on Jungleclear?"));
                E.Add("Shield", new CheckBox("Use on Spells?"));
                E.AddSeparator(2);
                foreach (var x in EntityManager.Heroes.Enemies)
                {
                    E.AddLabel(".: " + x.ChampionName + " :.");
                    foreach (var y in x.Spellbook.Spells)
                    {
                        if (y.SData.TargettingType == SpellDataTargetType.Unit && IsSpell(y.Slot))
                        {
                            E.Add(x.ChampionName + "/" + y.Slot, new CheckBox(x.ChampionName + " " + y.Slot.ToString()));
                        }
                    }
                    E.AddSeparator(2);
                }

                R = Principal.AddSubMenu("R1 Configs");
                R.Add("UseR1", new CheckBox("Use R1?"));
                R.Add("Force", new KeyBind("Force R1?", false, KeyBind.BindTypes.PressToggle, 'M'));

                R2 = Principal.AddSubMenu("R2 Configs");
                R2.Add("Mode", new ComboBox("R2 Mode:", 0, "Kill Only", "Max Damage"));
                R2.Add("Save", new CheckBox("Save R2 (When in AA Range)", true));

                Misc = Principal.AddSubMenu("Misc");
                Misc.Add("Burst", new KeyBind("Burst", false, KeyBind.BindTypes.HoldActive, 'T'));
                Misc.AddSeparator(2);
                Misc.Add("QGap", new CheckBox("Use 3Q on Gapcloser?"));
                Misc.Add("QInt", new CheckBox("Use 3Q to Interrupt?"));
                Misc.Add("WGap", new CheckBox("Use W on Gapcloser?"));
                Misc.Add("WInt", new CheckBox("Use W to Interrupt?"));

                Humanizer = Principal.AddSubMenu("Humanizer");
                Humanizer.Add("Emotes", new CheckBox("Use Emotes?"));
                Humanizer.Add("Q2", new Slider("Delay Q2: {0}", 0, 0, 40));
                Humanizer.Add("Q3", new Slider("Delay Q3: {0}", 0, 0, 50));

                Item = Principal.AddSubMenu("Items");
                Item.Add("Hydra", new CheckBox("Use Hydra?"));
                Item.Add("Tiamat", new CheckBox("Use Tiamat?"));
                Item.Add("Youmuu", new CheckBox("Use Youmuu?"));
                Item.AddSeparator(2);
                Item.Add("Ignite", new CheckBox("Auto use Ignite?"));

                Draw = Principal.AddSubMenu("Draws");
                Draw.Add("Burst", new CheckBox("Draw Burst Range?"));
                Draw.AddLabel(".: Spells :.");
                Draw.Add("Disable", new CheckBox("Disable All?", false));
                Draw.AddSeparator(1);
                Draw.Add("Q", new CheckBox("Draw Q?"));
                Draw.Add("W", new CheckBox("Draw W?"));
                Draw.Add("E", new CheckBox("Draw E?"));
                Draw.Add("R", new CheckBox("Draw R2?"));
                Draw.AddSeparator(2);
                Draw.Add("Status", new CheckBox("Draw Status About Settings?"));
            }
            catch (Exception e)
            {
                Extensions.Debug(e.Message);
            }
        }
Example #21
0
        public override void Game_OnGameUpdate(EventArgs args)
        {
            if (R1.IsReady() && Program.misc["UseRM"].Cast <CheckBox>().CurrentValue)
            {
                bool bigRocket = HasBigRocket();
                foreach (
                    AIHeroClient hero in
                    ObjectManager.Get <AIHeroClient>()
                    .Where(
                        hero =>
                        hero.LSIsValidTarget(bigRocket ? R2.Range : R1.Range) &&
                        R1.GetDamage(hero) * (bigRocket ? 1.5f : 1f) > hero.Health))
                {
                    if (bigRocket)
                    {
                        R2.Cast(hero, false, true);
                    }
                    else
                    {
                        R1.Cast(hero, false, true);
                    }
                }
            }

            if ((!ComboActive && !HarassActive) || !Orbwalker.CanMove)
            {
                return;
            }

            var useQ = ComboActive ? Program.combo["UseQC"].Cast <CheckBox>().CurrentValue : Program.harass["UseQH"].Cast <CheckBox>().CurrentValue;
            var useE = ComboActive ? Program.combo["UseEC"].Cast <CheckBox>().CurrentValue : Program.harass["UseEH"].Cast <CheckBox>().CurrentValue;
            var useR = ComboActive ? Program.combo["UseRC"].Cast <CheckBox>().CurrentValue : Program.harass["UseRH"].Cast <CheckBox>().CurrentValue;
            var rLim = ComboActive ? Program.combo["RlimC"].Cast <Slider>().CurrentValue : Program.harass["RlimH"].Cast <Slider>().CurrentValue;

            if (useQ && Q.IsReady())
            {
                var t = TargetSelector.GetTarget(Q.Range, DamageType.Magical);
                if (t != null)
                {
                    if (Q.Cast(t, false, true))
                    {
                        return;
                    }
                }
            }

            if (useE && E.IsReady())
            {
                var t = TargetSelector.GetTarget(E.Range, DamageType.Physical);
                if (t.LSIsValidTarget())
                {
                    if (E.Cast(t, false, true))
                    {
                        return;
                    }
                }
            }

            if (useR && R1.IsReady() && ObjectManager.Player.Spellbook.GetSpell(SpellSlot.R).Ammo > rLim)
            {
                bool         bigRocket = HasBigRocket();
                AIHeroClient t         = TargetSelector.GetTarget(bigRocket ? R2.Range : R1.Range, DamageType.Magical);

                if (t.LSIsValidTarget())
                {
                    if (bigRocket)
                    {
                        R2.Cast(t, false, true);
                    }
                    else
                    {
                        R1.Cast(t, false, true);
                    }
                }
            }
        }
Example #22
0
        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
            if (Bars == null)
            {
                return;
            }
            if (!Bars.BarsType.IsIntraday && Bars.Period.Id != PeriodType.Day)
            {
                return;
            }
            if (Bars.Period.Id == PeriodType.Day && pivotRangeType == PivotRange.Daily)
            {
                return;
            }
            if (Bars.Period.Id == PeriodType.Day && Bars.Period.Value > 1)
            {
                return;
            }

            // pivots only work for
            // - intraday
            // - 1 day chart with PivotRange Weekly or Monthly

            if (!isDailyDataLoaded)
            {
                if (priorDayHLC == HLCCalculationMode.DailyBars && Bars.BarsType.IsIntraday)
                {
                    Enabled = false;
                    System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(GetBarsNow));
                    return;
                }

                existsHistDailyData = false;
                isDailyDataLoaded   = true;
            }

            IBar dailyBar;

            if (existsHistDailyData)
            {
                sessionDateDaily = GetLastBarSessionDate(Time[0], Bars, PivotRange.Daily);
                dailyBar         = dailyBars.Get(dailyBars.GetBar(sessionDateDaily));

                if (dailyBar.Time.Date > sessionDateDaily.Date)
                {
                    for (DateTime i = sessionDateDaily; i >= dailyBars.GetTime(0); i = i.AddDays(-1))
                    {
                        dailyBar = dailyBars.Get(dailyBars.GetBar(i));
                        if (dailyBar.Time.Date == i.Date)
                        {
                            break;
                        }
                    }
                }
            }
            else
            {
                dailyBar = null;
            }

            double high  = existsHistDailyData ? dailyBar.High : High[0];
            double low   = existsHistDailyData ? dailyBar.Low : Low[0];
            double close = existsHistDailyData ? dailyBar.Close : Close[0];

            DateTime lastBarTimeStamp = GetLastBarSessionDate(Time[0], Bars, pivotRangeType);

            if ((currentDate != Cbi.Globals.MinDate && pivotRangeType == PivotRange.Daily && lastBarTimeStamp != currentDate) ||
                (currentWeek != Cbi.Globals.MinDate && pivotRangeType == PivotRange.Weekly && lastBarTimeStamp != currentWeek) ||
                (currentMonth != Cbi.Globals.MinDate && pivotRangeType == PivotRange.Monthly && lastBarTimeStamp != currentMonth))
            {
                pp           = (currentHigh + currentLow + currentClose) / 3;
                s1           = 2 * pp - currentHigh;
                r1           = 2 * pp - currentLow;
                s2           = pp - (currentHigh - currentLow);
                r2           = pp + (currentHigh - currentLow);
                s3           = pp - 2 * (currentHigh - currentLow);
                r3           = pp + 2 * (currentHigh - currentLow);
                currentClose = (priorDayHLC == HLCCalculationMode.UserDefinedValues) ? userDefinedClose : close;
                currentHigh  = (priorDayHLC == HLCCalculationMode.UserDefinedValues) ? userDefinedHigh : high;
                currentLow   = (priorDayHLC == HLCCalculationMode.UserDefinedValues) ? userDefinedLow : low;
            }
            else
            {
                currentClose = (priorDayHLC == HLCCalculationMode.UserDefinedValues) ? userDefinedClose : close;
                currentHigh  = (priorDayHLC == HLCCalculationMode.UserDefinedValues) ? userDefinedHigh : Math.Max(currentHigh, high);
                currentLow   = (priorDayHLC == HLCCalculationMode.UserDefinedValues) ? userDefinedLow : Math.Min(currentLow, low);
            }

            if (pivotRangeType == PivotRange.Daily)
            {
                currentDate = lastBarTimeStamp;
            }
            if (pivotRangeType == PivotRange.Weekly)
            {
                currentWeek = lastBarTimeStamp;
            }
            if (pivotRangeType == PivotRange.Monthly)
            {
                currentMonth = lastBarTimeStamp;
            }

            if ((pivotRangeType == PivotRange.Daily && currentDate != Cbi.Globals.MinDate) ||
                (pivotRangeType == PivotRange.Weekly && currentWeek != Cbi.Globals.MinDate) ||
                (pivotRangeType == PivotRange.Monthly && currentMonth != Cbi.Globals.MinDate))
            {
                PP.Set(pp);
                R1.Set(r1);
                S1.Set(s1);
                R2.Set(r2);
                S2.Set(s2);
                R3.Set(r3);
                S3.Set(s3);
            }
        }
Example #23
0
        public static void Execute()
        {
            //////////////////////////////////////////////////////////////////////////////////////////
            var   target  = TargetSelector.GetTarget(E.Range, DamageType.Physical);
            float dist    = (float)(Q.Range + player.MoveSpeed * 2.5);
            var   useQ    = ComboMenu.GetCheckBoxValue("qUse");
            var   useW    = ComboMenu.GetCheckBoxValue("wUse");
            var   useE    = ComboMenu.GetCheckBoxValue("eUse");
            var   useR    = ComboMenu.GetCheckBoxValue("rUse");
            var   packets = ComboMenu.GetCheckBoxValue("packets");
            var   cmbDmg  = Program.ComboDamage(target);

            //////////////////////////////////////////////////////////////////////////////////////////

            if (Program.ShacoClone && !Program.GhostDelay && ComboMenu["useClone"].Cast <CheckBox>().CurrentValue&& !MiscMenu["autoMoveClone"].Cast <CheckBox>().CurrentValue)
            {
                Program.moveClone();
            }

            if (Q.IsReady() && useQ && target.IsValidTarget(Q.Range))
            {
                Q.Cast(Prediction.Position.PredictUnitPosition(target, 500).To3D());
            }

            else
            {
                if (!Program.CheckWalls(target) || Utils.GetPath(player, target.Position) < dist)
                {
                    Q.Cast(player.Position.Extend(target.Position, Q.Range));
                }
            }

            if (target != null)
            {
                if (R.IsReady() && target.IsValidTarget() && player.Distance(target) < 400 && player.HasBuff("Deceive") && useR)
                {
                    R.Cast();
                }
            }

            if (W.IsReady() && useW)
            {
                if (!target.IsValidTarget(W.Range))
                {
                    Program.HandleW(target);
                }
            }

            if (useE && E.IsReady() && target.IsValidTarget(E.Range))
            {
                E.Cast(target);
            }

            if (ComboMenu["user"].Cast <CheckBox>().CurrentValue&& R.IsReady() && !Program.ShacoClone && target.HealthPercent < 75 &&
                cmbDmg <target.Health && target.HealthPercent> cmbDmg && target.HealthPercent > 25)
            {
                R2.Cast();
            }

            if (Player.Instance.HealthPercent <= ComboMenu.GetSliderValue("hpR") && R.IsReady() && ComboMenu.GetCheckBoxValue("rLow"))
            {
                R.Cast();
            }
        }
Example #24
0
        protected override void Game_OnGameUpdate(EventArgs args)
        {
            //check if player is dead
            if (Player.IsDead)
            {
                return;
            }

            SmartKs();

            if (menu.Item("escape", true).GetValue <KeyBind>().Active)
            {
                OrbwalkManager.Orbwalk(null, Game.CursorPos);
                Escape();
            }
            else if (menu.Item("ComboActive", true).GetValue <KeyBind>().Active)
            {
                Combo();
            }
            else if (menu.Item("insec", true).GetValue <KeyBind>().Active)
            {
                OrbwalkManager.Orbwalk(null, Game.CursorPos);

                _insecTarget = TargetSelector.GetSelectedTarget();

                if (_insecTarget != null)
                {
                    if (_insecTarget.HasBuffOfType(BuffType.Knockup) || _insecTarget.HasBuffOfType(BuffType.Knockback))
                    {
                        R2.Cast(_rVec);
                    }

                    Insec();
                }
            }
            else if (menu.Item("qeCombo", true).GetValue <KeyBind>().Active)
            {
                var soilderTarget = TargetSelector.GetTarget(900, TargetSelector.DamageType.Magical);

                OrbwalkManager.Orbwalk(null, Game.CursorPos);
                CastQe(soilderTarget, "Combo");
            }
            else
            {
                if (menu.Item("LaneClearActive", true).GetValue <KeyBind>().Active)
                {
                    Farm();
                }

                if (menu.Item("HarassActive", true).GetValue <KeyBind>().Active)
                {
                    Harass();
                }

                if (menu.Item("HarassActiveT", true).GetValue <KeyBind>().Active)
                {
                    Harass();
                }

                if (menu.Item("wAtk", true).GetValue <bool>())
                {
                    AutoAtk();
                }
            }
        }
Example #25
0
        private static void PermaActive(EventArgs args)
        {
            if (Menu.Config.Item("ks.q").IsActive())
            {
                foreach (var enemy in HeroManager.Enemies.Where(e => Q.CanCast(e) && Q.IsKillable(e)))
                {
                    Q.Cast(enemy);
                    return;
                }
            }

            if (Menu.Config.Item("ks.r").IsActive())
            {
                var r2 = Player.HasBuff("corkimissilebarragecounterbig");

                if (r2)
                {
                    foreach (var enemy in HeroManager.Enemies.Where(e => R.CanCast(e) && R.IsKillable(e)))
                    {
                        R.Cast(enemy);
                        return;
                    }
                }
                else
                {
                    foreach (var enemy in HeroManager.Enemies.Where(e => R2.CanCast(e) && R2.IsKillable(e)))
                    {
                        R2.Cast(enemy);
                        return;
                    }
                }
            }
        }
Example #26
0
        private static void Combo()
        {
            var target = TargetSelector.SelectedTarget;

            if (target == null || !target.IsValidTarget(750))
            {
                target = TargetSelector.GetTarget(R.IsReady() ? 750 : 600, DamageType.Magical);
            }

            if (target == null || target.InAutoAttackRange())
            {
                target = Orbwalker.GetTarget() as AIHeroClient;
            }

            if (target != null && target is AIHeroClient)
            {
                if (Variables.TickCount - TimeCast <= AkaliMenu.QSettings.MoveQ.Value && target.IsValidTarget(570) && !Player.HavePassive() && AkaliMenu.QSettings.MoveQ.Enabled &&

                    !ObjectManager.Get <AITurretClient>()
                    .Any(i => i.IsEnemy && !i.IsDead && (i.Distance(target.Position.Extend(Player.Position, +570)) < 850 + ObjectManager.Player.BoundingRadius))

                    && !target.Position.Extend(Player.Position, +570).IsWall() &&
                    !target.Position.Extend(Player.Position, +570).IsBuilding() &&
                    target.Position.Extend(Player.Position, +570).IsValid()
                    )
                {
                    Orbwalker.AttackEnabled = false;
                    Orbwalker.SetOrbwalkerPosition(target.Position.Extend(Player.Position, +600));
                    //Player.IssueOrder(GameObjectOrder.MoveTo, target.Position.Extend(Player.Position, +600));
                }
                else
                {
                    Orbwalker.SetOrbwalkerPosition(Vector3.Zero);
                    Orbwalker.AttackEnabled = true;
                }

                if (Q.IsReady() && CanUseQNow == true && Q.GetPrediction(target).CastPosition.DistanceToPlayer() <= Q.Range)
                {
                    if (!W.IsReady())
                    {
                        if (!Player.IsDashing() && Variables.TickCount - Last_E > 700 && Variables.TickCount - Last_R > 700)
                        {
                            Q.Cast(Q.GetPrediction(target).CastPosition);
                        }
                    }
                    else
                    {
                        if (Player.Mana - Q.Mana <= Q.Mana - 1.5f * 5)
                        {
                            if (target.IsValidTarget(Q.Range) && !Player.IsDashing() && Variables.TickCount - Last_E > 700 && Variables.TickCount - Last_R > 700)
                            {
                                Q.Cast(Q.GetPrediction(target).CastPosition);
                                if (!Player.IsDashing())
                                {
                                    W.Cast(target.Position);
                                }
                            }
                        }
                    }
                }

                if (W.IsReady() && AkaliMenu.WSettings.TargetCount.Enabled && Player.CountEnemyHeroesInRange(AkaliMenu.WSettings.TargetCount.Value) > 1)
                {
                    if (!Player.IsDashing())
                    {
                        W.Cast(Player.Position);
                    }
                }

                if (Q.IsReady() && Player.Mana > 150 && Player.HealthPercent > 80)
                {
                }
                else
                {
                    var Epred = E.GetPrediction(target, false, -1, new CollisionObjects[] { CollisionObjects.Minions, CollisionObjects.YasuoWall });
                    if (W.IsReady() && E.IsReady() && Player.Mana - E.Mana <= Q.Mana)
                    {
                        if (E.Name == "AkaliE")
                        {
                            if (Player.HavePassive())
                            {
                                return;
                            }

                            if (CanUseQNow == true)
                            {
                                E.Cast(Epred.CastPosition);
                                DelayAction.Add(1, () => { W.Cast(Epred.CastPosition); });
                            }
                        }

                        if (E.Name == "AkaliEb" && GameObjects.EnemyHeroes.Any(i => i.HasBuff("AkaliEMis")))
                        {
                            E.Cast(Epred.CastPosition);

                            if (target.IsValidTarget(300))
                            {
                                W.Cast(target.Position);
                            }
                        }
                    }
                    else
                    {
                        if (W.IsReady())
                        {
                            if (Player.Mana <= AkaliMenu.WSettings.Wmana.Value && target.Position.DistanceToPlayer() < 500)
                            {
                                W.Cast(Player.Position);
                            }
                        }
                        if (E.Name == "AkaliE")
                        {
                            if (E.IsReady())
                            {
                                if (Player.HavePassive() && target.IsValidTarget(650))
                                {
                                    return;
                                }

                                if (CanUseQNow == true)
                                {
                                    if (Variables.TickCount - Last_Q > 700)
                                    {
                                        E.Cast(Epred.CastPosition);
                                    }
                                }
                            }
                        }
                        if (E.Name == "AkaliEb")
                        {
                            if (E.IsReady())
                            {
                                if (Variables.TickCount - Last_Q > 700)
                                {
                                    E.Cast(Epred.CastPosition);
                                }
                            }
                        }
                    }
                }

                if (!Player.HavePassive() && target.IsValidTarget(R.Name == "AkaliRb" ? R2.Range : R.Range) && AkaliMenu.RSettings.Rcombo.Active)
                {
                    if (target.Health <= R.GetDamage(target) + Player.GetAutoAttackDamage(target))
                    {
                        if (R.Name == "AkaliRb")
                        {
                            R2.Cast(target);
                        }
                        else
                        {
                            R.Cast(target);
                        }
                    }

                    if (R.Name == "AkaliR" && Variables.TickCount - Last_Q > 700)
                    {
                        R.Cast(target);
                    }
                }

                if (R.IsReady())
                {
                    if (target.Health <= R.GetDamage(target) + (39 + 15 * Player.Level) + (Q.IsReady() ? Q.GetDamage(target) : 0))
                    {
                        if (R.Name == "AkaliRb")
                        {
                            R2.Cast(target);
                        }
                        else
                        {
                            R.Cast(target);
                        }
                    }
                }
                if (Q.IsReady() && Player.IsDashing() && Q.GetPrediction(target).CastPosition.DistanceToPlayer() <= Q.Range)
                {
                    if (target.Health <= Q.GetDamage(target) + (39 + 15 * Player.Level))
                    {
                        Q.Cast(Q.GetPrediction(target).CastPosition);
                    }
                }
            }
        }
Example #27
0
        private void LogicR(Obj_AI_Base target, bool extendedR = false, bool useE = false,
                            Orbwalker.ActiveModes activeMode   = Orbwalker.ActiveModes.None)
        {
            var t = target as AIHeroClient;

            if (t == null)
            {
                return;
            }

            if (extendedR)
            {
                if (!R2.IsInRange(t) && useE)
                {
                    var dist = Player.Instance.Distance(target) - R2.Range;

                    if (dist > E.Range)
                    {
                        return;
                    }

                    var ePrediction = E.GetPrediction(target);

                    if (ePrediction.CastPosition.IsInRange(target, R2.Range))
                    {
                        E.Cast(ePrediction.CastPosition);
                    }

                    var rPrediction = R2.GetPrediction(t);

                    if (rPrediction != null && rPrediction.HitChancePercent >= 75)
                    {
                        R2.Cast(rPrediction.CastPosition);
                    }
                }
                else if (R2.IsInRange(t))
                {
                    var rPrediction = R2.GetPrediction(t);

                    if (rPrediction != null && rPrediction.HitChancePercent >= 75)
                    {
                        R2.Cast(rPrediction.CastPosition);
                    }
                }
            }
            else
            {
                if (!R.IsInRange(t) && useE)
                {
                    var dist = Player.Instance.Distance(target) - R.Range;

                    if (dist > E.Range)
                    {
                        return;
                    }

                    var ePrediction = E.GetPrediction(target);

                    if (ePrediction.CastPosition.IsInRange(target, R.Range))
                    {
                        E.Cast(ePrediction.CastPosition);
                    }

                    var rPrediction = R.GetPrediction(t);

                    if (rPrediction != null && rPrediction.HitChancePercent >= 75)
                    {
                        R.Cast(rPrediction.CastPosition);
                    }
                }
                else if (activeMode == Orbwalker.ActiveModes.Combo)
                {
                    var enemiesAroundTarget = t.CountEnemiesInRange(R.Width);

                    if (enemiesAroundTarget < ComboMenu.GetSliderValue("combo.r.aoe"))
                    {
                        return;
                    }

                    var rPrediction = R.GetPrediction(t);

                    if (rPrediction != null && rPrediction.HitChancePercent >= 75)
                    {
                        R.Cast(rPrediction.CastPosition);
                    }
                }
                else if (R.IsInRange(t))
                {
                    var rPrediction = R.GetPrediction(t);

                    if (rPrediction != null && rPrediction.HitChancePercent >= 75)
                    {
                        R.Cast(rPrediction.CastPosition);
                    }
                }
            }
        }
Example #28
0
        // Example:
        //
        //    0:009> r
        //     r0=00000000  r1=00000000  r2=00000000  r3=76fdcf09  r4=00000000  r5=028df6e0
        //     r6=028df730  r7=00000000  r8=00000001  r9=01507858 r10=015156a8 r11=028df8e8
        //    r12=00000000  sp=028df6c8  lr=00000000  pc=76ccce24 psr=600f0030 -ZC-- Thumb
        //    KERNELBASE!RaiseFailFastException+0x60:
        //    76ccce24 f000f846 bl          KERNELBASE!SignalStartWerSvc (76ccceb4)
        //
        public override ColorString ToColorString()
        {
            if (null == m_colorString)
            {
                ConsoleColor color;
                ColorString  cs = new ColorString(" r0=");
                color = GetColorForDiffAgainstBaseline("r0");
                cs.Append(R0.GetColorizedValueString(color));
                cs.Append("  r1=");
                color = GetColorForDiffAgainstBaseline("r1");
                cs.Append(R1.GetColorizedValueString(color));
                cs.Append("  r2=");
                color = GetColorForDiffAgainstBaseline("r2");
                cs.Append(R2.GetColorizedValueString(color));
                cs.Append("  r3=");
                color = GetColorForDiffAgainstBaseline("r3");
                cs.Append(R3.GetColorizedValueString(color));
                cs.Append("  r4=");
                color = GetColorForDiffAgainstBaseline("r4");
                cs.Append(R4.GetColorizedValueString(color));
                cs.Append("  r5=");
                color = GetColorForDiffAgainstBaseline("r5");
                cs.Append(R5.GetColorizedValueString(color));
                cs.AppendLine();

                cs.Append(" r6=");
                color = GetColorForDiffAgainstBaseline("r6");
                cs.Append(R6.GetColorizedValueString(color));
                cs.Append("  r7=");
                color = GetColorForDiffAgainstBaseline("r7");
                cs.Append(R7.GetColorizedValueString(color));
                cs.Append("  r8=");
                color = GetColorForDiffAgainstBaseline("r8");
                cs.Append(R8.GetColorizedValueString(color));
                cs.Append("  r9=");
                color = GetColorForDiffAgainstBaseline("r9");
                cs.Append(R9.GetColorizedValueString(color));
                cs.Append(" r10=");
                color = GetColorForDiffAgainstBaseline("r10");
                cs.Append(R10.GetColorizedValueString(color));
                cs.Append(" r11=");
                color = GetColorForDiffAgainstBaseline("r11");
                cs.Append(R11.GetColorizedValueString(color));
                cs.AppendLine();

                cs.Append("r12=");
                color = GetColorForDiffAgainstBaseline("r12");
                cs.Append(R12.GetColorizedValueString(color));
                cs.Append("  sp=");
                color = GetColorForDiffAgainstBaseline("sp");
                cs.Append(Sp.GetColorizedValueString(color));
                cs.Append("  lr=");
                color = GetColorForDiffAgainstBaseline("lr");
                cs.Append(Lr.GetColorizedValueString(color));
                cs.Append("  pc=");
                color = GetColorForDiffAgainstBaseline("pc");
                cs.Append(Pc.GetColorizedValueString(color));
                cs.Append(" psr=");
                color = GetColorForDiffAgainstBaseline("psr");
                cs.Append(Psr.GetColorizedValueString(color));

                // TODO:
                cs.AppendLine(" TBD: flags and mode");

                cs.Append(DbgProvider.ColorizeSymbol(StackFrame.SymbolName));
                if (0 != StackFrame.Displacement)
                {
                    cs.Append("+0x");
                    cs.Append(StackFrame.Displacement.ToString("x"));
                }
                cs.AppendLine(":");
                cs.Append(Disasm(Pc.ValueAsPointer));

                m_colorString = cs;
            }
            return(m_colorString);
        } // end ToString()