priMELval

lottobot

Dec 16th, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.95 KB | None | 0 0
  1. //MCCScript 1.0
  2.  
  3. MCC.LoadBot(new LottoBot());
  4.  
  5. //MCCScript Extensions
  6.  
  7. /* The ChatBot class must be defined as an extension of the script in the Extensions section
  8.  * The class can override common methods from ChatBot.cs, take a look at MCC's source code
  9.  * I don't know what any of this means please send help */
  10.  
  11. public class LottoBot : ChatBot
  12. {
  13.    
  14.     int ticketCount = 0;
  15.     public override void Initialize()
  16.     {
  17.         LogToConsole("Sucessfully Initialized!");
  18.         SendText("/nick &6L&eotto&6B&eot");
  19.     }
  20.  
  21.     public override void GetText(string text)
  22.     {
  23.        
  24.         text = GetVerbatim(text);
  25.         Regex rgx1 = new Regex(@"^\[LOTTERY\] (.*) just bought");
  26.         Regex rgx2 = new Regex(@"^\[LOTTERY\] Congratulations go to");
  27.        
  28.         if (rgx1.IsMatch(text))
  29.         {
  30.             if(ticketCount == 0)
  31.             {
  32.                 SendText("/lot buy");
  33.             }
  34.             ticketCount++;
  35.            
  36.         }
  37.         else if(rgx2.IsMatch(text))
  38.         {
  39.            
  40.             ticketCount = 0;
  41.         }
  42.        
  43.        
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment