Changeset 386
- Timestamp:
- 12/06/10 21:20:17 (2 years ago)
- File:
-
- 1 edited
-
trollforge/rucas/flops.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trollforge/rucas/flops.pl
r385 r386 2 2 use IO::Socket::INET; 3 3 4 our $server = "irc. hardchats.com";4 our $server = "irc.encyclopediadramatica.com"; 5 5 our $port = "6667"; 6 our $channel = "# gnaa";7 our $nick = " TheLoRez";6 our $channel = "#freenode"; 7 our $nick = "Drew2338"; 8 8 our $phrases = "autism.txt"; 9 our $chatdelay = 500; #base chat delay, modified by "chattiness" of a channel9 our $chatdelay = 1000; #base chat delay, modified by "chattiness" of a channel 10 10 our $delaymodifier = 10; #time subtracted from chatdelay every time a line is chatted 11 11 … … 44 44 while ( my $input = <$sock> ) { 45 45 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"; 47 51 if ( $input =~ /^PING(.*)$/i ) { 48 52 print $sock "PONG $1\r\n"; 49 print "<- PONG $1\r\n";53 print "<- PONG ".$1." \r\n"; 50 54 } 51 55 if ( $input !~ /freenode\/staff/ ) { … … 58 62 chop $randomline; 59 63 print "*** Replying to ".$chatter[0]." in ".$delay." seconds with '".$randomline."'.\r\n"; 60 print "*** ".time()+$delay-$lastchat." second delay since last chat.\r\n";61 64 sleep $delay; 62 65 print $sock "PRIVMSG ".$channel." :".$chatter[0].": ".$randomline."\r\n"; … … 69 72 } 70 73 } 74
Note: See TracChangeset
for help on using the changeset viewer.
