|
| Author |
Message |
StingRay Newbie

Joined: 27 Sep 2004 Posts: 22
  
|
Posted: Mon Nov 29, 2004 8:57 pm Post subject: |
|
|
This Is My First Ever MSN Bot I Have Made.
User Menu Contains:
| Code: | | !leet (Made By Art)<br /><br />!menu |
Mod Menu Contains:
Owner Menu Contains:
| Code: | | !owner menu<br /><br />!shutdown |
Download Bot: Download Now
Hope you like my first bot 
(Please note the instructions was wrote quickly)
Loads Of Thanks To Art For Helping Me.
(By The Way, Next One I Might Call EyeBot. |
|
| Back to top |
|
 |
Mojave Almost An Agent

Joined: 01 Nov 2003 Posts: 1434
 
|
Posted: Mon Nov 29, 2004 9:14 pm Post subject: |
|
|
Hmm, did you test this code at all?
In your bot.pl, how do you expect the code from lines 48-96 to ever get called? You have a while loop at the top that runs forever, so all the code below that (other than handlers) will never get called.
You're also using the send method from MSN.pm... why? |
|
| Back to top |
|
 |
farkie God Like

Joined: 15 Nov 2003 Posts: 673
   
|
Posted: Tue Nov 30, 2004 1:56 pm Post subject: |
|
|
i see you made the effort to put loads of commands in it then...1 command made by you..(maybe)..the code for that is:
|
|
| Back to top |
|
 |
Gavin God Like

Joined: 15 Mar 2004 Posts: 661 Location: Manchester, UK
    
|
Posted: Tue Nov 30, 2004 7:39 pm Post subject: |
|
|
You should really have double checked for errors....also the way to use:
| Code: | | &send($self, "message"); |
Is to create a sub like this:
| Code: | | sub send {<br /> my ($self,$response) = (shift,shift,shift);<br /> $self->sendmsg ("$response");<br />} |
You can't use it without the sub. _________________ MSN: gavin [at] gavinbrittain [dot] co [dot] uk
E-Portfolio: www.gavinbrittain.co.uk (New version comming soon) |
|
| Back to top |
|
 |
mat007 Almost An Agent

Joined: 12 Jan 2004 Posts: 1375
   votes: 2
|
Posted: Tue Nov 30, 2004 8:12 pm Post subject: |
|
|
Why are you shifting three times, also you dont need quotes around variables.
plus theres a send sub in Sub Message. |
|
| Back to top |
|
 |
Cer Upgraded Agent

Joined: 03 Feb 2004 Posts: 3776 Location: Michigan
  votes: 4
|
Posted: Tue Nov 30, 2004 8:27 pm Post subject: |
|
|
Yeah:
| Quote: | my ($self,$response) = (shift,shift,shift);
## Better Written As ##
my ($self,$response) = @_; |
Using individual shifts is best used if you're receiving static data, and then going to do something else with the rest... i.e.
| Code: | | # A method that sends an array of responses?<br />&send ($self,"Reply","another reply","yet another");<br /><br />sub send {<br /> my $self = shift;<br /> my (@replies) = @_;<br />}<br /><br /># A method sending a scalar and a hash.<br />&method ($self,<br /> Key => "value",<br /> key => "Value",<br />);<br /><br />sub method {<br /> my $self = shift;<br /> my %args = @_;<br />} |
_________________ Current Site (2008) http://www.cuvou.com/ |
|
| Back to top |
|
 |
alienz Almost An Agent

Joined: 22 Mar 2004 Posts: 1436 Location: Mars
 
|
Posted: Tue Nov 30, 2004 8:31 pm Post subject: |
|
|
Yeah...what Cer said while I was typing....LOL , and as Matt pointed out, you dont need quotes around a variable. Before you criticize someone else's code, you should learn more about it yourself. _________________ Check out Botworld! A dev resource for things bot.
Downloads, articles, news, fourm and more.
http://botworld.marzopolis.com |
|
| Back to top |
|
 |
Gavin God Like

Joined: 15 Mar 2004 Posts: 661 Location: Manchester, UK
    
|
Posted: Tue Nov 30, 2004 8:37 pm Post subject: |
|
|
I know it was just something I took from some old coding and edited. It was just an example not like the real how to do thing. _________________ MSN: gavin [at] gavinbrittain [dot] co [dot] uk
E-Portfolio: www.gavinbrittain.co.uk (New version comming soon) |
|
| Back to top |
|
 |
|