|
| Author |
Message |
Addict Not Yet a God

Joined: 21 Jan 2004 Posts: 473
   
|
Posted: Wed Apr 14, 2004 9:19 pm Post subject: |
|
|
I need a add contact command. For Elsif. So when I want to add someone to the bot all I got to do is type #add . And If I want to delete someone on the bots account all I got to do is type #delete and it deletes them.
Can Anyone Help Me Out??
Thanks B) |
|
| Back to top |
|
 |
..::BIGmouth( )::.. God Like

Joined: 05 Feb 2004 Posts: 801
    
|
Posted: Wed Apr 14, 2004 9:37 pm Post subject: |
|
|
I was checking out the msn.pm some other days and I think it is.
| Code: | | Adding:<br />$self->addcontact('$msg');<br /><br />removing:<br /><br />$self->remcontact('$msg'); |
so for andromeda it would be.
| Code: | | sub add<br />{<br /> my ($bot, $self, $user, $msg) = @_;<br /><br />$self->addcontact('$msg');<br /><br />return"$msg has been added";<br /><br />}<br /><br />{<br /><br />}; |
| Code: | | sub remove<br />{<br /> my ($bot, $self, $user, $msg) = @_;<br /><br />$self->remcontact('$msg');<br /><br />return"$msg has been removed";<br /><br />}<br /><br />{<br /><br />}; |
I think.  |
|
| Back to top |
|
 |
Addict Not Yet a God

Joined: 21 Jan 2004 Posts: 473
   
|
Posted: Wed Apr 14, 2004 9:47 pm Post subject: |
|
|
| It doesnt work... It kicks my bot offline! |
|
| Back to top |
|
 |
Myzterio Not Yet a God

Joined: 13 Dec 2003 Posts: 429
    
|
Posted: Wed Apr 14, 2004 10:03 pm Post subject: |
|
|
| what kinda template are you using o.O |
|
| Back to top |
|
 |
Myzterio Not Yet a God

Joined: 13 Dec 2003 Posts: 429
    
|
Posted: Wed Apr 14, 2004 10:08 pm Post subject: |
|
|
#add Command :
| Code: | | elsif ($msg=~/^\#add (.*)$/)<br />{<br />$self->sendmsg("$1 has been added");<br />$msn->add_contact($1);<br />} |
#delete Command :
| Code: | | elsif ($msg=~/^\#delete (.*)$/)<br />{<br />$self->sendmsg("$1 has been deleted");<br />$msn->rem_contact($1);<br />} |
|
|
| Back to top |
|
 |
Addict Not Yet a God

Joined: 21 Jan 2004 Posts: 473
   
|
Posted: Wed Apr 14, 2004 10:16 pm Post subject: |
|
|
ERROR:
| Quote: | | Can't Locate object method "add_contact" via "MSN" at C:\Bot Files\Bot Template\BotWorking.pl line 320, line 5. |
Line 320 is.
| Quote: | | $self->sendmsg("$1 has been added"); |
|
|
| Back to top |
|
 |
Mojave Almost An Agent

Joined: 01 Nov 2003 Posts: 1434
 
|
Posted: Wed Apr 14, 2004 11:12 pm Post subject: |
|
|
| What version of MSN.pm are you using? The add and rem contact methods have undergone some changes recently. You might have an old version. |
|
| Back to top |
|
 |
Addict Not Yet a God

Joined: 21 Jan 2004 Posts: 473
   
|
Posted: Wed Apr 14, 2004 11:44 pm Post subject: |
|
|
| I'm using the latest off this site. |
|
| Back to top |
|
 |
..::BIGmouth( )::.. God Like

Joined: 05 Feb 2004 Posts: 801
    
|
Posted: Thu Apr 15, 2004 1:30 am Post subject: |
|
|
Try using 'addcontact', and 'remcontact', instead of 'add_contact', 'rem_contact'.
| Code: | | elsif ($msg=~/^\#add (.*)$/)<br />{<br />$self->sendmsg("$1 has been added");<br />$msn->addcontact($1);<br />} |
| Code: | | elsif ($msg=~/^\#rem (.*)$/)<br />{<br />$self->sendmsg("$1 has been added");<br />$msn->remcontact($1);<br />} |
|
|
| Back to top |
|
 |
eric256 The Keymaker

Joined: 03 May 2006 Posts: 2292 Location: Colorado
     
|
Posted: Thu Apr 15, 2004 2:33 am Post subject: |
|
|
When telling us what version its much better to copy the version number that prints out when you ruin your bot. Since at any time a new MSN.pm could come out at any time and then your "latest" means nothing. _________________ Eric256
Proud previous owner and current admin of Bot-depot.com |
|
| Back to top |
|
 |
Addict Not Yet a God

Joined: 21 Jan 2004 Posts: 473
   
|
Posted: Thu Apr 15, 2004 2:59 am Post subject: |
|
|
| Eric, the version is MSN 1.3.10 BETA |
|
| Back to top |
|
 |
roadie Newbie

Joined: 12 Feb 2004 Posts: 48
   
|
Posted: Thu Apr 15, 2004 4:05 am Post subject: |
|
|
i want this command for morphious template im on the newest version of msn.pm hope that all helps  |
|
| Back to top |
|
 |
opdude Young One

Joined: 18 Feb 2004 Posts: 87
   
|
Posted: Thu Apr 15, 2004 12:10 pm Post subject: |
|
|
ok erm i had this problem before so i did a little editing to msn.pm
all i did basicaly was to change the list it adds to. So from FL to AL and it works i think its in the MSN.PM 1.3.12 BETA that Matt007 did
| Code: | | sub addcontact<br />{<br /> my $self = shift || croak(strMethodOnly);<br /> my $email = shift || carp("Need an email address to add") && return;<br /><br /> #print( "**** adding contact $email to AL list\n" );<br /><br /> return $self->_add_to_list('AL', $email);<br /><br /> my $client = $self->GetMaster();<br /> $client->{Lists}->{'AL'}->{$email} = 1;<br /> my $GUID = $client->{Groups}->{'Friends'};<br /> $client->send( "ADC", "AL N=$email F=$email $self->{'Groups'}->{'Friends'}" ) if $self->isVer('MSNP10');<br /> $client->send( "ADD", "AL $email $email 1") if $self->isVer('MSNP9');<br /><br /> return 1;<br />} |
|
|
| Back to top |
|
 |
Mojave Almost An Agent

Joined: 01 Nov 2003 Posts: 1434
 
|
Posted: Thu Apr 15, 2004 3:27 pm Post subject: |
|
|
QUOTE(opdude @ Apr 15 2004, 04:10 AM) all i did basicaly was to change the list it adds to. So from FL to AL and it works i think | The problem with that is that the AL and FL lists are two different things. AL is a list of emails you are allowing to contact you and FL is for emails that you want on your buddy list..
addcontact and remcontact are for maintaining your contact (buddy) list, not your allow list, so changing AL to FL would be very wrong. |