/// <summary> /// Start the countdown process /// </summary> public static void StartCountdown() { //Quit countdown if it is disabled if (!Boolean.Parse(Common.IniFile.IniReadValue("countdown", "enabled"))) { return; } //Load countdown items var countdownItems = new List<CountdownItem>(); int items = int.Parse(Common.IniFile.IniReadValue("countdown", "count")); for (int i = 0; i < items; i++) { var ci = new CountdownItem(); ci.ConsoleMessage = Common.IniFile.IniReadValue("countdown", string.Format("item{0}console", i)); ci.UniverseMessage = Common.IniFile.IniReadValue("countdown", string.Format("item{0}universe", i)); ci.WaitTime = int.Parse(Common.IniFile.IniReadValue("countdown", string.Format("item{0}wait", i))); countdownItems.Add(ci); } //Create a connection to flhook and connect it var flhookconnection = new FLHookConnection(); flhookconnection.Connect(); //Run Countdown foreach (CountdownItem ci in countdownItems) { Console.WriteLine(ci.ConsoleMessage); flhookconnection.SendUniverseMessage(ci.UniverseMessage); Wait(ci.WaitTime); } //Diconnect from FLHook flhookconnection.Disconnect(); }
/// <summary> /// Start the countdown process /// </summary> public static void StartCountdown() { //Quit countdown if it is disabled if (!Boolean.Parse(Common.IniFile.IniReadValue("countdown", "enabled"))) { return; } //Load countdown items var countdownItems = new List <CountdownItem>(); int items = int.Parse(Common.IniFile.IniReadValue("countdown", "count")); for (int i = 0; i < items; i++) { var ci = new CountdownItem(); ci.ConsoleMessage = Common.IniFile.IniReadValue("countdown", string.Format("item{0}console", i)); ci.UniverseMessage = Common.IniFile.IniReadValue("countdown", string.Format("item{0}universe", i)); ci.WaitTime = int.Parse(Common.IniFile.IniReadValue("countdown", string.Format("item{0}wait", i))); countdownItems.Add(ci); } //Create a connection to flhook and connect it var flhookconnection = new FLHookConnection(); flhookconnection.Connect(); //Run Countdown foreach (CountdownItem ci in countdownItems) { Console.WriteLine(ci.ConsoleMessage); flhookconnection.SendUniverseMessage(ci.UniverseMessage); Wait(ci.WaitTime); } //Diconnect from FLHook flhookconnection.Disconnect(); }