Esempio n. 1
0
        public static void SendEmail(string message)
        {
            try
            {
                String mailServer = ConfigurationManager.AppSettings["MailServer"];
                String mailTo     = ConfigurationManager.AppSettings["MailTo"];
                String mailFrom   = ConfigurationManager.AppSettings["MailFrom"];
                String username   = ConfigurationManager.AppSettings["Username"];
                String password   = ConfigurationManager.AppSettings["Password"];
                int    smtpPort   = 587;
                if (!int.TryParse(ConfigurationManager.AppSettings["SMTPPort"], out smtpPort))
                {
                    _log.Error(String.Format("SMTP Port not defined. Defaulting to {0}", smtpPort));
                }

                MailMessage mail       = new MailMessage();
                SmtpClient  SmtpServer = new SmtpClient(mailServer);

                mail.IsBodyHtml = true;
                mail.From       = new MailAddress(mailFrom);
                mail.To.Add(mailTo);
                String machine = System.Environment.MachineName;
                mail.Subject           = machine + " Alert from " + System.Diagnostics.Process.GetCurrentProcess().ProcessName;
                mail.Body              = message;
                SmtpServer.Port        = smtpPort;
                SmtpServer.Credentials = new System.Net.NetworkCredential(username, password);
                SmtpServer.EnableSsl   = true;

                SmtpServer.Send(mail);
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Send a request to the homepage of steam, check if there is something with "profiles/OurSteamID64/friends"
        /// If there is such a content inside the string, then we are still authenticated return true, so we know we are loggedon
        /// If there is not such a content inside the string, then we are not authenticated and try to authenticate to the web again
        /// To authenticate we have to request a new nonce, which will be needed to authenticate
        /// </summary>
        /// <returns></returns>
        public async Task <bool> RefreshSessionIfNeeded()
        {
            string response = await m_WebHelper.GetStringFromRequest("http://steamcommunity.com/my/").ConfigureAwait(false);

            bool isNotLoggedOn = response.Contains("Sign In");

            if (isNotLoggedOn)
            {
                SteamUser.WebAPIUserNonceCallback userNonceCallback;

                try
                {
                    userNonceCallback = await m_steamUser.RequestWebAPIUserNonce();
                }
                catch (Exception e)
                {
                    m_logger.Error(e.Message);
                    return(false);
                }

                if (string.IsNullOrEmpty(userNonceCallback?.Nonce))
                {
                    m_logger.Warning("Usernonce is empty");
                }

                m_logger.Warning("Reauthenticating...");

                return(AuthenticateUser(m_steamClient, userNonceCallback?.Nonce));
            }
            else
            {
                return(true);
            }
        }
Esempio n. 3
0
 static void Main(string[] args)
 {
     Logger.Logger logger = Logger.Loggers.LogFactory.GetLogger();
     logger.Error("I'm a small bug");
     logger.Info("I can be useful");
     logger.Warning("Nobody looks at warnings(");
     logger.Error(new StackOverflowException());
 }
Esempio n. 4
0
        /// <summary>
        /// If we have to give items and we will be receiving items then check the tradeoffer
        ///
        /// Get more details about the items which will be traded from the offersResponse we got earlier
        ///
        /// bool shouldAcceptTrade will be checked before every tradecheck so if one method says we can accept the trade we do not have to make the other tradechecks (do not waste time)
        ///
        /// Check if the trade is a 1:2 trade
        /// Check if the trade is a 1:1 trade
        ///
        /// At the end check against if the amount of cards we want to accept is equal to the amount of cards which is requested from us
        /// </summary>
        /// <param name="_offersResponse"></param>
        /// <param name="_tradeOffer"></param>
        /// <param name="_partnerID"></param>
        /// <returns></returns>
        private async Task CheckTradeOffer(GetOffersResponse _offersResponse, TradeOffer _tradeOffer, SteamID _partnerID)
        {
            if (_tradeOffer.ItemsToGive != null && _tradeOffer.ItemsToReceive != null)
            {
                bool shouldAcceptTrade = false;

                List <TradeOfferItemDescription> ourItems   = FillItemsList(_tradeOffer.ItemsToGive, _offersResponse, ItemType.TRADING_CARD);
                List <TradeOfferItemDescription> theirItems = FillItemsList(_tradeOffer.ItemsToReceive, _offersResponse, ItemType.TRADING_CARD | ItemType.FOIL_TRADING_CARD);

                if (ourItems == null || theirItems == null)
                {
                    m_logger.Error("Some item returned null, we can't proceed with the trade.");

                    await m_tradeOfferWebAPI.DeclineTradeofferShortMessage(_tradeOffer.TradeOfferID).ConfigureAwait(false);

                    return;
                }

                int ourItemsCount = ourItems.Count;

                // Check 1:2 Trade
                if (m_botInfo.Accept1on2Trades && !shouldAcceptTrade)
                {
                    shouldAcceptTrade = CheckForOneOnTwoCardTrade(ourItems, theirItems);
                }

                // Check 1:1 same Set Trade
                if (m_botInfo.Accept1on1Trades && !shouldAcceptTrade)
                {
                    shouldAcceptTrade = CheckForOneOnOneCardTrade(ourItems, theirItems).Count == ourItemsCount;
                }

                if (_tradeOffer.ItemsToGive.Count > _tradeOffer.ItemsToReceive.Count)
                {
                    await m_tradeOfferWebAPI.DeclineTradeoffer(_tradeOffer.TradeOfferID, _partnerID).ConfigureAwait(false);

                    return;
                }

                if (shouldAcceptTrade)
                {
                    bool accepted = await m_tradeOfferWebAPI.AcceptTradeofferShortMessage(_tradeOffer.TradeOfferID).ConfigureAwait(false);

                    if (accepted)
                    {
                        await m_mobileHelper.ConfirmAllTrades(m_steamWeb.SteamLogin, m_steamWeb.SteamLoginSecure, m_steamWeb.SessionID).ConfigureAwait(false);
                    }
                    else
                    {
                        m_logger.Warning("tradeoffer couldn't be accepted, return true, so we can handle it next time.");
                    }

                    return;
                }
            }

            await m_tradeOfferWebAPI.DeclineTradeofferShortMessage(_tradeOffer.TradeOfferID).ConfigureAwait(false);
        }
Esempio n. 5
0
        /// <summary>
        /// Create an url to the inventory with the steamID, appID and contextID
        /// Deserialize the response to an object so we can ease the work
        ///
        /// If we have more than 5000 items, page the request with the extension "start_assetid" and the last assetid from the previous request
        /// Make another request, if there are more pages set the variable of the default object so we can make a new request
        /// Add the items and the descriptions to the default inventoryresponse object
        ///
        /// Finally return the inventoryobject with all items from the inventory
        /// </summary>
        /// <param name="_steamID"></param>
        /// <param name="_appID"></param>
        /// <param name="_contextID"></param>
        /// <returns></returns>
        public async Task <InventoryResponse> GetInventory(ulong _steamID, int _appID, int _contextID)
        {
            try
            {
                string url = $"http://{m_steamWeb.m_SteamCommunityHost}/inventory/{_steamID}/{_appID}/{_contextID}?l=english&trading=1&count=5000";

                string response = await m_steamWeb.m_WebHelper.GetStringFromRequest(url).ConfigureAwait(false);

                InventoryResponse inventoryResponse = JsonConvert.DeserializeObject <InventoryResponse>(response);

                while (inventoryResponse.More == 1)
                {
                    url += $"&start_assetid={inventoryResponse.LastAssetID}";

                    response = await m_steamWeb.m_WebHelper.GetStringFromRequest(url).ConfigureAwait(false);

                    InventoryResponse inventoryResponseMore = JsonConvert.DeserializeObject <InventoryResponse>(response);

                    inventoryResponse.More        = inventoryResponseMore.More;
                    inventoryResponse.LastAssetID = inventoryResponseMore.LastAssetID;

                    inventoryResponse.Assets.AddRange(inventoryResponseMore.Assets);
                    inventoryResponse.ItemsDescriptions.AddRange(inventoryResponseMore.ItemsDescriptions);
                }

                return(inventoryResponse);
            }
            catch (Exception e)
            {
                m_logger.Error($"GetInventory : {e}");
            }

            return(new InventoryResponse());
        }
Esempio n. 6
0
        private static void Main(string[] args)
        {
            var log = new Logger.Logger();

            try {
                Config.Config.Load();
                log.Info($"use config file: {Config.Config.ConfigFile}");
            }
            catch (Exception e) {
                log.Error($"Failed load config file: {Config.Config.ConfigFile}\n\t-->{e}");
                Environment.Exit(1);
            }


            Console.Clear();
            using var cts           = new CancellationTokenSource();
            Console.CancelKeyPress += (sender, eventArgs) => {
                eventArgs.Cancel = true;
                cts.Cancel();
            };

            log.Warn("Press Ctrl+C to cancel");
            var token = cts.Token;

            try {
                var itf = Parser.Default.ParseArguments <AriesMake, AriesRun, AriesLsDb>(args)
                          .MapResult(
                    (AriesMake a) => a,
                    (AriesRun a) => a,
                    (AriesLsDb a) => (IAriesVerb)a,
                    e => throw new ParseFailedException());

                itf.Run(token);
            }
            catch (ParseFailedException) {
            }
            catch (AriesException e) {
                log.Error(e);
            }
            catch (Exception e) {
                log.Error($"Unknown error has occured\n\t-->{e}");
            }

            Console.ResetColor();
        }
Esempio n. 7
0
 static void Main(string[] args)
 {
     _log.Debug("Debug message");
     _log.Info("Info message");
     _log.Warn("Warn message");
     _log.Error("Error message");
     _log.Flush();
     Console.WriteLine("Done");
 }
Esempio n. 8
0
        /// <summary>
        /// Get the escrowduration in days from the trade
        ///
        /// Therefor send a request to get information about the tradeoffer
        /// Search for our and their Escrowduration, if successful, give the value out, else throw an exception which will tell us, what went wrong
        /// </summary>
        /// <param name="_tradeofferID"></param>
        /// <returns></returns>
        public async Task <TradeOfferEscrowDuration> GetTradeOfferEscrowDuration(string _tradeofferID)
        {
            string url = "http://steamcommunity.com/tradeoffer/" + _tradeofferID;

            string response = await m_steamWeb.m_WebHelper.GetStringFromRequest(url).ConfigureAwait(false);

            // HTMLAgility and XPath would be a chaos here, so Regex is easier and the way to go
            Match ourMatch   = Regex.Match(response, @"g_daysMyEscrow(?:[\s=]+)(?<days>[\d]+);", RegexOptions.IgnoreCase);
            Match theirMatch = Regex.Match(response, @"g_daysTheirEscrow(?:[\s=]+)(?<days>[\d]+);", RegexOptions.IgnoreCase);

            if (!ourMatch.Groups["days"].Success || !theirMatch.Groups["days"].Success)
            {
                Match steamErrorMatch = Regex.Match(response, @"<div id=""error_msg"">([^>]+)<\/div>", RegexOptions.IgnoreCase);

                if (steamErrorMatch.Groups.Count > 1)
                {
                    string steamError = Regex.Replace(steamErrorMatch.Groups[1].Value.Trim(), @"\t|\n|\r", "");
                    m_logger.Error(steamError);
                }

                m_logger.Error($"Not logged in, can't retrieve escrow duration for tradeofferID: {_tradeofferID}");

                return(new TradeOfferEscrowDuration
                {
                    Success = false,
                    DaysOurEscrow = -1,
                    DaysTheirEscrow = -1
                });
            }

            return(new TradeOfferEscrowDuration
            {
                Success = true,
                DaysOurEscrow = int.Parse(ourMatch.Groups["days"].Value),
                DaysTheirEscrow = int.Parse(theirMatch.Groups["days"].Value)
            });
        }
Esempio n. 9
0
 /// <summary>
 /// Cancel the task from the function "StartCheckForTradeOffers" if the token is not null
 /// </summary>
 public void StopCheckFarmCards()
 {
     try
     {
         m_cardFarmCancellationTokenSource?.Cancel();
     }
     catch (Exception exception)
     {
         if (exception.GetType() != typeof(ObjectDisposedException))
         {
             m_logger.Error(exception.Message);
             throw;
         }
     }
 }
Esempio n. 10
0
        public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, out object result)
        {
            MethodInfo invokedMethod = loggedObject.GetType().GetMethod(binder.Name);

            if (invokedMethod != null)
            {
                result = invokedMethod.Invoke(loggedObject, args);
                _logger.Info(binder.Name);
                return(true);
            }

            _logger.Error(binder.Name);
            result = null;
            return(false);
        }
Esempio n. 11
0
        private static void Main(string[] args)
        {
            var logger = new Logger.Logger();

            try {
                // parse cli options
                var request = Parser.Default.ParseArguments <DracoOption>(args)
                              .MapResult(
                    o => o.Build(), e => throw new DracoParseFailedException());


                using var cts = new CancellationTokenSource();
                var token = cts.Token;
                Console.CancelKeyPress += (sender, eventArgs) => {
                    eventArgs.Cancel = true;
                    cts.Cancel();
                };
                logger.Warn("Press Ctrl+C to cancel");


                // start process
                Spinner.Start("Ptolemy.Draco ", spin => {
                    using var draco = new Draco(token, request);
                    // print logs to stdout
                    var d = draco.Log.Subscribe(s => logger.Info(s));
                    try {
                        draco.Run();
                        spin.Info("Completed");
                    }
                    catch (Exception) {
                        spin.Fail("Failed");
                    }
                    finally {
                        d.Dispose();
                    }
                });
            }
            catch (DracoException e) {
                logger.Error($"{e}");
            }
            catch (DracoParseFailedException) {
            }
            catch (Exception e) {
                logger.Fatal($"{e}");
            }
        }
Esempio n. 12
0
        /// <summary>
        /// If we didn't link our mobile via the bot, just return a message
        /// If we did link our mobile via the bot, we have to get the SteamLogin and SteamLoginSecure, which we get from logging in to the web
        /// Pass the sessionID because we need it aswell, generate a uint64 SteamID from the SessionID, without this we can't fetch the confirmations
        /// With these values we can get all confirmations and accept or deny them, without it will throw errors
        /// </summary>
        public void ConfirmAllTrades(string _steamLogin, string _steamLoginSecure, string _sessionID)
        {
            if (m_steamGuardAccount == null)
            {
                m_logger.Warning("Bot account does not have 2FA enabled.");
            }
            else
            {
                m_steamGuardAccount.Session = new SessionData
                {
                    SteamLogin       = _steamLogin,
                    SteamLoginSecure = _steamLoginSecure,
                    SessionID        = _sessionID,
                    SteamID          = new SteamID(Encoding.UTF8.GetString(Convert.FromBase64String(_sessionID))).ConvertToUInt64()
                };

                Confirmation[] confirmations = m_steamGuardAccount.FetchConfirmations();

                if (confirmations != null)
                {
                    foreach (Confirmation confirmation in confirmations)
                    {
                        bool confirmedTrade = m_steamGuardAccount.AcceptConfirmation(confirmation);

                        if (confirmedTrade)
                        {
                            m_logger.Info($"Confirmed {confirmation.Description}, (Confirmation ID #{confirmation.ID})");
                        }
                        else
                        {
                            m_logger.Warning($"Could not confirm {confirmation.Description}, (Confirmation ID #{confirmation.ID})");
                        }
                    }
                }
                else
                {
                    m_logger.Error("Mobilehelper: Must Login");
                }
            }
        }
Esempio n. 13
0
        private void Step()
        {
            if (state.Halt)
            {
                Logger.Error("Program reached HALT State. Please reassemble the program");
                return;
            }

            switch (state.InstructionExecutionStep)
            {
            case 0:
            {
                var mir = MIR.Instance;
                var mar = MAR.Instance;
                var mpm = new MPM();
                mir.Value = mpm[mar.Value];
                state.InstructionExecutionStep = 1;
                break;
            }

            case 1:
            {
                ALU.DoOperation();
                MIR.Instance.CheckForOtherOperationsAndExecuteIfPresent();
                Memory.CheckForOperationAndExecuteIfPresent();
                MAR.Instance.PrepareForNextMicroInstruction();
                state.InstructionExecutionStep = 0;
                break;
            }

            default:
            {
                throw new Exception("STATE OUT OF RANGE");
            }
            }
        }
        protected override void OnStart(string[] args)
        {
            if (int.TryParse(ConfigurationManager.AppSettings["Minutes"], out _minutes))
            {
                _log.Info(String.Format("Applying Purge thread restart every {0} minutes", _minutes));
            }

            if (int.TryParse(ConfigurationManager.AppSettings["AlertMinutes"], out _alertMinutes))
            {
                _log.Info(String.Format("Applying Alert thread restart every {0} minutes", _alertMinutes));
            }

            if (int.TryParse(ConfigurationManager.AppSettings["DaysToKeep"], out _daysToKeep))
            {
                _log.Info(String.Format("Applying Days to keep archives to {0} days", _daysToKeep));
            }

            if (long.TryParse(ConfigurationManager.AppSettings["AlertLimitMegabyte"], out _freeLimit))
            {
                _log.Info(String.Format("Available Limit for Alerts is {0} Mb", _freeLimit));
            }

            string[] seperator = { ";" };
            string[] path      = null;

            if (args.Length > 0)
            {
                path = args[0].Split(seperator, StringSplitOptions.None);
            }
            else
            {
                path = ConfigurationManager.AppSettings["Path"].Split(seperator, StringSplitOptions.None);
            }

            if (path == null || path.Length == 0)
            {
                _log.Error("No path has been set. Cannot continue");
                OnStop();
                return;
            }

            StartProcess(path);
        }
Esempio n. 15
0
        public override void OnEnabled()
        {
            base.OnEnabled();

            foreach (KeyValuePair <string, Language> defaultLanguage in Translation.Translation.DefaultLanguages)
            {
                this.RegisterTranslation(defaultLanguage.Value, defaultLanguage.Key);
            }

            Language t = this.LoadTranslation <Language>();

            Exiled.API.Features.Log.Debug(t.ContainDenied);
            Exiled.API.Features.Log.Debug(t.NotImplementedYet);
            Exiled.API.Features.Log.Debug(t.IntercomDenied);

            //Exiled.Events.Events.DisabledPatches.Add(new Tuple<Type, string>(typeof(RespawnManager), nameof(RespawnManager.Spawn)));
            //Exiled.Events.Events.Instance.ReloadDisabledPatches();

            try
            {
                Log = new Logger.Logger("GhostSpectator", Loader.ShouldDebugBeShown);

                Log.Info($"Attempting to set language to {Config.Lang}.");

                Translation.Translation.LoadTranslations();

                CultureInfo ci;

                try
                {
                    ci = CultureInfo.GetCultureInfo(Config.Lang);
                }
                catch (Exception e)
                {
                    ci = CultureInfo.GetCultureInfo("en");
                    Log.Error($"{Config.Lang} is not a valid language. Defaulting to English.");
                    Log.Error($"{e.Message}");
                }

                CultureInfo.DefaultThreadCurrentCulture   = ci;
                CultureInfo.DefaultThreadCurrentUICulture = ci;
                Log.Info($"Language set to {ci.DisplayName}.");
                Log.Debug($"Language test {Translation.Translation.GetText().DoorDenied}.");

                RegisterEvents();

                Log.Debug("Patching...");
                try
                {
                    //You must use an incrementer for the harmony instance name, otherwise the new instance will fail to be created if the plugin is reloaded.
                    _patchFixer++;
                    _instance = new Harmony($"ghostspectator.patches{_patchFixer}");
                    _instance.PatchAll();
                }
                catch (Exception exception)
                {
                    Log.Error($"Patching failed! {exception}");
                }

                //Timing.RunCoroutine(EventHandlers.SlowUpdate());

                Log.Info($"{Name} loaded. c:");
            }
            catch (Exception e)
            {
                Log.Error($"There was an error loading the plugin: {e}");
            }
        }
Esempio n. 16
0
        private static void Main(string[] args)
        {
            var log = new Logger.Logger();

            log.Info("Welcome to Ptolemy.Argo");
            try {
                var req = Parser.Default.ParseArguments <ArgoOption>(args)
                          .MapResult(o => {
                    if (!o.Clean)
                    {
                        return(o.BuildRequest());
                    }

                    // --clean
                    var path = Path.Combine(Path.GetTempPath(), "Ptolemy.Argo");
                    Spinner.Start("Cleanup...", spin => {
                        if (Directory.Exists(path))
                        {
                            Directory.Delete(path, true);
                        }
                        spin.Info("Finished");
                    });


                    throw new ArgoClean();
                }, e => throw new ParseFailedException());

                Console.Clear();
                log.Info($"TargetNetList Netlist: {req.NetList}");
                log.Info("Parameters");
                log.Info("\tVtn:");
                log.Info($"\t\tThreshold: {req.Transistors.Vtn.Threshold}");
                log.Info($"\t\tSigma: {req.Transistors.Vtn.Sigma}");
                log.Info($"\t\tNumberOfSigma: {req.Transistors.Vtn.NumberOfSigma}");
                log.Info("\tVtp:");
                log.Info($"\t\tThreshold: {req.Transistors.Vtp.Threshold}");
                log.Info($"\t\tSigma: {req.Transistors.Vtp.Sigma}");
                log.Info($"\t\tNumberOfSigma: {req.Transistors.Vtp.NumberOfSigma}");
                log.Info($"\tSweeps: {req.SweepStart:E} to {req.Sweep + req.SweepStart - 1:E}");
                log.Info($"\tSeed: {req.Seed:E}");
                log.Info($"\tTemperature: {req.Temperature}");
                log.Info($"\tSimulationTime: {req.Time.Start:E} to {req.Time.Stop:E} (step={req.Time.Step:E})");
                log.Info($"ExtractTargets: {string.Join(",", req.Signals)}");
                log.Info($"Include {req.Includes.Count} files");
                foreach (var inc in req.Includes)
                {
                    log.Info($"\t--> {inc}");
                }

                log.Warn($"Press Ctrl+C to cancel");

                using var cts           = new CancellationTokenSource();
                Console.CancelKeyPress += (sender, eventArgs) => {
                    eventArgs.Cancel = true;
                    cts.Cancel();
                };

                var sw = new Stopwatch();
                sw.Start();
                var res = Argo.Run(cts.Token, req);
                sw.Stop();

                log.Info("Finished simulation");
                log.Info($"Elapsed: {sw.Elapsed}");
                log.Info($"{res.Count} result records");
                // 結果をSTDOUTに出す
                if (string.IsNullOrEmpty(req.ResultFile))
                {
                    log.Warn("result file not set. print to stdout");
                    Console.WriteLine("[");
                    foreach (var r in res)
                    {
                        Console.WriteLine($"{r},");
                    }
                    Console.WriteLine("]");
                }
                // 結果をファイルに書く
                else
                {
                    log.Info($"Write to {req.ResultFile}");
                    using var writer = new StreamWriter(req.ResultFile);
                    writer.WriteLine("[");
                    foreach (var r in res)
                    {
                        writer.WriteLine($"{r},");
                        writer.Flush();
                    }
                    writer.WriteLine("]");
                    writer.Flush();
                }
            }
            catch (ArgoClean) {
                log.Info("Ptolemy.Argo clean temp directory /tmp/Ptolemy.Argo");
            }
            catch (ParseFailedException) {
                log.Warn("Failed parse options");
            }
            catch (ArgoException e) {
                log.Error(e);
                Environment.ExitCode = 1;
            }
            catch (Exception e) {
                log.Error($"Unexpected exception was thrown\n-->{e}");
                Environment.ExitCode = 1;
            }
        }
Esempio n. 17
0
        private static void Main(string[] args)
        {
            Console.Clear();

            var log = new Logger.Logger();

            using var cts = new CancellationTokenSource();
            var token = cts.Token;

            Console.CancelKeyPress += (sender, eventArgs) => {
                eventArgs.Cancel = true;
                cts.Cancel();
            };
            log.Warn("Press Ctrl+C to cancel");

            try {
                Tuple <string, long>[] result = null;
                var sw = new Stopwatch();
                sw.Start();

                log.Info("Start Ptolemy.Libra");
                var request = Parser
                              .Default
                              .ParseArguments <LibraOption>(args)
                              .MapResult(o => o.BuildRequest(), e => throw new ParseFailedException());
                log.Info("Built request");
                log.Info($"{request.Expressions.Count} expression(s) detected");
                log.Info($"Sweep");
                if (request.IsSplitWithSeed)
                {
                    log.Info($"\tSeed: Start: {request.SeedStart}, End: {request.SeedEnd}");
                    log.Info($"\tSweep per query: {request.Sweeps.Size}");
                    log.Info($"\tTotal Sweeps: {(request.SeedEnd - request.SeedStart + 1) * request.Sweeps.Size}");
                }
                else
                {
                    log.Info($"\tSeed: {request.SeedStart}");
                    log.Info($"\tSweep: Start: {request.Sweeps.Start}, End: {request.Sweeps.Total+request.Sweeps.Start-1}");
                }

                var libra = new Libra(token, log);
                result = libra.Run(request);

                sw.Stop();
                log.Info($"Elapsed time: {sw.Elapsed}");
                log.Info("Result: ");
                Console.WriteLine();
                foreach (var(key, value) in result)
                {
                    Console.WriteLine($"Expression: {key}, Value: {value}");
                }
            }
            catch (ParseFailedException) {
            }
            catch (LibraException e) {
                log.Error(e);
            }
            catch (Exception e) {
                log.Error($"Unknown has occured\n\t-->{e}");
            }
        }