Explorar o código

'Most Actions' from Steve Tibold aka T0mcat

Morten Brix Pedersen %!s(int64=25) %!d(string=hai) anos
pai
achega
ddb55d18af
Modificáronse 2 ficheiros con 44 adicións e 0 borrados
  1. 8 0
      lang.txt
  2. 36 0
      pisg.pl

+ 8 - 0
lang.txt

@@ -25,6 +25,10 @@ mostop1 = "<b>[:nick]</b> donated [:ops] ops in the channel..."
 mostop2 = "<b>[:nick]</b> was also very polite: [:ops] from her/him"
 mostop2 = "<b>[:nick]</b> was also very polite: [:ops] from her/him"
 mostop3 = "Strange, no op was given on [:channel]!"
 mostop3 = "Strange, no op was given on [:channel]!"
 
 
+action1 = "<b>[:nick]</b> always lets us know what he/she is doing: [:actions] actions!"
+action2 = "Also <b>[:nick]</b> tells us what's up with [:actions]"
+action3 = "No actions in [:channel] !"
+
 mostdeop1 = "<b>[:nick]</b> is the channel sheriff with [:deops] deops..."
 mostdeop1 = "<b>[:nick]</b> is the channel sheriff with [:deops] deops..."
 mostdeop2 = "<b>[:nick]</b> deoped [:deops] users"
 mostdeop2 = "<b>[:nick]</b> deoped [:deops] users"
 mostdeop3 = "Wow, no op was taken on [:channel]!"
 mostdeop3 = "Wow, no op was taken on [:channel]!"
@@ -229,6 +233,10 @@ mostop1 = "<b>[:nick]</b> gav [:ops] op status i kanalen..."
 mostop2 = "<b>[:nick]</b> var også venlig at gi': [:ops] fra sig"
 mostop2 = "<b>[:nick]</b> var også venlig at gi': [:ops] fra sig"
 mostop3 = "Underligt, ingen har fået op på [:channel] endnu!"
 mostop3 = "Underligt, ingen har fået op på [:channel] endnu!"
 
 
+action1 = "<b>[:nick]</b> bruger /me meget tit, ialt [:actions] gange!"
+action2 = "Also <b>[:nick]</b> fortæller os også hvad han laver.. [:actions] /me's"
+action3 = "Ingen /me's i [:channel] !"
+
 mostdeop1 = "<b>[:nick]</b> holder orden på [:channel] med [:deops] deops..."
 mostdeop1 = "<b>[:nick]</b> holder orden på [:channel] med [:deops] deops..."
 mostdeop2 = "<b>[:nick]</b> deoppede [:deops] brugere"
 mostdeop2 = "<b>[:nick]</b> deoppede [:deops] brugere"
 mostdeop3 = "Hmm, der var ingen som fik op på [:channel]!"
 mostdeop3 = "Hmm, der var ingen som fik op på [:channel]!"

+ 36 - 0
pisg.pl

@@ -532,6 +532,7 @@ sub parse_file
 
 
             unless (grep /^\Q$nick\E$/i, @ignore) {
             unless (grep /^\Q$nick\E$/i, @ignore) {
                 $actions++;
                 $actions++;
+                $actions{$nick}++;
                 $line{$nick}++;
                 $line{$nick}++;
                 $line_time{$nick}[int($hour/6)]++;
                 $line_time{$nick}[int($hour/6)]++;
 
 
@@ -1066,6 +1067,7 @@ sub create_html
     gotkicks();
     gotkicks();
     mostkicks();
     mostkicks();
     mostop();
     mostop();
+    mostactions();
     mostmonologues();
     mostmonologues();
     mostjoins();
     mostjoins();
     mostfoul();
     mostfoul();
@@ -1995,6 +1997,40 @@ sub mostop
     }
     }
 }
 }
 
 
+sub mostactions
+{
+
+    # The person who did the most /me's
+
+    my @actions = sort { $actions{$b} <=> $actions{$a} } keys %actions;
+
+    if (@actions) {
+        my %hash = (
+            nick => $actions[0],
+            actions => $actions{$actions[0]}
+        );
+
+        my $text = template_text('action1', %hash);
+        html("<tr><td bgcolor=\"$conf->{hicell}\">$text");  
+
+        if (@actions >= 2) {
+            my %hash = (
+                nick => $actions[1],
+                actions => $actions{$actions[1]}
+            );
+
+            my $text = template_text('action2', %hash);
+            html("<br><span class=\"small\">$text</span>");
+        }
+        html("</td></tr>");
+    } else {
+        my $text = template_text('action3');
+        html("<tr><td bgcolor=\"$conf->{hicell}\">$text</td></tr>");
+    }
+
+}
+
+
 sub mostsmiles
 sub mostsmiles
 {
 {
     # The person(s) who smiled the most :-)
     # The person(s) who smiled the most :-)