# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1250122502 18000 # Node ID 8f209cd0a7b6aa0742c331e996f047e03f8053aa # Parent 64eeadb2736273427108996b6160175a48231136 Delay according to theoros's algorithm diff --git a/teh-lol.pl b/teh-lol.pl --- a/teh-lol.pl +++ b/teh-lol.pl @@ -17,6 +17,8 @@ Xchat::hook_print('Channel Message', \&check_lol); +use Time::HiRes; + my %timestamp; sub check_lol { @@ -45,7 +47,13 @@ ) { #Delay the response a little, for maximum annoyance. - sleep (rand(3)+2); + #( theoros's algorithm from #not-math ) + my $delay = 0.8; + if (length($relol) > 3){ + $delay += ((length $relol) - 3 + rand(5)) * 0.069; + } + + Time::HiRes::usleep($delay); Xchat::command("say $relol"); }