User Control Panel
Advertisements

HELP US, HELP YOU!

Creating Responses, and adding more Features..

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Perl
View unanswered posts
Author Message
Tmoon
Newbie
Newbie


Joined: 11 Dec 2003
Posts: 25

Reputation: 29.8Reputation: 29.8Reputation: 29.8

PostPosted: Sat Dec 13, 2003 3:34 pm    Post subject: Reply with quote

Well FINALLY!!! i got the bot working.. but the thing is that seeing he is just a plain bot he has no real good responses ive added a couple but like i want to learn how to make him say other things if a user says something so he willr econize it... Such as "Hey, bot whats up" bot will say "Hello, The sky is up" ect.... If anyone can help please do so.... in bot.pl heres what it says after sub reply
Code:
sub reply {<br />    my $victim = shift;<br />    my $msg = shift;<br />    my $test = "";<br />    my $temp = "";<br />    my $reply = "";<br />    print "Formating reply!!!\n";<br />    if( !defined $Replies )<br />    {<br />          &loadReplies();<br />    }<br /><br />    foreach $test (@$Replies)<br />        {<br />            $temp = $test->{Regex};<br />            if ( $msg =~ /$temp/i ) {<br />                $reply = $test->{Responce};<br />                my $one = $1 unless !defined($1);   #define the variable so that we can use them in<br />                my $two = $2 unless !defined($2);   #the responce files<br />                my $three = $3 unless !defined($3);<br />                my $four = $4 unless !defined($4);<br />                my $five = $5 unless !defined($5);<br />                my $six = $6 unless !defined($6);<br />                my $seven = $7 unless !defined($7);<br />                my $eight = $8 unless !defined($8);<br />                my $nine = $9 unless !defined($9);<br /><br />                #print $reply ."\n";<br />                while ($reply =~ /\@(.+?) / || $reply =~ /\{\@(.+?)\}/) #process named lists in { } and out<br />                {<br />                    $reply =~ s/(\@(.+?)) /JoinEM(0, $ListHash->{$2}) ." "/ige;<br />                    $reply =~ s/(\{\@(.+?)\})/JoinEM(0, $ListHash->{$2})/ige;<br />                }<br />                #print $reply ."\n";<br />                $reply =~ s/\((.*?\|.*?)\)/pick_one($1)/eg;     #process unnamed lists<br /><br />                my @tosay = split(/\|/,$reply);             #break apart multiple responces seperated by<br />                $reply = $tosay [ int(rand(scalar(@tosay))) ];      #randomly pick one<br /><br />                $reply =~ s/\$1/$one/g unless !defined($one);       #insert in the variables<br />                $reply =~ s/\$2/$two/g unless !defined($two);<br />                $reply =~ s/\$3/$three/g unless !defined($three);<br />                $reply =~ s/\$4/$four/g unless !defined($four);<br />                $reply =~ s/\$5/$five/g unless !defined($five);<br />                $reply =~ s/\$6/$six/g unless !defined($six);<br />                $reply =~ s/\$7/$seven/g unless !defined($seven);<br />                $reply =~ s/\$8/$eight/g unless !defined($eight);<br />                $reply =~ s/\$9/$nine/g unless !defined($nine);<br /><br />                $reply =~ s/\%sn/$victim/gs;<br />                $reply =~ s/(?<!\/)\<\%(.*)\%\>/$1/eeig;<br />                $msg = "";<br />                last;                   # we found a match. stop looking<br />                }<br />        if ($msg eq "") {last;}<br />        }<br />    return $reply;<br />}
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Perl All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group