changeset 23:77444d749997

Use more meaningful variables names because jlf complained
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Thu, 08 Sep 2011 14:29:31 -0500
parents 8ebcdfa03782
children 15b72cc602b4
files teh-lol.pl
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/teh-lol.pl
+++ b/teh-lol.pl
@@ -28,6 +28,8 @@
 my %timestamp;
 
 sub update_tstamp{
+  my @xchat_args = $_[0];
+  my $msg = $xchat_args[1];
   if( $_[0][1] eq "lol" ){
     my $chan = Xchat::get_info("channel");
     $timestamp{$chan} = time;
@@ -46,14 +48,18 @@
 }
 
 sub check_lol {
+  my @xchat_args = $_[0];
+  my $chatter = $xchat_args[0];
+  my $msg = $xchat_args[1];
+
   my $chan = Xchat::get_info("channel");
   my $timesince_lasttalk = time - Xchat::user_info -> {'lasttalk'};
 
   ## Chatter name without possible colour codes
-  my $chatter = Xchat::strip_code($_[0][0]);
+  $chatter = Xchat::strip_code($chatter);
 
   #Match stuff like "lol", "loool" and "lololol"
-  if ($_[0][1] =~ /\b(l((o|(?<!l)lo)+)l)\b/i
+  if ($msg =~ /\b(l((o|(?<!l)lo)+)l)\b/i
 
       #Two minutes of not saying anything in the channel counts as
       #idling, so don't pester when idling.
@@ -109,8 +115,10 @@
 
 sub check_combo {
   my $chan = Xchat::get_info("channel");
+  my $loller = $_[0][0];
   my $msg = $_[0][1];
   my $islol = $msg =~ /^\s*l((o|(?<!l)lo)+)l\b/i;
+
   if(not $islol) {
     my $combo = $combo_count{$chan};
 
@@ -144,8 +152,6 @@
     $prev_loller{$chan} = "";
   }
   else {
-    my $loller = $_[0][0];
-
     #A loller trying to cheat ruins the combo for everyone
     if( $loller eq $prev_loller{$chan}) {
       $combo_count{$chan} = 0;