Example #1
0
        public override void OnPaint(IScriptEngine se, GraphicContext g)
        {
            g.SetColor(new Color(0.3f, 0.3f, 0.3f, 1.0f));
            g.FillRect(15, 100, 265, 210);
            g.SetColor(new Color(1.0f, 1.0f, 1.0f, 1.0f));
            g.DrawString("http://ennui.ninja - Simple AIO Gatherer", 20, 100);
            g.DrawString(string.Format("Runtime: {0}", Time.FormatElapsed(timer.ElapsedMs)), 20, 115);
            g.DrawString(string.Format("State: {0}", context.State), 20, 130);
            g.DrawString(string.Format("Max hold weight: {0}", config.MaxHoldWeight), 20, 145);
            g.DrawString(string.Format("Bank cluster: {0}", config.VaultClusterName), 20, 160);
            g.DrawString(string.Format("Repair cluster: {0}", config.RepairClusterName), 20, 175);
            g.DrawString(string.Format("Resource cluster: {0}", config.ResourceClusterName), 20, 190);

            if (config.ResourceClusterName == Game.ClusterName)
            {
                foreach (var p in config.RoamPoints)
                {
                    p.RealVector3().Expand(3, 3, 3).Render(Api, Color.Red, Color.Red.MoreTransparent());
                }
            }

            if (config.VaultArea != null && config.VaultClusterName == Game.ClusterName)
            {
                config.VaultArea.RealArea(Api).Render(Api, Color.Cyan, Color.Cyan.MoreTransparent());
            }

            if (config.RepairArea != null && config.RepairClusterName == Game.ClusterName)
            {
                config.RepairArea.RealArea(Api).Render(Api, Color.Purple, Color.Purple.MoreTransparent());
            }
        }
Example #2
0
        private void DrawDistance(Vector2 <float> localPlayerPos, Vector2 <float> targetPos, GraphicContext g)
        {
            g.DrawLine(Convert.ToInt32(localPlayerPos.X),
                       Convert.ToInt32(localPlayerPos.Y),
                       Convert.ToInt32(targetPos.X),
                       Convert.ToInt32(targetPos.Y));

            // Calculate distance
            var distance = localPlayerPos.SimpleDistance(localPlayerPos);

            if (Math.Abs(targetPos.X) >= Math.Abs(targetPos.Y))
            {
                if (localPlayerPos.X < targetPos.X)
                {
                    var y = ((targetPos.Y - localPlayerPos.Y) / (targetPos.X - localPlayerPos.X)) * 100;
                    g.DrawString(distance.ToString(), Convert.ToInt32(localPlayerPos.X + 100), Convert.ToInt32(localPlayerPos.Y + y));
                }
                else if (localPlayerPos.X > targetPos.X)
                {
                    var y = ((targetPos.Y - localPlayerPos.Y) / (targetPos.X - localPlayerPos.X)) * -100;
                    g.DrawString(distance.ToString(), Convert.ToInt32(localPlayerPos.X - 100), Convert.ToInt32(localPlayerPos.Y + y));
                }
            }
            else
            {
                if (localPlayerPos.Y < targetPos.Y)
                {
                    var x = (targetPos.X - localPlayerPos.X) * 100 / (targetPos.Y - localPlayerPos.Y);
                    g.DrawString(distance.ToString(), Convert.ToInt32(localPlayerPos.X + x), Convert.ToInt32(localPlayerPos.Y + 100));
                }
                else if (localPlayerPos.Y > targetPos.Y)
                {
                    var x = (targetPos.X - localPlayerPos.X) * -100 / (targetPos.Y - localPlayerPos.Y);
                    g.DrawString(distance.ToString(), Convert.ToInt32(localPlayerPos.X + x), Convert.ToInt32(localPlayerPos.Y - 100));
                }
            }
        }
Example #3
0
        public override void OnPaint(IScriptEngine se, GraphicContext g)
        {
            if (Players.LocalPlayer == null)
            {
                return;
            }


            if (_configuration.ESPActivatedPlayers)
            {
                var otherPlayers = Players.RemotePlayers;
                foreach (var otherPlayer in otherPlayers)
                {
                    if (otherPlayer?.ScreenLocation != null)
                    {
                        if (otherPlayer.IsPvpEnabled)
                        {
                            g.SetColor(Color.Orange);
                        }
                        else
                        {
                            g.SetColor(Color.Green);
                        }


                        g.DrawLine(Convert.ToInt32(Players.LocalPlayer.ScreenLocation.X),
                                   Convert.ToInt32(Players.LocalPlayer.ScreenLocation.Y),
                                   Convert.ToInt32(otherPlayer.ScreenLocation.X),
                                   Convert.ToInt32(otherPlayer.ScreenLocation.Y));
                    }
                }
            }

            if (_configuration.ESPActivatedResources)
            {
                var harvestables      = Objects.AllHarvestables.FindAll(x => !x.Depleted && x.ScreenLocation != null);
                var harvestablesValid = new List <ObjectHarvestable>();
                foreach (var harvestable in harvestables)
                {
                    if (harvestable != null)
                    {
                        if ((_configuration.ResFiber && harvestable.Type == Ennui.Api.Meta.ResourceType.Fiber) ||
                            (_configuration.ResOre && harvestable.Type == Ennui.Api.Meta.ResourceType.Ore) ||
                            (_configuration.ResStone && harvestable.Type == Ennui.Api.Meta.ResourceType.Rock) ||
                            (_configuration.ResTree && harvestable.Type == Ennui.Api.Meta.ResourceType.Wood) ||
                            (_configuration.ResLeather && harvestable.Type == Ennui.Api.Meta.ResourceType.Hide))
                        {
                            if ((harvestable.Tier == 2 && _configuration.ResT2) ||
                                (harvestable.Tier == 3 && _configuration.ResT3) ||
                                (harvestable.Tier == 4 && harvestable.RareState == 0 && _configuration.ResT4) ||
                                (harvestable.Tier == 4 && harvestable.RareState == 1 && _configuration.ResT4_1) ||
                                (harvestable.Tier == 4 && harvestable.RareState == 2 && _configuration.ResT4_2) ||
                                (harvestable.Tier == 4 && harvestable.RareState == 3 && _configuration.ResT4_3) ||
                                (harvestable.Tier == 5 && harvestable.RareState == 0 && _configuration.ResT5) ||
                                (harvestable.Tier == 5 && harvestable.RareState == 1 && _configuration.ResT5_1) ||
                                (harvestable.Tier == 5 && harvestable.RareState == 2 && _configuration.ResT5_2) ||
                                (harvestable.Tier == 5 && harvestable.RareState == 3 && _configuration.ResT5_3) ||
                                (harvestable.Tier == 6 && harvestable.RareState == 0 && _configuration.ResT6) ||
                                (harvestable.Tier == 6 && harvestable.RareState == 1 && _configuration.ResT6_1) ||
                                (harvestable.Tier == 6 && harvestable.RareState == 2 && _configuration.ResT6_2) ||
                                (harvestable.Tier == 6 && harvestable.RareState == 3 && _configuration.ResT6_3) ||
                                (harvestable.Tier == 7 && harvestable.RareState == 0 && _configuration.ResT7) ||
                                (harvestable.Tier == 7 && harvestable.RareState == 1 && _configuration.ResT7_1) ||
                                (harvestable.Tier == 7 && harvestable.RareState == 2 && _configuration.ResT7_2) ||
                                (harvestable.Tier == 7 && harvestable.RareState == 3 && _configuration.ResT7_3) ||
                                (harvestable.Tier == 8 && harvestable.RareState == 0 && _configuration.ResT8) ||
                                (harvestable.Tier == 8 && harvestable.RareState == 1 && _configuration.ResT8_1) ||
                                (harvestable.Tier == 8 && harvestable.RareState == 2 && _configuration.ResT8_2) ||
                                (harvestable.Tier == 8 && harvestable.RareState == 3 && _configuration.ResT8_3))
                            {
                                harvestablesValid.Add(new ObjectHarvestable(harvestable));
                            }
                        }
                    }
                }

                if (_configuration.ResLeather)
                {
                    var mobsWithDrops = Entities.Mobs.FindAll(x => x.HarvestableDrops.Count > 0 && x.ScreenLocation != null);
                    foreach (var mob in mobsWithDrops)
                    {
                        if ((_configuration.ResT2 && mob.HarvestableDrops.Any(x => x.Tier == 2)) ||
                            (_configuration.ResT3 && mob.HarvestableDrops.Any(x => x.Tier == 3)) ||
                            (_configuration.ResT4 && mob.HarvestableDrops.Any(x => x.Tier == 4 && x.Rarity == 0)) ||
                            (_configuration.ResT4_1 && mob.HarvestableDrops.Any(x => x.Tier == 4 && x.Rarity == 1)) ||
                            (_configuration.ResT4_2 && mob.HarvestableDrops.Any(x => x.Tier == 4 && x.Rarity == 2)) ||
                            (_configuration.ResT4_3 && mob.HarvestableDrops.Any(x => x.Tier == 4 && x.Rarity == 3)) ||
                            (_configuration.ResT5_1 && mob.HarvestableDrops.Any(x => x.Tier == 5 && x.Rarity == 1)) ||
                            (_configuration.ResT5_2 && mob.HarvestableDrops.Any(x => x.Tier == 5 && x.Rarity == 2)) ||
                            (_configuration.ResT5_3 && mob.HarvestableDrops.Any(x => x.Tier == 5 && x.Rarity == 3)) ||
                            (_configuration.ResT6_1 && mob.HarvestableDrops.Any(x => x.Tier == 6 && x.Rarity == 1)) ||
                            (_configuration.ResT6_2 && mob.HarvestableDrops.Any(x => x.Tier == 6 && x.Rarity == 2)) ||
                            (_configuration.ResT6_3 && mob.HarvestableDrops.Any(x => x.Tier == 6 && x.Rarity == 3)) ||
                            (_configuration.ResT7_1 && mob.HarvestableDrops.Any(x => x.Tier == 7 && x.Rarity == 1)) ||
                            (_configuration.ResT7_2 && mob.HarvestableDrops.Any(x => x.Tier == 7 && x.Rarity == 2)) ||
                            (_configuration.ResT7_3 && mob.HarvestableDrops.Any(x => x.Tier == 7 && x.Rarity == 3)) ||
                            (_configuration.ResT8_1 && mob.HarvestableDrops.Any(x => x.Tier == 8 && x.Rarity == 1)) ||
                            (_configuration.ResT8_2 && mob.HarvestableDrops.Any(x => x.Tier == 8 && x.Rarity == 2)) ||
                            (_configuration.ResT8_3 && mob.HarvestableDrops.Any(x => x.Tier == 8 && x.Rarity == 3)))
                        {
                            harvestablesValid.Add(new ObjectHarvestable(mob));
                        }
                    }
                }

                foreach (var harvestable in harvestablesValid)
                {
                    switch (harvestable.Type)
                    {
                    case Ennui.Api.Meta.ResourceType.Fiber:
                        g.SetColor(Color.Yellow);
                        break;

                    case Ennui.Api.Meta.ResourceType.Ore:
                        g.SetColor(Color.Black);
                        break;

                    case Ennui.Api.Meta.ResourceType.Hide:
                        g.SetColor(Color.Orange);
                        break;

                    case Ennui.Api.Meta.ResourceType.Wood:
                        g.SetColor(Color.Purple);
                        break;

                    case Ennui.Api.Meta.ResourceType.Rock:
                        g.SetColor(Color.Cyan);
                        break;

                    default:
                        g.SetColor(Color.Blue);
                        break;
                    }
                    g.DrawLine(Convert.ToInt32(Players.LocalPlayer.ScreenLocation.X),
                               Convert.ToInt32(Players.LocalPlayer.ScreenLocation.Y),
                               harvestable.ScreenX,
                               harvestable.ScreenY);

                    // Calculate distance
                    var absX     = Math.Abs(Players.LocalPlayer.ScreenLocation.X - harvestable.ScreenX);
                    var absY     = Math.Abs(Players.LocalPlayer.ScreenLocation.Y - harvestable.ScreenY);
                    var distance = absX + absY;

                    if (distance > 500)
                    {
                        if (Math.Abs(harvestable.ScreenX) >= Math.Abs(harvestable.ScreenY))
                        {
                            if (Players.LocalPlayer.ScreenLocation.X < harvestable.ScreenX)
                            {
                                var y = ((harvestable.ScreenY - Players.LocalPlayer.ScreenLocation.Y) / (harvestable.ScreenX - Players.LocalPlayer.ScreenLocation.X)) * 100;
                                g.DrawString(distance.ToString(), Convert.ToInt32(Players.LocalPlayer.ScreenLocation.X + 100), Convert.ToInt32(Players.LocalPlayer.ScreenLocation.Y + y));
                            }
                            else if (Players.LocalPlayer.ScreenLocation.X > harvestable.ScreenX)
                            {
                                var y = ((harvestable.ScreenY - Players.LocalPlayer.ScreenLocation.Y) / (harvestable.ScreenX - Players.LocalPlayer.ScreenLocation.X)) * -100;
                                g.DrawString(distance.ToString(), Convert.ToInt32(Players.LocalPlayer.ScreenLocation.X - 100), Convert.ToInt32(Players.LocalPlayer.ScreenLocation.Y + y));
                            }
                        }
                        else
                        {
                            if (Players.LocalPlayer.ScreenLocation.Y < harvestable.ScreenY)
                            {
                                var x = (harvestable.ScreenX - Players.LocalPlayer.ScreenLocation.X) * 100 / (harvestable.ScreenY - Players.LocalPlayer.ScreenLocation.Y);
                                g.DrawString(distance.ToString(), Convert.ToInt32(Players.LocalPlayer.ScreenLocation.X + x), Convert.ToInt32(Players.LocalPlayer.ScreenLocation.Y + 100));
                            }
                            else if (Players.LocalPlayer.ScreenLocation.Y > harvestable.ScreenY)
                            {
                                var x = (harvestable.ScreenX - Players.LocalPlayer.ScreenLocation.X) * -100 / (harvestable.ScreenY - Players.LocalPlayer.ScreenLocation.Y);
                                g.DrawString(distance.ToString(), Convert.ToInt32(Players.LocalPlayer.ScreenLocation.X + x), Convert.ToInt32(Players.LocalPlayer.ScreenLocation.Y - 100));
                            }
                        }
                    }
                }
            }
        }