diff --git a/.gitignore b/.gitignore index 474385f..1be5598 100644 --- a/.gitignore +++ b/.gitignore @@ -1,25 +1,158 @@ -/SyncToy_3f894b4a-cf09-47ad-a7c6-0c9d16ac6621.dat +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates *.sqlite *.rar -bin -/*.dat -/CoMaNdO.Example/bin -/CoMaNdO.Example/obj -/CoMaNdO.Uptime/bin -/CoMaNdO.Uptime/obj -/CoMaNdO.Polls/bin -/CoMaNdO.Polls/obj -/CoMaNdO.Gambling/bin -/CoMaNdO.Gambling/obj -/CoMaNdO.Greetings/bin -/CoMaNdO.Greetings/obj -/CoMaNdO.MultipleOutputs/bin -/CoMaNdO.MultipleOutputs/obj -/CoMaNdO.UserRanks/bin -/CoMaNdO.UserRanks/obj -/CoMaNdO.Auctions/bin -/CoMaNdO.Auctions/obj -/CoMaNdO.Giveaways/bin -/CoMaNdO.Giveaways/obj -/CoMaNdO.SongRequests/bin -/CoMaNdO.SongRequests/obj + +# Build results + +[Dd]ebug/ +[Rr]elease/ +x64/ +build/ +[Bb]in/ +[Oo]bj/ + +# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets +!packages/*/build/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.scc + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.Publish.xml + +# NuGet Packages Directory +## TODO: If you have NuGet Package Restore enabled, uncomment the next line +#packages/ + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.[Pp]ublish.xml +*.pfx +*.publishsettings + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +App_Data/*.mdf +App_Data/*.ldf + + +#LightSwitch generated files +GeneratedArtifacts/ +_Pvt_Extensions/ +ModelManifest.xml + +# ========================= +# Windows detritus +# ========================= + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Mac desktop service store files +.DS_Store \ No newline at end of file diff --git a/CoMaNdO.Auctions/Auctions.cs b/CoMaNdO.Auctions/Auctions.cs index 56d8768..4d72115 100644 --- a/CoMaNdO.Auctions/Auctions.cs +++ b/CoMaNdO.Auctions/Auctions.cs @@ -19,16 +19,16 @@ public void Load() Events.OnDisconnect += Events_OnDisconnect; } - private void Events_Connected(string channel, string nick, bool partnered) + private void Events_Connected(string channel, string nick, bool partnered, bool subprogram) { - Commands.Add("!auction", Command_Auction, 2, 0); - Commands.Add("!bid", Command_Bid, 0, 0); + Commands.Add(this, "!auction", Command_Auction, 2, 0); + Commands.Add(this, "!bid", Command_Bid, 0, 0); if (Auction.Loop == null) Auction.Loop = new Timer(auctionLoopHandler, null, Timeout.Infinite, Timeout.Infinite); Auction.Loop.Change(Timeout.Infinite, Timeout.Infinite); } - private void Command_Auction(string user, string cmd, string[] args) + private void Command_Auction(string user, Command cmd, string[] args) { if (args.Length > 0) { @@ -71,7 +71,7 @@ private void Command_Auction(string user, string cmd, string[] args) } } - private void Command_Bid(string user, string cmd, string[] args) + private void Command_Bid(string user, Command cmd, string[] args) { if (args.Length > 0) { @@ -84,7 +84,7 @@ private void auctionLoopHandler(Object state) { if (Auction.Open && Auction.highBidder != "") { - Chat.SendMessage(Users.GetDisplayName(Auction.highBidder) + " is currently winning, with a bid of " + Auction.highBid + "!"); + Chat.SendMessage(Users.GetDisplayName(Auction.highBidder, NameAlterLevel.Cosmetic) + " is currently winning, with a bid of " + Auction.highBid + "!"); } } @@ -103,7 +103,7 @@ private void Events_OnDisconnect() public string Author { get { return "CoMaNdO"; } } public string UniqueID { get { return "CoMaNdO.Auctions"; } } public string ContactInfo { get { return "CoMaNdO.ModBot@gmail.com"; } } - public string Version { get { return "0.0.2"; } } + public string Version { get { return "0.0.3"; } } public int ApiVersion { get { return 0; } } public int LoadPriority { get { return 1; } } diff --git a/CoMaNdO.Auctions/Properties/AssemblyInfo.cs b/CoMaNdO.Auctions/Properties/AssemblyInfo.cs index b60bdb1..f0bfaac 100644 --- a/CoMaNdO.Auctions/Properties/AssemblyInfo.cs +++ b/CoMaNdO.Auctions/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.0.2")] +[assembly: AssemblyVersion("0.0.3")] //[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/CoMaNdO.Example/Example.cs b/CoMaNdO.Example/Example.cs index 318fb0e..c392423 100644 --- a/CoMaNdO.Example/Example.cs +++ b/CoMaNdO.Example/Example.cs @@ -31,12 +31,12 @@ public void Load() } } - private void Events_Connected(string channel, string nick, bool partnered) // We register our commands after the bot is connected to the channel. + private void Events_Connected(string channel, string nick, bool partnered, bool subprogram) // We register our commands after the bot is connected to the channel. { - Commands.Add("!example", Command_Example); // We add the command with a handler that will perform the task we want it to. + Commands.Add(this, "!example", Command_Example); // We add the command with a handler that will perform the task we want it to. } - private void Command_Example(string user, string command, string[] args) + private void Command_Example(string user, Command cmd, string[] args) { // Output Chat.SendMessage("My first command, YAY!"); @@ -47,7 +47,7 @@ private void Command_Example(string user, string command, string[] args) public string Author { get { return "CoMaNdO"; } } // Your name/nickname. public string UniqueID { get { return "CoMaNdO.Example"; } } // Will be used for data storage, to keep a unique space for your extension, you'd normally want to put your name/nickname and the name of the extension. public string ContactInfo { get { return "CoMaNdO.ModBot@gmail.com"; } } // Will be used to refer people for suggestions, error reports and more. - public string Version { get { return "0.0.3"; } } // The version of the extension. + public string Version { get { return "0.0.4"; } } // The version of the extension. public int ApiVersion { get { return 0; } } // The API version that it has been built with, changes to the API version will be posted on the blog. The use of ApiVersion 0 is if you believe that changes to the API won't affect your code, this is highly doubtable unless you're me. public int LoadPriority { get { return 3; } } diff --git a/CoMaNdO.Example/Properties/AssemblyInfo.cs b/CoMaNdO.Example/Properties/AssemblyInfo.cs index 2dee888..11dda21 100644 --- a/CoMaNdO.Example/Properties/AssemblyInfo.cs +++ b/CoMaNdO.Example/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.0.3")] +[assembly: AssemblyVersion("0.0.4")] //[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/CoMaNdO.Gambling/Gambling.cs b/CoMaNdO.Gambling/Gambling.cs index 9cef334..992a959 100644 --- a/CoMaNdO.Gambling/Gambling.cs +++ b/CoMaNdO.Gambling/Gambling.cs @@ -15,7 +15,7 @@ public class Gambling : IExtension public void Load() { - Pool.Load(); + Pool.Load(this); } public string Name { get { return "Gambling System"; } } @@ -23,7 +23,7 @@ public void Load() public string Author { get { return "CoMaNdO"; } } public string UniqueID { get { return "CoMaNdO.Gambling"; } } public string ContactInfo { get { return "CoMaNdO.ModBot@gmail.com"; } } - public string Version { get { return "0.0.1"; } } + public string Version { get { return "0.0.2"; } } public int ApiVersion { get { return 0; } } public int LoadPriority { get { return 1; } } @@ -73,18 +73,21 @@ static class Pool private static System.Threading.Timer BetQueue; public static List Options = new List(); public static bool Running, Locked; + private static IExtension extension; - public static void Load() + public static void Load(IExtension sender) { + extension = sender; + Events.Connected += Events_Connected; Events.Currency.OnQueue += Events_OnCurrencyQueue; Events.OnDisconnect += Events_OnDisconnect; } - private static void Events_Connected(string channel, string nick, bool partnered) + private static void Events_Connected(string channel, string nick, bool partnered, bool subprogram) { - Commands.Add("!gamble", Command_Gamble, 2, 0); - Commands.Add("!bet", Command_Bet, 0, 0); + Commands.Add(extension, "!gamble", Command_Gamble, 2, 0); + Commands.Add(extension, "!bet", Command_Bet, 0, 0); if (BetQueue == null) BetQueue = new System.Threading.Timer(BetQueueHandler, null, Timeout.Infinite, Timeout.Infinite); BetQueue.Change(Timeout.Infinite, Timeout.Infinite); @@ -324,7 +327,7 @@ public static List buildBetOptions(string[] temp, int index = 3) return betOptions; } - private static void Command_Gamble(string user, string cmd, string[] args) + private static void Command_Gamble(string user, Command cmd, string[] args) { if (args.Length > 0) { @@ -513,7 +516,7 @@ private static void Command_Gamble(string user, string cmd, string[] args) } } - private static void Command_Bet(string user, string cmd, string[] args) + private static void Command_Bet(string user, Command cmd, string[] args) { if (Running) { diff --git a/CoMaNdO.Gambling/Properties/AssemblyInfo.cs b/CoMaNdO.Gambling/Properties/AssemblyInfo.cs index 4dd66b5..6f0a511 100644 --- a/CoMaNdO.Gambling/Properties/AssemblyInfo.cs +++ b/CoMaNdO.Gambling/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.0.1")] +[assembly: AssemblyVersion("0.0.2")] //[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/CoMaNdO.Giveaways/Giveaways.cs b/CoMaNdO.Giveaways/Giveaways.cs index e48cf7a..3b9b39f 100644 --- a/CoMaNdO.Giveaways/Giveaways.cs +++ b/CoMaNdO.Giveaways/Giveaways.cs @@ -27,7 +27,7 @@ public void Load() public string Author { get { return "CoMaNdO"; } } public string UniqueID { get { return "CoMaNdO.Giveaways"; } } public string ContactInfo { get { return "CoMaNdO.ModBot@gmail.com"; } } - public string Version { get { return "0.0.1"; } } + public string Version { get { return "0.0.2"; } } public int ApiVersion { get { return 0; } } public int LoadPriority { get { return 0; } } @@ -97,12 +97,12 @@ public static void Load(IExtension sender) Events.OnDisconnect += Events_OnDisconnect; } - private static void Events_Connected(string channel, string nick, bool partnered) + private static void Events_Connected(string channel, string nick, bool partnered, bool subprogram) { - Commands.Add("!raffle", Command_Giveaway, 0, 0); - Commands.Add("!giveaway", Command_Giveaway, 0, 0); - Commands.Add("!ticket", Command_Ticket, 0, 0); - Commands.Add("!tickets", Command_Ticket, 0, 0); + Commands.Add(extension, "!raffle", Command_Giveaway, 0, 0); + Commands.Add(extension, "!giveaway", Command_Giveaway, 0, 0); + Commands.Add(extension, "!ticket", Command_Ticket, 0, 0); + Commands.Add(extension, "!tickets", Command_Ticket, 0, 0); if (GiveawayQueue == null) GiveawayQueue = new System.Threading.Timer(GiveawayQueueHandler, null, Timeout.Infinite, Timeout.Infinite); GiveawayQueue.Change(Timeout.Infinite, Timeout.Infinite); @@ -112,9 +112,9 @@ private static void Events_Connected(string channel, string nick, bool partnered Window.BeginInvoke((MethodInvoker)delegate { - Window.Giveaway_MustSubscribe.Enabled = partnered; - Window.Giveaway_SubscribersWinMultiplier.Enabled = partnered; - if (!partnered) + Window.Giveaway_MustSubscribe.Enabled = subprogram; + Window.Giveaway_SubscribersWinMultiplier.Enabled = subprogram; + if (!subprogram) { Window.Giveaway_MustSubscribe.Checked = false; Window.Giveaway_SubscribersWinMultiplier.Checked = false; @@ -139,7 +139,7 @@ private static void Events_Connected(string channel, string nick, bool partnered }); } - private static void Command_Giveaway(string user, string cmd, string[] args) + private static void Command_Giveaway(string user, Command cmd, string[] args) { if (args.Length > 0) { @@ -330,18 +330,18 @@ private static void Command_Giveaway(string user, string cmd, string[] args) if ((args[0].ToLower() == "buy" || args[0].ToLower() == "join" || args[0].ToLower() == "purchase" || args[0].ToLower() == "ticket" || args[0].ToLower() == "tickets") && args.Length > 1) { - Command_Ticket(user, "!ticket", new string[] { args[1] }); + Command_Ticket(user, cmd, new string[] { args[1] }); } } else { - Command_Ticket(user, "!ticket", args); + Command_Ticket(user, cmd, args); } } - private static void Command_Ticket(string user, string cmd, string[] args) + private static void Command_Ticket(string user, Command cmd, string[] args) { - if (Started && (Window.Giveaway_TypeKeyword.Checked && (Window.Giveaway_CustomKeyword.Text == "" || cmd == "Custom") || Window.Giveaway_TypeTickets.Checked)) + if (Started && (Window.Giveaway_TypeKeyword.Checked && (Window.Giveaway_CustomKeyword.Text == "" || cmd == null) || Window.Giveaway_TypeTickets.Checked)) { if (IsOpen) { @@ -364,7 +364,15 @@ private static void Command_Ticket(string user, string cmd, string[] args) if (BuyTickets(user)) { if (FalseEntries.ContainsKey(user)) FalseEntries.Remove(user); - GiveawayQueue.Change(10000, Timeout.Infinite); + if (FalseEntries.Count > 15) + { + GiveawayQueue.Change(Timeout.Infinite, Timeout.Infinite); + GiveawayQueueHandler(null); + } + else + { + GiveawayQueue.Change(10000, Timeout.Infinite); + } } else { @@ -410,7 +418,15 @@ private static void Command_Ticket(string user, string cmd, string[] args) if (int.TryParse(args[0], out tickets) && tickets >= 0 && BuyTickets(user, tickets)) { if (FalseEntries.ContainsKey(user)) FalseEntries.Remove(user); - GiveawayQueue.Change(10000, Timeout.Infinite); + if (FalseEntries.Count > 15) + { + GiveawayQueue.Change(Timeout.Infinite, Timeout.Infinite); + GiveawayQueueHandler(null); + } + else + { + GiveawayQueue.Change(10000, Timeout.Infinite); + } } else { @@ -466,7 +482,7 @@ private static void Events_MessageReceived(string user, string message) { if (Window.Giveaway_TypeKeyword.Checked && message.ToLower() == Window.Giveaway_CustomKeyword.Text.ToLower()) { - Command_Ticket(user, "Custom", new string[0]); + Command_Ticket(user, null, new string[0]); } if (Window.Giveaway_TypeActive.Checked && Started) @@ -475,8 +491,8 @@ private static void Events_MessageReceived(string user, string message) { lock (Window.Giveaway_UserList.Items) { - //if (!Chat.IgnoredUsers.Contains(user.ToLower()) && !Window.Giveaway_UserList.Items.Contains(user) && CheckUser(user, Chat.Users.Count < 100)) - if (!Chat.IgnoredUsers.Contains(user.ToLower()) && !Window.Giveaway_BanListListBox.Items.Contains(user.ToLower()) && !Window.Giveaway_UserList.Items.Contains(user) && CheckUser(user, false)) + //if (!Chat.IgnoredUsers.Contains(user.ToLower()) && !Window.Giveaway_UserList.Items.Contains(user) && CheckUser(user, true, Chat.Users.Count < 100)) + if (!Chat.IgnoredUsers.Contains(user.ToLower()) && !Window.Giveaway_BanListListBox.Items.Contains(user.ToLower()) && !Window.Giveaway_UserList.Items.Contains(user) && CheckUser(user, true, false)) { Window.Giveaway_UserList.Items.Add(user); @@ -708,7 +724,11 @@ public static void Close(bool announce = true, bool open = true) if (announce) { - if (!Window.Giveaway_TypeActive.Checked) GiveawayQueue.Change(0, Timeout.Infinite); + if (!Window.Giveaway_TypeActive.Checked) + { + GiveawayQueue.Change(Timeout.Infinite, Timeout.Infinite); + GiveawayQueueHandler(null); + } Chat.SendMessage("Entries to the giveaway are now closed."); } @@ -732,7 +752,11 @@ public static void Open(bool announce = true) if (announce) { - if (!Window.Giveaway_TypeActive.Checked) GiveawayQueue.Change(0, Timeout.Infinite); + if (!Window.Giveaway_TypeActive.Checked) + { + GiveawayQueue.Change(Timeout.Infinite, Timeout.Infinite); + GiveawayQueueHandler(null); + } Chat.SendMessage("Entries to the giveaway are now open."); } @@ -796,7 +820,7 @@ public static bool HasBoughtTickets(string user) public static bool BuyTickets(string user, int tickets = 1) { - string name = Users.GetDisplayName(user, true); + string name = Users.GetDisplayName(user, NameAlterLevel.None, true); user = user.ToLower(); if (Started && (Window.Giveaway_TypeKeyword.Checked || Window.Giveaway_TypeTickets.Checked) && IsOpen && tickets <= MaxTickets && CheckUser(user)) { @@ -853,22 +877,15 @@ public static bool BuyTickets(string user, int tickets = 1) return false; } - public static int GetMinCurrency() - { - if (Window.Giveaway_MinCurrency.Checked) return Convert.ToInt32(Window.Giveaway_MinCurrencyBox.Value); - - return 0; - } - - public static bool CheckUser(string user, bool checkfollow = true, bool checksubscriber = true, bool checktime = true) + public static bool CheckUser(string user, bool checkcurrency = true, bool checkfollow = true, bool checksubscriber = true, bool checktime = true) { user = user.ToLower(); - return (!Chat.IgnoredUsers.Contains(user) && !Window.Giveaway_BanListListBox.Items.Contains(user) && Currency.Check(user) >= GetMinCurrency() && (!checkfollow || !Window.Giveaway_MustFollow.Checked || Users.IsFollower(user)) && (!checksubscriber || !Window.Giveaway_MustSubscribe.Checked || Users.IsSubscriber(user)) && (!checktime || !Window.Giveaway_MustWatch.Checked || Users.CompareTimeWatched(user, new TimeSpan((int)Window.Giveaway_MustWatchHours.Value, (int)Window.Giveaway_MustWatchMinutes.Value, 0)) >= 0)); + return (!Chat.IgnoredUsers.Contains(user) && !Window.Giveaway_BanListListBox.Items.Contains(user) && (!checkcurrency || !Window.Giveaway_MinCurrency.Checked || Currency.Check(user) >= (int)Window.Giveaway_MinCurrencyBox.Value) && (!checkfollow || !Window.Giveaway_MustFollow.Checked || Users.IsFollower(user)) && (!checksubscriber || !Window.Giveaway_MustSubscribe.Checked || Users.IsSubscriber(user)) && (!checktime || !Window.Giveaway_MustWatch.Checked || Users.CompareTimeWatched(user, new TimeSpan((int)Window.Giveaway_MustWatchHours.Value, (int)Window.Giveaway_MustWatchMinutes.Value, 0)) >= 0)); } public static string Roll(bool announce = true, bool checkusers = true) { - string winner = ""; + string winner = "", winnername = ""; Window.BeginInvoke((MethodInvoker)delegate { Window.Giveaway_RerollButton.Enabled = false; @@ -892,8 +909,10 @@ public static string Roll(bool announce = true, bool checkusers = true) while (true) { + //Console.WriteLine("[DEBUG] Starting roll..."); try { + //Console.WriteLine("[DEBUG] Validating users..."); List ValidUsers = new List(); if (!Custom) { @@ -907,11 +926,11 @@ public static string Roll(bool announce = true, bool checkusers = true) foreach (string user in ActiveUsers.Keys) { - //if (!ValidUsers.Contains(user) && RollTime - Chat.Users[user] <= ActiveTime && CheckUser(user, Chat.Users.Count < 100)) - //if (!ValidUsers.Contains(user) && GetUnixTimeNow() - Chat.Users[user] <= ActiveTime && CheckUser(user, Chat.Users.Count < 100)) - //if (!ValidUsers.Contains(user) && GetUnixTimeNow() - Chat.Users[user] <= Convert.ToInt32(Window.Giveaway_ActiveUserTime.Value) * 60 && CheckUser(user, Chat.Users.Count < 100)) - if (!ValidUsers.Contains(user) && Api.GetUnixTimeNow() - ActiveUsers[user] <= Convert.ToInt32(Window.Giveaway_ActiveUserTime.Value) * 60 && CheckUser(user, false)) - //if (!ValidUsers.Contains(user) && RollTime Chat.Users[user] <= ActiveTime && CheckUser(user, false, false)) + //if (!ValidUsers.Contains(user) && RollTime - Chat.Users[user] <= ActiveTime && CheckUser(user, true, Chat.Users.Count < 100)) + //if (!ValidUsers.Contains(user) && GetUnixTimeNow() - Chat.Users[user] <= ActiveTime && CheckUser(user, true, Chat.Users.Count < 100)) + //if (!ValidUsers.Contains(user) && GetUnixTimeNow() - Chat.Users[user] <= Convert.ToInt32(Window.Giveaway_ActiveUserTime.Value) * 60 && CheckUser(user, true, Chat.Users.Count < 100)) + if (!ValidUsers.Contains(user) && Api.GetUnixTimeNow() - ActiveUsers[user] <= Convert.ToInt32(Window.Giveaway_ActiveUserTime.Value) * 60 && CheckUser(user, true, false)) + //if (!ValidUsers.Contains(user) && RollTime Chat.Users[user] <= ActiveTime && CheckUser(user, true, false, false)) { ValidUsers.Add(user); @@ -928,9 +947,11 @@ public static string Roll(bool announce = true, bool checkusers = true) List Delete = new List(); foreach (string user in dUsers.Keys) { - //if (Chat.Users.ContainsKey(user) && CheckUser(user, Chat.Users.Count < 100)) - if (ActiveUsers.ContainsKey(user) && CheckUser(user, false)) + //Console.WriteLine("[DEBUG] Validating: " + user); + //if (Chat.Users.ContainsKey(user) && CheckUser(user, true, Chat.Users.Count < 100)) + if (ActiveUsers.ContainsKey(user) && CheckUser(user, true, false, false, false)) { + //Console.WriteLine("[DEBUG] " + user + " has been validated."); int entries = dUsers[user]; if (Window.Giveaway_SubscribersWinMultiplier.Checked && Users.IsSubscriber(user)) entries *= Convert.ToInt32(Window.Giveaway_SubscribersWinMultiplierAmount.Value); @@ -939,6 +960,7 @@ public static string Roll(bool announce = true, bool checkusers = true) } else { + //Console.WriteLine("[DEBUG] " + user + " has been disqualified."); Delete.Add(user); List delete = new List(); @@ -973,21 +995,26 @@ public static string Roll(bool announce = true, bool checkusers = true) } } } + //Console.WriteLine("[DEBUG] Validated all users."); OnRoll(ref ValidUsers); if (ValidUsers.Count > 0) { + //Console.WriteLine("[DEBUG] Rolling..."); winner = ValidUsers[new Random().Next(0, ValidUsers.Count)]; + //Console.WriteLine("[DEBUG] Winner: " + winner); if (!Custom) { if (checkusers) { + //Console.WriteLine("[DEBUG] Validating winner..."); List Ignore = new List(); while (!CheckUser(winner) || Ignore.Contains(winner)) { Ignore.Add(winner); winner = ValidUsers[new Random().Next(0, ValidUsers.Count)]; + //Console.WriteLine("[DEBUG] Winner disqualified, new winner: " + winner); } } @@ -1000,17 +1027,13 @@ public static string Roll(bool announce = true, bool checkusers = true) } Chance = (float)winnertickets / tickets * 100; } + //Console.WriteLine("[DEBUG] Final winner: " + winner); + //Console.WriteLine("[DEBUG] Updating UI..."); Window.BeginInvoke((MethodInvoker)delegate { - //string WinnerLabel = "Winner : "; - string WinnerLabel = ""; - if (Users.IsSubscriber(winner)) WinnerLabel += "Subscribing | "; - if (Users.IsFollower(winner)) WinnerLabel += "Following | "; - //WinnerLabel += Currency.Check(sWinner) + " " + Irc.currencyName + " | Watched : " + Users.GetTimeWatched(sWinner).ToString(@"d\d\ hh\h\ mm\m") + " | Chance : " + Chance.ToString("0.00") + "%"; - WinnerLabel += Currency.Check(winner) + " " + Currency.Name + " | Watched : " + Users.GetTimeWatched(winner).ToString(@"d\d\ hh\h\ mm\m"); - winner = Users.GetDisplayName(winner); - Window.Giveaway_WinnerStatusLabel.Text = WinnerLabel; - Window.Giveaway_WinnerLabel.Text = winner; + winnername = Users.GetDisplayName(winner, NameAlterLevel.Cosmetic); + Window.Giveaway_WinnerStatusLabel.Text = (Users.IsSubscriber(winner) ? "Subscribing | " : "") + (Users.IsFollower(winner) ? "Following | " : "") + Currency.Check(winner) + " " + Currency.Name + " | Watched : " + Users.GetTimeWatched(winner).ToString(@"d\d\ hh\h\ mm\m"); + Window.Giveaway_WinnerLabel.Text = winnername; Window.Giveaway_WinnerTimerLabel.ForeColor = Color.FromArgb(0, 200, 0); Window.Giveaway_WinTimeLabel.ForeColor = Color.FromArgb(0, 200, 0); Window.Giveaway_WinnerLabel.ForeColor = Color.Green; @@ -1024,15 +1047,16 @@ public static string Roll(bool announce = true, bool checkusers = true) { TimeSpan t = Users.GetTimeWatched(winner); //Chat.SendMessage(Users.GetDisplayName(winner) + " has won the giveaway! (" + (Users.IsSubscriber(winner) ? "Subscribes to the channel | " : "") + (Users.IsFollower(winner) ? "Follows the channel | " : "") + "Has " + Currency.Check(winner) + " " + Currency.Name + " | Has watched the stream for " + (int)Math.Floor(t.TotalHours) + " hours and " + t.Minutes + " minutes | Chance : " + Chance.ToString("0.00") + "%)"); - Chat.SendMessage(Users.GetDisplayName(winner) + " has won the giveaway! (" + (Users.IsSubscriber(winner) ? "Subscribes to the channel | " : "") + (Users.IsFollower(winner) ? "Follows the channel | " : "") + "Has " + Currency.Check(winner) + " " + Currency.Name + " | Has watched the stream for " + (int)Math.Floor(t.TotalHours) + " hours and " + t.Minutes + " minutes)"); + Chat.SendMessage(winnername + " has won the giveaway! (" + (Users.IsSubscriber(winner) ? "Subscribes to the channel | " : "") + (Users.IsFollower(winner) ? "Follows the channel | " : "") + "Has " + Currency.Check(winner) + " " + Currency.Name + " | Has watched the stream for " + (int)Math.Floor(t.TotalHours) + " hours and " + t.Minutes + " minutes)"); } + //Console.WriteLine("[DEBUG] UI updated."); }); thread = new Thread(() => { - winner = Users.GetDisplayName(winner, true); + winnername = Users.GetDisplayName(winner, NameAlterLevel.Cosmetic, true); Window.BeginInvoke((MethodInvoker)delegate { - Window.Giveaway_WinnerLabel.Text = winner; + Window.Giveaway_WinnerLabel.Text = winnername; }); }); thread.Name = "Use winner's (" + winner + ") display name"; @@ -1042,6 +1066,7 @@ public static string Roll(bool announce = true, bool checkusers = true) } catch { + //Console.WriteLine("[DEBUG] Error while attempting to roll."); Window.BeginInvoke((MethodInvoker)delegate { Console.WriteLine(Window.Giveaway_WinnerLabel.Text = "Error while rolling, retrying..."); @@ -1071,13 +1096,14 @@ private static void GiveawayQueueHandler(object state) { Chat.SendMessage("A total of " + dUsers.Count + " people joined the giveaway!"); - string finalmessage = ""; + string finalmessage = "Giveaway: "; lock (FalseEntries) { foreach (string user in FalseEntries.Keys) { - string name = Users.GetDisplayName(user); - string msg = "you have insufficient " + Currency.Name + ", you don't answer the requirements or the tickets amount you put is invalid"; + string name = Users.GetDisplayName(user, NameAlterLevel.Cosmetic); + //string msg = "you have insufficient " + Currency.Name + ", you don't answer the requirements or the tickets amount you put is invalid"; + string msg = "an issue has occurred, please try again"; if (FalseEntries[user] == 0) { msg = "the tickets amount you put is invalid"; @@ -1106,7 +1132,7 @@ private static void GiveawayQueueHandler(object state) if (finalmessage.Length + msg.Length > 996) { Chat.SendMessage(finalmessage); - finalmessage = ""; + finalmessage = "Giveaway: "; } finalmessage += name + ", " + msg + " (Warning: " + Users.Warnings[user] + "/3). "; } @@ -1116,14 +1142,14 @@ private static void GiveawayQueueHandler(object state) if (finalmessage.Length + msg.Length > 996) { Chat.SendMessage(finalmessage); - finalmessage = ""; + finalmessage = "Giveaway: "; } finalmessage += name + ", " + msg + ". "; } } FalseEntries.Clear(); - if (finalmessage != "") Chat.SendMessage(finalmessage); + if (finalmessage != "Giveaway: ") Chat.SendMessage(finalmessage); if (Window.Giveaway_TypeTickets.Checked && Api.GetUnixTimeNow() - LastAnnouncedTickets > 60) { @@ -1164,14 +1190,14 @@ public static void UserListHandler(object state) { string name = Users.GetDisplayName(user); - //if (!Chat.IgnoredUsers.Contains(user) && !Window.Giveaway_UserList.Items.Contains(name) && GetUnixTimeNow() - Chat.Users[user] <= Convert.ToInt32(Window.Giveaway_ActiveUserTime.Value) * 60 && CheckUser(user, Chat.Users.Count < 100)) Window.Giveaway_UserList.Items.Add(name); - if (!Chat.IgnoredUsers.Contains(user) && !Window.Giveaway_BanListListBox.Items.Contains(user) && !Window.Giveaway_UserList.Items.Contains(name) && Api.GetUnixTimeNow() - ActiveUsers[user] <= Convert.ToInt32(Window.Giveaway_ActiveUserTime.Value) * 60 && CheckUser(user, false)) Window.Giveaway_UserList.Items.Add(name); + //if (!Chat.IgnoredUsers.Contains(user) && !Window.Giveaway_UserList.Items.Contains(name) && GetUnixTimeNow() - Chat.Users[user] <= Convert.ToInt32(Window.Giveaway_ActiveUserTime.Value) * 60 && CheckUser(user, true, Chat.Users.Count < 100)) Window.Giveaway_UserList.Items.Add(name); + if (!Chat.IgnoredUsers.Contains(user) && !Window.Giveaway_BanListListBox.Items.Contains(user) && !Window.Giveaway_UserList.Items.Contains(name) && Api.GetUnixTimeNow() - ActiveUsers[user] <= Convert.ToInt32(Window.Giveaway_ActiveUserTime.Value) * 60 && CheckUser(user, true, false)) Window.Giveaway_UserList.Items.Add(name); } List delete = new List(); - //foreach (string user in Window.Giveaway_UserList.Items) if (!Chat.Users.ContainsKey(user.ToLower()) || GetUnixTimeNow() - Chat.Users[user.ToLower()] > Convert.ToInt32(Window.Giveaway_ActiveUserTime.Value) * 60 || !CheckUser(user, Chat.Users.Count < 100)) delete.Add(user); - foreach (string user in Window.Giveaway_UserList.Items) if (!ActiveUsers.ContainsKey(user.ToLower()) || Api.GetUnixTimeNow() - ActiveUsers[user.ToLower()] > Convert.ToInt32(Window.Giveaway_ActiveUserTime.Value) * 60 || !CheckUser(user, false)) delete.Add(user); + //foreach (string user in Window.Giveaway_UserList.Items) if (!Chat.Users.ContainsKey(user.ToLower()) || GetUnixTimeNow() - Chat.Users[user.ToLower()] > Convert.ToInt32(Window.Giveaway_ActiveUserTime.Value) * 60 || !CheckUser(user, true, Chat.Users.Count < 100)) delete.Add(user); + foreach (string user in Window.Giveaway_UserList.Items) if (!ActiveUsers.ContainsKey(user.ToLower()) || Api.GetUnixTimeNow() - ActiveUsers[user.ToLower()] > Convert.ToInt32(Window.Giveaway_ActiveUserTime.Value) * 60 || !CheckUser(user, true, false)) delete.Add(user); foreach (string user in delete) while (Window.Giveaway_UserList.Items.Contains(user)) Window.Giveaway_UserList.Items.Remove(user); @@ -1238,7 +1264,7 @@ public static void UserListHandler(object state) public static int GetMinCurrency() { return Giveaway.GetMinCurrency(); } - public static bool CheckUser(string user, bool checkfollow = true, bool checksubscriber = true, bool checktime = true) { return Giveaway.CheckUser(user, checkfollow, checksubscriber, checktime); } + public static bool CheckUser(string user, bool checkcurrency = true, bool checkfollow = true, bool checksubscriber = true, bool checktime = true) { return Giveaway.CheckUser(user, checkcurrency, checkfollow, checksubscriber, checktime); } public static string Roll(bool announce = true, bool checkusers = true) { return Giveaway.Roll(announce, checkusers); } diff --git a/CoMaNdO.Giveaways/GiveawaysWindow.cs b/CoMaNdO.Giveaways/GiveawaysWindow.cs index f7ff007..8a24367 100644 --- a/CoMaNdO.Giveaways/GiveawaysWindow.cs +++ b/CoMaNdO.Giveaways/GiveawaysWindow.cs @@ -302,7 +302,7 @@ public void GetSettings() } else if (KeyValue.Key.Equals("Giveaway_MustSubscribe")) { - Giveaway_MustSubscribe.Checked = (KeyValue.Value == "1" && Channel.IsPartnered); + Giveaway_MustSubscribe.Checked = (KeyValue.Value == "1" && Channel.HasSubProgram); } else if (KeyValue.Key.Equals("Giveaway_MustWatch")) { @@ -342,7 +342,7 @@ public void GetSettings() } else if (KeyValue.Key.Equals("Giveaway_SubscribersWinMultiplier")) { - Giveaway_SubscribersWinMultiplier.Checked = (KeyValue.Value == "1" && Channel.IsPartnered); + Giveaway_SubscribersWinMultiplier.Checked = (KeyValue.Value == "1" && Channel.HasSubProgram); } else if (KeyValue.Key.Equals("Giveaway_SubscribersWinMultiplierAmount")) { diff --git a/CoMaNdO.Giveaways/Properties/AssemblyInfo.cs b/CoMaNdO.Giveaways/Properties/AssemblyInfo.cs index c02e398..6f78213 100644 --- a/CoMaNdO.Giveaways/Properties/AssemblyInfo.cs +++ b/CoMaNdO.Giveaways/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.0.1")] +[assembly: AssemblyVersion("0.0.2")] //[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/CoMaNdO.Greetings/Greetings.cs b/CoMaNdO.Greetings/Greetings.cs index 9704932..d0947c4 100644 --- a/CoMaNdO.Greetings/Greetings.cs +++ b/CoMaNdO.Greetings/Greetings.cs @@ -24,9 +24,9 @@ public void Load() Settings.SetValue("Settings", "On", (On = (Settings.GetValue("Settings", "On", "0") == "1")) ? "1" : "0"); } - private void Events_Connected(string channel, string nick, bool partnered) + private void Events_Connected(string channel, string nick, bool partnered, bool subprogram) { - Commands.Add("!modbot", Command_ModBot, 0, 0); + Commands.Add(this, "!modbot", Command_ModBot, 0, 0); } private void Events_UserlistRefreshed(List joins, List leaves, bool initial) @@ -51,7 +51,7 @@ private void Events_UserAdded(string user, bool initial, bool FromReload) if (!initial && !FromReload && Channel.IsStreaming && On) Chat.SendMessage(Message.Replace("@user", user)); } - private void Command_ModBot(string user, string command, string[] args) + private void Command_ModBot(string user, Command cmd, string[] args) { if (args.Length > 0) { @@ -95,7 +95,7 @@ private void Command_ModBot(string user, string command, string[] args) public string Author { get { return "CoMaNdO"; } } public string UniqueID { get { return "CoMaNdO.Greetings"; } } public string ContactInfo { get { return "CoMaNdO.ModBot@gmail.com"; } } - public string Version { get { return "0.0.1"; } } + public string Version { get { return "0.0.2"; } } public int ApiVersion { get { return 0; } } public int LoadPriority { get { return 2; } } diff --git a/CoMaNdO.Greetings/Properties/AssemblyInfo.cs b/CoMaNdO.Greetings/Properties/AssemblyInfo.cs index 5637013..e931972 100644 --- a/CoMaNdO.Greetings/Properties/AssemblyInfo.cs +++ b/CoMaNdO.Greetings/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.0.1")] +[assembly: AssemblyVersion("0.0.2")] //[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/CoMaNdO.MultipleOutputs/MultipleOutputs.cs b/CoMaNdO.MultipleOutputs/MultipleOutputs.cs index 2f2bef5..00696d2 100644 --- a/CoMaNdO.MultipleOutputs/MultipleOutputs.cs +++ b/CoMaNdO.MultipleOutputs/MultipleOutputs.cs @@ -12,7 +12,7 @@ public class MultipleOutputs : IExtension public void Load() { - UI.AddWindow("Multiple Outputs", new MultipleOutputsWindow(this), false, false, false, false, "Multiple\r\nOutputs"); + UI.AddWindow("Multiple Outputs", new MultipleOutputsWindow(this), false, false, false, false, false, "Multiple\r\nOutputs"); } public string Name { get { return "Multiple Command Outputs"; } } diff --git a/CoMaNdO.MultipleOutputs/MultipleOutputsWindow.cs b/CoMaNdO.MultipleOutputs/MultipleOutputsWindow.cs index 1bffd35..5509725 100644 --- a/CoMaNdO.MultipleOutputs/MultipleOutputsWindow.cs +++ b/CoMaNdO.MultipleOutputs/MultipleOutputsWindow.cs @@ -89,34 +89,34 @@ private void CommandsDataGrid_Changed(object sender, EventArgs e) if (Chat.connection != null && Chat.connection.Connected) { - foreach (string command in dCommands.Keys) Commands.Add(command, Command_Custom); + foreach (string command in dCommands.Keys) Commands.Add(extension, command, Command_Custom); CommandsRegistered = true; } } } - private void Events_Connected(string channel, string nick, bool partnered) + private void Events_Connected(string channel, string nick, bool partnered, bool subprogram) { - if(!CommandsRegistered) foreach (string command in dCommands.Keys) Commands.Add(command, Command_Custom); + if (!CommandsRegistered) foreach (string command in dCommands.Keys) Commands.Add(extension, command, Command_Custom); - Commands.Add("!multipleoutputs", Command_MultipleOutputs, 2, 0); - Commands.Add("!mcp", Command_MultipleOutputs, 2, 0); + Commands.Add(extension, "!multipleoutputs", Command_MultipleOutputs, 2, 0); + Commands.Add(extension, "!mcp", Command_MultipleOutputs, 2, 0); CommandsRegistered = true; } - private void Command_Custom(string user, string command, string[] args) + private void Command_Custom(string user, Command cmd, string[] args) { try { - if (dCommands.ContainsKey(command.ToLower())) + if (dCommands.ContainsKey(cmd.Cmd.ToLower())) { - if (dCommands[command.ToLower()].Count == 0) return; + if (dCommands[cmd.Cmd.ToLower()].Count == 0) return; - Tuple cmd = dCommands[command.ToLower()][new Random().Next(0, dCommands[command.ToLower()].Count)]; - string output = cmd.Item3; + Tuple command = dCommands[cmd.Cmd.ToLower()][new Random().Next(0, dCommands[cmd.Cmd.ToLower()].Count)]; + string output = command.Item3; - if (cmd.Item1 != "" && cmd.Item2 != "") + if (command.Item1 != "" && command.Item2 != "") { bool found = false; using (SQLiteCommand query = new SQLiteCommand("SELECT * FROM 'userdata' WHERE user = '" + user + "' COLLATE NOCASE;", DB)) @@ -125,9 +125,9 @@ private void Command_Custom(string user, string command, string[] args) { while (r.Read()) { - if (r["user"].ToString().ToLower() == user.ToLower() && r["type"].ToString() == cmd.Item1) + if (r["user"].ToString().ToLower() == user.ToLower() && r["type"].ToString() == command.Item1) { - foreach (Tuple data in dCommands[command.ToLower()]) + foreach (Tuple data in dCommands[cmd.Cmd.ToLower()]) { if (data.Item2 == r["data"].ToString()) { @@ -137,7 +137,7 @@ private void Command_Custom(string user, string command, string[] args) } } - if (!found) using (SQLiteCommand query2 = new SQLiteCommand("DELETE FROM 'userdata' WHERE user = '" + user + "' AND type = '" + cmd.Item1.Replace("'", "''") + "' COLLATE NOCASE;", DB)) query2.ExecuteNonQuery(); + if (!found) using (SQLiteCommand query2 = new SQLiteCommand("DELETE FROM 'userdata' WHERE user = '" + user + "' AND type = '" + command.Item1.Replace("'", "''") + "' COLLATE NOCASE;", DB)) query2.ExecuteNonQuery(); break; } @@ -145,11 +145,11 @@ private void Command_Custom(string user, string command, string[] args) } } - if (!found) using (SQLiteCommand query = new SQLiteCommand("INSERT INTO 'userdata' (user, type, data) VALUES ('" + user + "', '" + cmd.Item1.Replace("'", "''") + "', '" + cmd.Item2.Replace("'", "''") + "');", DB)) query.ExecuteNonQuery(); + if (!found) using (SQLiteCommand query = new SQLiteCommand("INSERT INTO 'userdata' (user, type, data) VALUES ('" + user + "', '" + command.Item1.Replace("'", "''") + "', '" + command.Item2.Replace("'", "''") + "');", DB)) query.ExecuteNonQuery(); } output = output.Replace("@user", user); - output = output.Replace("@data", cmd.Item2); + output = output.Replace("@data", command.Item2); Chat.SendMessage(output); } @@ -161,7 +161,7 @@ private void Command_Custom(string user, string command, string[] args) } } - private void Command_MultipleOutputs(string user, string command, string[] args) + private void Command_MultipleOutputs(string user, Command cmd, string[] args) { try { diff --git a/CoMaNdO.Polls/Polls.cs b/CoMaNdO.Polls/Polls.cs index 5468604..1690ea5 100644 --- a/CoMaNdO.Polls/Polls.cs +++ b/CoMaNdO.Polls/Polls.cs @@ -14,7 +14,7 @@ public class Polls : IExtension public void Load() { - Poll.Load(); + Poll.Load(this); } public string Name { get { return "Polls"; } } @@ -22,7 +22,7 @@ public void Load() public string Author { get { return "CoMaNdO"; } } public string UniqueID { get { return "CoMaNdO.Polls"; } } public string ContactInfo { get { return "CoMaNdO.ModBot@gmail.com"; } } - public string Version { get { return "0.0.2"; } } + public string Version { get { return "0.0.3"; } } public int ApiVersion { get { return 0; } } public int LoadPriority { get { return 1; } } @@ -83,21 +83,24 @@ static class Poll public static bool ModsCanVote = true, SubsCanVote = true, UsersCanVote = true, AnnounceVotes, IsOpen; public static string Title = ""; public static System.Threading.Timer VotesQueue; + private static IExtension extension; public static event OnPollStart OnPollStart = ((int Cost, int Goal, int TotalGoal, List Options) => { }); public static event OnPollEnd OnPollEnd = ((string WinningOption, int Votes, EndReason Reason) => { }); - public static void Load() + public static void Load(IExtension sender) { + extension = sender; + //UI.AddWindow("Poll", new PollsWindow()); Events.Connected += Events_Connected; } - private static void Events_Connected(string channel, string nick, bool partnered) + private static void Events_Connected(string channel, string nick, bool partnered, bool subprogram) { - Commands.Add("!poll", Command_Poll, 0, 0); - Commands.Add("!vote", Command_Vote, 0, 0); + Commands.Add(extension, "!poll", Command_Poll, 0, 0); + Commands.Add(extension, "!vote", Command_Vote, 0, 0); /*string text = ""; for (int i = 0; i < Options.Count; i++) text += "(" + (i + 1) + ") " + Options[i] + ". "; @@ -106,13 +109,13 @@ private static void Events_Connected(string channel, string nick, bool partnered Chat.SendMessage("Poll voting options: " + text);*/ } - private static void Command_Poll(string user, string command, string[] args) + private static void Command_Poll(string user, Command cmd, string[] args) { if (args.Length > 0) { if (args[0].ToLower() == "vote" && args.Length > 1) { - Command_Vote(user, "!vote", new string[] { args[1] }); + Command_Vote(user, cmd, new string[] { args[1] }); return; } @@ -433,7 +436,7 @@ public static bool Vote(string user, string option, bool Announce = false) return false; } - private static void Command_Vote(string user, string command, string[] args) + private static void Command_Vote(string user, Command cmd, string[] args) { if (args.Length > 0) { diff --git a/CoMaNdO.Polls/Properties/AssemblyInfo.cs b/CoMaNdO.Polls/Properties/AssemblyInfo.cs index 587a7f3..5182130 100644 --- a/CoMaNdO.Polls/Properties/AssemblyInfo.cs +++ b/CoMaNdO.Polls/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.0.2")] +[assembly: AssemblyVersion("0.0.3")] //[assembly: AssemblyFileVersion("0.0.1")] diff --git a/CoMaNdO.SongRequests/SongRequests.cs b/CoMaNdO.SongRequests/SongRequests.cs index 01e8411..d62df2d 100644 --- a/CoMaNdO.SongRequests/SongRequests.cs +++ b/CoMaNdO.SongRequests/SongRequests.cs @@ -102,7 +102,7 @@ public static void Load(IExtension sender) Window = new SongRequestsWindow(extension); Window.SongRequestPlayer.Dispose(); - UI.AddWindow("Song Request", Window, true, false, false, false, "Song\r\nRequest"); + UI.AddWindow("Song Request", Window, true, false, false, false, false, "Song\r\nRequest"); Events.UI.Loaded += Events_OnUILoaded; Events.Connected += Events_Connected; @@ -123,17 +123,17 @@ private static void Events_OnUILoaded() Window.Controls.Add(Window.SongRequestPlayer); } - private static void Events_Connected(string channel, string nick, bool partnered) + private static void Events_Connected(string channel, string nick, bool partnered, bool subprogram) { - Commands.Add("!songrequest", Command_SongRequest, 0, 0); - //Commands.Add("!testsong", Command_TestSong, 0, 0); - //Commands.Add("!skipsong", Command_SkipSong, 0, 0); - //Commands.Add("!stopsong", Command_StopSong, 0, 0); + Commands.Add(extension, "!songrequest", Command_SongRequest, 0, 0); + //Commands.Add(extension, "!testsong", Command_TestSong, 0, 0); + //Commands.Add(extension, "!skipsong", Command_SkipSong, 0, 0); + //Commands.Add(extension, "!stopsong", Command_StopSong, 0, 0); //YouTube.PlaySong(); } - private static void Command_SongRequest(string user, string cmd, string[] args) + private static void Command_SongRequest(string user, Command cmd, string[] args) { if (args.Length > 0) { @@ -167,17 +167,17 @@ private static void Command_SongRequest(string user, string cmd, string[] args) } } - private static void Command_TestSong(string user, string cmd, string[] args) + private static void Command_TestSong(string user, Command cmd, string[] args) { PlaySong(); } - private static void Command_SkipSong(string user, string cmd, string[] args) + private static void Command_SkipSong(string user, Command cmd, string[] args) { VoteSkip(user); } - private static void Command_StopSong(string user, string cmd, string[] args) + private static void Command_StopSong(string user, Command cmd, string[] args) { StopSong(); } diff --git a/CoMaNdO.Uptime/Properties/AssemblyInfo.cs b/CoMaNdO.Uptime/Properties/AssemblyInfo.cs index 288904f..290a27e 100644 --- a/CoMaNdO.Uptime/Properties/AssemblyInfo.cs +++ b/CoMaNdO.Uptime/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.0.3")] +[assembly: AssemblyVersion("0.0.4")] //[assembly: AssemblyFileVersion("0.0.1")] diff --git a/CoMaNdO.Uptime/Uptime.cs b/CoMaNdO.Uptime/Uptime.cs index 34e3268..efe7b26 100644 --- a/CoMaNdO.Uptime/Uptime.cs +++ b/CoMaNdO.Uptime/Uptime.cs @@ -15,12 +15,12 @@ public void Load() Events.Connected += Events_Connected; } - private void Events_Connected(string channel, string nick, bool partnered) + private void Events_Connected(string channel, string nick, bool partnered, bool subprogram) { - Commands.Add("!uptime", Command_Uptime, 0, 300); + Commands.Add(this, "!uptime", Command_Uptime, 0, 300); } - private void Command_Uptime(string user, string command, string[] args) + private void Command_Uptime(string user, Command cmd, string[] args) { if (Channel.IsStreaming) { @@ -38,7 +38,7 @@ private void Command_Uptime(string user, string command, string[] args) public string Author { get { return "CoMaNdO"; } } public string UniqueID { get { return "CoMaNdO.Uptime"; } } public string ContactInfo { get { return "CoMaNdO.ModBot@gmail.com"; } } - public string Version { get { return "0.0.3"; } } + public string Version { get { return "0.0.4"; } } public int ApiVersion { get { return 0; } } public int LoadPriority { get { return 2; } } diff --git a/CoMaNdO.UserRanks/UserRanks.cs b/CoMaNdO.UserRanks/UserRanks.cs index 00d9b10..55d1e6f 100644 --- a/CoMaNdO.UserRanks/UserRanks.cs +++ b/CoMaNdO.UserRanks/UserRanks.cs @@ -31,12 +31,12 @@ public void Load() Events.Currency.OnQueue += Events_OnCurrencyQueue; } - private void Events_Connected(string channel, string nick, bool partnered) + private void Events_Connected(string channel, string nick, bool partnered, bool subprogram) { - Commands.Add("!ranks", Command_Ranks, 3, 0); + Commands.Add(this, "!ranks", Command_Ranks, 3, 0); } - private void Command_Ranks(string user, string command, string[] args) + private void Command_Ranks(string user, Command cmd, string[] args) { if (args.Length > 0) { diff --git a/ModBot Extensions.v12.suo b/ModBot Extensions.v12.suo index f4d0092..3f1bdfa 100644 Binary files a/ModBot Extensions.v12.suo and b/ModBot Extensions.v12.suo differ diff --git a/README.txt b/README.txt index 4ac8765..f84b9a1 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -Updated December 26th, 2014, up-to-date to version 1.7.5466.20465. +Updated January 27th, 2015, up-to-date to version 1.8.5505.15894. ModBot is designed to be a user-friendly bot for Twitch.TV, based heavily on LoyaltyBot. @@ -89,7 +89,7 @@ Custom commands: Example: !modbot addcmd 0 !welcome Welcome to the stream {1}! !welcome DorCoMaNdO Output: Welcome to the stream DorCoMaNdO! - * All of the parameters are required so a message will NOT be sent if you'd try to do something such as using just "!welcome" from the example above. + * All of the parameters are required so a message will NOT be sent if you'd try to do something such as using just "!welcome" on the example above. diff --git a/Todo.txt b/Todo.txt new file mode 100644 index 0000000..88503a0 --- /dev/null +++ b/Todo.txt @@ -0,0 +1 @@ +Add a financial minigame. \ No newline at end of file