User Control Panel
Advertisements

HELP US, HELP YOU!

I need help... I'm a total newbie...

 
Post new topic   Reply to topic    Bot Depot Forum Index -> AIM Protocol & questions
View unanswered posts
Author Message
Hollowe
Newbie
Newbie


Joined: 13 Dec 2003
Posts: 4

Reputation: 29.3Reputation: 29.3Reputation: 29.3

PostPosted: Sat Dec 13, 2003 5:14 am    Post subject: Reply with quote

If possible.. can you just go through the basic commands that you can input through the IM window? How do you make yourself have admin access? These things I want to know.... and when you make the reply:
Code:
<br />/addreply blah||blahblah<br />


How can you make more than one reply, or more than one user-input at a time? Can you guys help me out?
Back to top
Tony_shu
God Like
God Like


Joined: 12 Nov 2003
Posts: 624

Reputation: 42.9Reputation: 42.9Reputation: 42.9Reputation: 42.9

PostPosted: Sat Dec 13, 2003 7:43 am    Post subject: Reply with quote

Finally...I think I can help someone...lets see if I've learned anything from the great ones from this site...like Eric, Keenie, Mojave, Nate Very Happy

Personally...I prefer *.txt files to list all the input-output relations.
In data.txt you can list (input1|input2)][output1|output2
Quote:
(hi|hey|yo)][Hey...I'm BOT|Waats up|How's it going
(bye|later|peace)][bye|see ya|later

Symbols like '|' are understood by perl to be "or" characters
Also...if you use "^" in beginning and/or "$" at the end of the (input)...that will tell the bot to find the inputs at the beginning of a message (^) or at the end of a message ($)
Quote:
^(Hey|Hi)][Hey ... will tell the bot to look for either input at the beginning of a message
(Hey|Hi)$][Hey ... will tell the bot to look for either input at the end of a message
^(Hey|Hi)$][Hey ... will tell the bot to look for either input to be the only part of a message
(Hey|Hi)][Hey ... will tell the bot to look for either input anywhere in a message

Use this in the beginnings of commands you want for admins only.
Code:
#Asks if this is an admin-only command? (1 for yes, 0 for no).<br />my $adminonly = 1;<br /><br />#Retrieves the admin's screenname.<br />open (FILE, "admin.txt");<br />my @admin = <FILE>;<br />close(FILE);<br />chomp @admin;<br /><br />my $is_admin = 0;<br /><br />foreach my $admin (@admin) {<br /> if ($victim eq $admin) {<br />  $is_admin = 1;<br />  break;<br /> }<br />}


This is a good working command.pl
Code:
sub commands {<br /><br />  #Retrieves the victim and the message.<br />  my $victim = shift;<br />  my $msg = shift;<br />  my $aim = shift;<br /><br />  #Resets the default values.<br />  my $reply = "";<br />  my $command = 0;<br /><br />  #Checks the message against the list of commands.<br />  opendir(DIR, "commands");<br />  foreach my $file (sort(grep(/\.pl$/, readdir(DIR)))) {<br />      $file =~ s/\.(.*)$//g;<br />      if ($command == 0) {<br />          if ($msg =~ /^\/$file/i) {<br />              $command = 1;<br />              $reply = &{$file}($victim,$msg,$aim);<br /><br />         } <br />      }<br />  }<br />  closedir(DIR);<br /><br />  #If the reply hasn't been set from a command, it isn't a command.<br />  if ($reply eq "" && $command == 0) {<br />      $reply = "This was not a command.";<br />  }<br /><br />  #Give back a boolean and the reply.<br />  return $command,$reply;<br />}<br />1;

Thats all I can think of for now...other than if you downloaded some bot template like wiredbots or ezbot...most of the setup should be there.

_________________
Anthony Arslan
@-Squared Enterprises
MacroHard Corporation
Back to top
Nate
God Like
God Like


Joined: 12 Nov 2003
Posts: 553

Reputation: 41.3Reputation: 41.3Reputation: 41.3Reputation: 41.3

PostPosted: Sat Dec 13, 2003 1:30 pm    Post subject: Reply with quote

And as for the addreply command (/addreply blah||blah blah):

Code:
sub addreply {<br />     my ($victim,$msg) = (shift,shift);<br /><br />     # Cut off the "/addreply" part.<br />     $msg =~ s/\/addreply //ig;<br /><br />     # Split the message at the two pipes.<br />     my ($in,$out) = split(/\|\|/, $msg);<br /><br />     # See if this reply already exists. If so, we'll<br />     # add the new reply as a random response.<br />     open (EXIST, "./data.txt");<br />     my @existing_replies = <EXIST>;<br />     close (EXIST);<br /><br />     my $found = 0;<br />     my $final; #Will store all the replies later.<br />     foreach $line (@existing_replies) {<br />          chomp $line;<br />          my ($line_in,$line_out) = split(/\]\[/, $line);<br />          if ($line_in =~ /^$in$/i) {<br />               $found = 1;<br />               $line .= "|$out"; #Add a random reply<br />          }<br />          $final .= "$line\n";<br />     }<br /><br />     # If we didn't quite match this reply yet...<br />     if ($found == 0) {<br />          # Add a new line.<br />          open (NEW, ">>./data.txt");<br />          print NEW "\n$in][$out";<br />          close (NEW);<br /><br />          $reply = "Thanks, I've learned something new!";<br />     }<br />     # If we did find a reply (and added a new random response)<br />     else {<br />          # Rewrite the data with the line changed.<br />          open (NEW, ">./data.txt");<br />          print NEW $final;<br />          close (NEW);<br /><br />          $reply = "Thanks, I've learned a new way to reply to that!";<br />     }<br /><br />     return $reply;<br />}<br />1;
Back to top
Hollowe
Newbie
Newbie


Joined: 13 Dec 2003
Posts: 4

Reputation: 29.3Reputation: 29.3Reputation: 29.3

PostPosted: Sat Dec 13, 2003 5:29 pm    Post subject: Reply with quote

Ok.... thanks guys... but I haven't a clue to the admin command... Like the away function, It is admin only... what is the command to gain access? Where do I put the password?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> AIM Protocol & questions 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