Changeset 386


Ignore:
Timestamp:
12/06/10 21:20:17 (2 years ago)
Author:
rucas
Message:

lol

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trollforge/rucas/flops.pl

    r385 r386  
    22use IO::Socket::INET; 
    33 
    4 our $server                     = "irc.hardchats.com"; 
     4our $server                     = "irc.encyclopediadramatica.com"; 
    55our $port                       = "6667"; 
    6 our $channel            = "#gnaa"; 
    7 our $nick                       = "TheLoRez"; 
     6our $channel            = "#freenode"; 
     7our $nick                       = "Drew2338"; 
    88our $phrases            = "autism.txt"; 
    9 our $chatdelay          = 500; #base chat delay, modified by "chattiness" of a channel 
     9our $chatdelay          = 1000; #base chat delay, modified by "chattiness" of a channel 
    1010our $delaymodifier      = 10; #time subtracted from chatdelay every time a line is chatted 
    1111 
     
    4444while ( my $input = <$sock> ) { 
    4545        chop $input; 
    46         print "-> $input\n"; 
     46        our $interval = ($chatdelay-(time()-$lastchat));         
     47        our $Hours = int($interval/3600); 
     48        our $Minutes = int(($interval - $Hours * 3600) / 60); 
     49        our $Seconds = $interval % 60; 
     50        print "-> [Delay: ".$Hours."h".$Minutes."m".$Seconds."s] ".$input."\n"; 
    4751        if ( $input =~ /^PING(.*)$/i ) { 
    4852                print $sock "PONG $1\r\n"; 
    49                 print "<- PONG $1 \r\n"; 
     53                print "<- PONG ".$1." \r\n"; 
    5054        } 
    5155        if ( $input !~ /freenode\/staff/ ) { 
     
    5862                                chop $randomline; 
    5963                                print "*** Replying to ".$chatter[0]." in ".$delay." seconds with '".$randomline."'.\r\n"; 
    60                                 print "*** ".time()+$delay-$lastchat." second delay since last chat.\r\n"; 
    6164                                sleep $delay; 
    6265                                print $sock "PRIVMSG ".$channel." :".$chatter[0].": ".$randomline."\r\n"; 
     
    6972        } 
    7073} 
     74 
Note: See TracChangeset for help on using the changeset viewer.