Changeset 339 for trollforge/mao


Ignore:
Timestamp:
04/30/10 19:07:31 (3 years ago)
Author:
mao
Message:

.

Location:
trollforge/mao/dickbot
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • trollforge/mao/dickbot/dick.pl

    r337 r339  
    1111use AnyEvent::IRC::Client; 
    1212 
    13 my $nick = "DiCKbot"; 
    14 my $chan = "#flashsupport"; 
    15 my $server = "irc.buttes.org"; 
    16 my $prob = 50; # probability, in % 
     13my $nick = "fagot"; 
     14my $chan = "#gapp"; 
     15my $server = "irc.anonymuncule.com"; 
     16my $prob = 40; # probability, in % 
    1717 
    1818 
     
    3939      say $ch." - ".$offset." - ".$ind; 
    4040      push @positions, $ind; 
    41       last if ($offset+1 == $ind); 
     41      last if ($offset == $ind); 
    4242      $offset = $ind; 
    4343    } 
     
    8888      my ($self, $msg) = @_; 
    8989      my $from = $msg->{params}->[0]; 
    90       my @words = split " " => $msg->{params}->[-1]; 
     90      my @words = grep { length($_) > 4 } split " " => $msg->{params}->[-1]; 
     91      return if $#words < 0; 
    9192      my $rand = int(rand(100)); 
    9293      return unless ($rand%(100/$prob) == 0); 
    93       my $word = $words[rand @words]; 
     94      my $word = ""; 
     95      $word = $words[rand @words]; 
    9496      $client->send_chan($from, "PRIVMSG", $from, chlen_word($word)); 
    9597    }); 
     
    98100 
    99101$client->send_srv ("JOIN", $chan); 
    100 $client->send_chan ($chan, "PRIVMSG", $chan, "dickbot here"); 
     102#$client->send_chan ($chan, "PRIVMSG", $chan, "dickbot here"); 
    101103$client->connect ( 
    102104   $server, 6667, { nick => $nick, user => $nick, real => 'DICKBOT [HEAD] :: http://www.gnaa.eu/browser/trollforge/mao/dickbot' } 
Note: See TracChangeset for help on using the changeset viewer.