Advertisement
Guest User

Test_Console_NPC.pl

a guest
Sep 2nd, 2013
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.33 KB | None | 0 0
  1. ##Written by: Kingly_Krab
  2. ##NOTE: Must have global_player.pl for all of my scripts.
  3. sub EVENT_SAY
  4. {
  5.     if($text=~/Hail/i)
  6.     {
  7.         plugin::Whisper("I have 4 settings.");
  8.         plugin::Whisper("You can say 'Announcement' then some text,");
  9.         plugin::Whisper("'Warning' then some text,");
  10.         plugin::Whisper("'Message' then some text,");
  11.         plugin::Whisper("Or 'Error' then some text.");
  12.     }
  13.     if($text=~/^Announcement/i)
  14.     {
  15.         my @announcesplit = split / /, substr($text, 13);
  16.         my @wordarray = ();
  17.         foreach $word (@announcesplit)
  18.         {
  19.             push(@wordarray, $word);
  20.         }
  21.         quest::we(327, "Server Announcement sent by $name: @wordarray");
  22.     }
  23.     if($text=~/^Warning/i)
  24.     {
  25.         my @warningsplit = split / /, substr($text, 8);
  26.         my @wordarray = ();
  27.         foreach $word (@warningsplit)
  28.         {
  29.             push(@wordarray, $word);
  30.         }
  31.         quest::we(331, "Server Warning sent by $name: @wordarray");
  32.     }
  33.     if($text=~/^Message/i)
  34.     {
  35.         my @messagesplit = split / /, substr($text, 8);
  36.         my @wordarray = ();
  37.         foreach $word (@messagesplit)
  38.         {
  39.             push(@wordarray, $word);
  40.         }
  41.         quest::we(335, "Server Message sent by $name: @wordarray");
  42.     }
  43.     if($text=~/^Error/i)
  44.     {
  45.         my @errorsplit = split / /, substr($text, 6);
  46.         my @wordarray = ();
  47.         foreach $word (@errorsplit)
  48.         {
  49.             push(@wordarray, $word);
  50.         }
  51.         quest::we(342, "Server Error sent by $name: @wordarray");
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement