Ejemplo n.º 1
0
        public static IEnumerable <VoiceAttackVariable> SystemJumpToVoiceAttackVariables(this SystemJump systemJump)
        {
            if (systemJump == null)
            {
                yield break;
            }

            yield return(VoiceAttackVariable.Create("current_waypoint", systemJump.System));

            yield return(VoiceAttackVariable.Create("distance_left", Convert.ToDecimal(systemJump.DistanceLeft)));

            yield return(VoiceAttackVariable.Create("distance_jumped", Convert.ToDecimal(systemJump.DistanceJumped)));

            yield return(VoiceAttackVariable.Create("nb_jumps", systemJump.Jumps));
        }
Ejemplo n.º 2
0
        public static void VA_Invoke1(dynamic vaProxy)
        {
            try
            {
                string context = vaProxy.Context;

                switch (context)
                {
                case "next_waypoint":
                    var(next, jumpIndexNext) = EdRouter.Instance.NextWaypoint();
                    if (next != null)
                    {
                        var nextJumpStats = next.SystemJumpToVoiceAttackVariables().Concat(new[]
                        {
                            VoiceAttackVariable.Create("jump_number", jumpIndexNext + 1),
                            VoiceAttackVariable.Create("travel_percent", Convert.ToDecimal(EdRouter.Instance.RouteTraveledPercent))
                        });

                        foreach (var variable in nextJumpStats)
                        {
                            SetVariable(ref vaProxy, variable.Type, variable.VariableName, variable.VariableValue);
                        }
                    }
                    break;

                case "prev_waypoint":
                    var(prev, jumpIndexPrev) = EdRouter.Instance.PreviousWaypoint();
                    if (prev != null)
                    {
                        var prevJumpStats = prev.SystemJumpToVoiceAttackVariables().Concat(new[]
                        {
                            VoiceAttackVariable.Create("jump_number", jumpIndexPrev + 1),
                            VoiceAttackVariable.Create("travel_percent", Convert.ToDecimal(EdRouter.Instance.RouteTraveledPercent))
                        });
                        foreach (var variable in prevJumpStats)
                        {
                            SetVariable(ref vaProxy, variable.Type, variable.VariableName, variable.VariableValue);
                        }
                    }
                    break;

                case "open_gui":
                    InvokeConfiguration();
                    break;

                case "calculate_route":
                    EdRouter.Instance.CalculateRoute();
                    break;

                case "toggle_automate_next_waypoint":
                    EdRouter.Instance.EnableAutoWaypoint = !EdRouter.Instance.EnableAutoWaypoint;
                    break;

                case "automate_next_waypoint_on":
                    EdRouter.Instance.EnableAutoWaypoint = true;
                    break;

                case "automate_next_waypoint_off":
                    EdRouter.Instance.EnableAutoWaypoint = false;
                    break;

                default:
                    break;
                }
                WaypointToClipboard();
            }
            catch (Exception ex)
            {
                vaProxy.WriteToLog("Error from ED-Router: " + ex.Message, "red");
            }
        }