private static void RedeemQueue() { Write("Probing Queue in 15 seconds..."); Thread.Sleep(15000); while (true) { if (CodeQueue.GetCodeQueue().Count > 0) { foreach (var queuedCode in CodeQueue.GetCodeQueue()) { // get the event list and pass it the code we want it to type // var loop = GetRedeemLoop(queuedCode); // call the main loop to carry out the event of redeeming the code // DolphinScript.Lib.Backend.Common.DoLoop(loop); // save the code to the internal list of redeemed codes // Properties.Settings.Default.RedeemedCodes.Add(queuedCode); // remove the redeemed code from the code queue // CodeQueue.RemoveCodeFromQueue(queuedCode); } } else { Write("No codes currently in the queue..."); } Thread.Sleep(15000); } }
private static void Chat_OnMessageReceived(ChatMessageEventArgs e) { if (e.Message.Contains("AP")) { var m = e.Message; try { var code = m.Substring(m.IndexOf("AP"), 17); if (!Properties.Settings.Default.RedeemedCodes.Contains(code) && !CodeQueue.GetCodeQueue().Contains(code) && !code.Contains(" ")) { CodeQueue.AddCodeToQueue(code); foreach (var queuedCode in CodeQueue.GetCodeQueue()) { var loop = GetRedeemLoop(queuedCode); DolphinScript.Lib.Backend.Common.DoLoop(loop); Properties.Settings.Default.RedeemedCodes.Add(code); CodeQueue.RemoveCodeFromQueue(code); } } } catch { } } }