|
| Author |
Message |
BraveHeart Senior Member

Joined: 14 Jan 2004 Posts: 285
   
|
Posted: Thu Mar 04, 2004 8:11 pm Post subject: |
|
|
| Code: | | sub Join {<br /> my ($self,$user,$friendly) = @_;<br /> my $bot = $self->GetMaster->{bot} unless $bot->{msn}->unblock($blocky);<br />return"Banned user detected! Leaving convo!";<br /> <br /> # called whenever a users joins this conversation<br /> $self->sendmsg("Welcome to the conversation $user",Font => "Comic Sans MS", Color => '660066');<br />} |
Does anyone know whats wrong with this? |
|
| Back to top |
|
 |
Cer Upgraded Agent

Joined: 03 Feb 2004 Posts: 3776 Location: Michigan
  votes: 4
|
Posted: Thu Mar 04, 2004 8:31 pm Post subject: |
|
|
I'm assuming your problem is that the bot thinks everybody is a banned user?
That's because you have the "return" for banned uses on a line all by itself, when you're not even comparing it to anything. Try "return 'this message' if $they_are_blocked" or whatever. _________________ Current Site (2008) http://www.cuvou.com/ |
|
| Back to top |
|
 |
BraveHeart Senior Member

Joined: 14 Jan 2004 Posts: 285
   
|
Posted: Thu Mar 04, 2004 8:33 pm Post subject: |
|
|
OOOPS sorry,
the error i get is
| Quote: | Global symbol "$blocky" requires explicit package name at bot.pl line 47, line 1. Execution of bot.pl aborted due to compilation errors. |
|
|
| Back to top |
|
 |
..::BIGmouth( )::.. God Like

Joined: 05 Feb 2004 Posts: 801
    
|
Posted: Thu Mar 04, 2004 11:04 pm Post subject: |
|
|
| Code: | | ",Font => "Comic Sans MS", Color => "660066");<br />} |
You put, ' ' Instead of, " ". |
|
| Back to top |
|
 |
BraveHeart Senior Member

Joined: 14 Jan 2004 Posts: 285
   
|
Posted: Thu Mar 04, 2004 11:07 pm Post subject: |
|
|
thats nothing to do with it,
it was always like that
:rolleyes: |
|
| Back to top |
|
 |
MikeFairbrother Senior Member

Joined: 14 Feb 2004 Posts: 179 Location: United Kingdom
   
|
Posted: Fri Mar 05, 2004 9:31 am Post subject: |
|
|
could it be you need a space (bit in red)
Yours:
| Quote: | sub Join { my ($self,$user,$friendly) = @_; my $bot = $self->GetMaster->{bot} unless $bot->{msn}->unblock($blocky); return"Banned user detected! Leaving convo!"; # called whenever a users joins this conversation $self->sendmsg("Welcome to the conversation $user",Font => "Comic Sans MS", Color => '660066'); }
|
Could Be:
| Quote: | sub Join { my ($self,$user,$friendly) = @_; my $bot = $self->GetMaster->{bot} unless $bot->{msn}->unblock($blocky); return "Banned user detected! Leaving convo!"; # called whenever a users joins this conversation $self->sendmsg("Welcome to the conversation $user",Font => "Comic Sans MS", Color => '660066'); }
|
there was no space between return and the " _________________ Regards,
Mike |
|
| Back to top |
|
 |
eric256 The Keymaker

Joined: 03 May 2006 Posts: 2292 Location: Colorado
     
|
Posted: Fri Mar 05, 2004 3:58 pm Post subject: |
|
|
| Code: | | <br />my $bot = $self->GetMaster->{bot} unless $bot->{msn}->unblock($blocky);<br />return"Banned user detected! Leaving convo!";<br /> |
Read that in english. Set $bot = GetMaster->{bot} unless we unblock the users. Then regardless of what just happend return form here saying a banned user was detected. The two lines are not connected in any way so it will ALWAYS leave saying the user is blocked. You also used the variable $blocky which is not set equal to anything.
| Code: | | <br />my $bot = $self->GetMaster->{bot};<br />return"Banned user detected! Leaving convo!" if $bot->{msn}->{blocked}->{$blocky};<br /> |
I'm not sure that there is a blocked hash at all though so that may not work either. _________________ Eric256
Proud previous owner and current admin of Bot-depot.com |
|
| Back to top |
|
 |
|