Advertisement
Different55

Pingcheck for #CS

May 29th, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.99 KB | None | 0 0
  1. # This thing is supposed to sort the hash of nicks who have spoken by the number of lines they've
  2. # said, and then take every nick who has more than 200 lines (most nicks have less than 200 lines)
  3. # and if the line they just said contains one of those nicks, the person who wrote the var containing
  4. # the number of times he/she has pinged someone goes up.
  5.  
  6. $nick = "Takonub02"; # This is someone who talks a lot.
  7. $saying = "LOL NICK IS A NUB"; # This is something Tako has said.
  8.  
  9. %lines = ( # This is a hash of nicks and how many lines they've said.
  10.  "every", 1234,
  11.  "nick",  2345,
  12.  "in",    3456,
  13.  "#cs",    4567);
  14.  
  15. foreach my $lcount (sort {$lines{$b} cmp $lines{$a}} keys %lines) # This is a loop of some sort.
  16. {
  17.   if ($lcount < 100) # If you don't have more than 100 we don't care if you get pinged.
  18.   {
  19.     last;
  20.   }
  21.   else
  22.   {
  23.     if (index(lc(saying), lc($lines{$lcount})) != -1) # If someone's name was said
  24.     {
  25.       $ping{$nick}++; # Then nub just pinged someone.
  26.     }
  27.   }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement