Advertisement
Auios

Untitled

Sep 7th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.12 KB | None | 0 0
  1.  
  2. if(isPackage(CopyCat))
  3.     deactivatePackage(CopyCat);
  4. package Copycat
  5. {
  6.     function CopyCat()
  7.     {
  8.         return new scriptObject()
  9.         {
  10.             class = CopyCat;
  11.             enabled = false;
  12.             victim = "";
  13.             lastMessage = "";
  14.  
  15.         };
  16.     }
  17.  
  18.     function CopyCat::HandleMessage(%this, %sender, %message)
  19.     {
  20.         if(!%this.enabled) return;
  21.  
  22.         if(%sender $= %this.victim)
  23.         {
  24.             if(%this.lastMessage !$= %message)
  25.             {
  26.                 commandToServer('messageSent', %message);
  27.             }
  28.             %this.lastMessage = %message;
  29.         }
  30.     }
  31.  
  32.     //Words are saved to file. Update the file when these next two methods are called
  33.     function CopyCat::AddGoodWord(%this, %word)
  34.     {
  35.  
  36.     }
  37.  
  38.     function CopyCat::AddBadWord(%this, %word)
  39.     {
  40.  
  41.     }
  42.  
  43.    
  44.  
  45.     function clientCmdChatMessage(%sender, %voice, %pitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10)
  46.     {
  47.         parent::clientCmdChatMessage(%sender, %voice, %pitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10);
  48.         $CopyCat.HandleMessage(%a2, %a4);
  49.     }
  50.  
  51.     //function test()
  52.     //{
  53.     //  if(strPos($chat, "Entity"))
  54.     //  {
  55.     //      echo("ok");
  56.     //  }
  57.     //}
  58. };
  59. activatePackage(CopyCat);
  60.  
  61. $CopyCat = CopyCat();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement