|
| Author |
Message |
Drayshak Young One

Joined: 06 Jan 2004 Posts: 93 Location: Nottinghamshire, UK
      votes: 4
|
Posted: Sat Jan 24, 2004 8:41 pm Post subject: |
|
|
i got this far
| Quote: | sub reloadname { my ($bot, $self, $user, $msg) = @_; my $user_settings = $bot->{users}->{$user}; my $msn = $bot->{msn}; my $settings = $bot->{settings};
my @rl_list = $bot->{'msn'}->getlist( 'RL' ); my $rl_count = scalar @rl_list; my $rl_list = join( ',', @rl_list ); my @al_list = $bot->{'msn'}->getlist( 'AL' ); my $al_count = scalar @al_list; my $al_list = join( ',', @al_list ); my @fl_list = $bot->{'msn'}->getlist( 'FL' ); my $fl_count = scalar @fl_list; my $fl_list = join( ',', @fl_list ); { $self->set_name(" K a P o K s B o T {Type !chat To Come To Chat} {< ) Now With $al_count Amount Of Users < )}");
}
{ Description => "Reloads The Contact Number In Nickname", Category => "System" };
|
when i run it, !reloadname it comes up with the error
| Quote: | | Undefined subroutine &MSN::Bot::reloadname called at lib/msn/bot.pm line 178 line 7 |
first of all i have no idea what that means 2nd of all i dont know whats wrong with it!! itll probably summat very simple |
|
| Back to top |
|
 |
zander God Like

Joined: 14 Jan 2004 Posts: 540 Location: england
 
|
Posted: Sat Jan 24, 2004 8:46 pm Post subject: |
|
|
| first off all whats it supposed to do and second of all it is sumin in your bot.pm like an error |
|
| Back to top |
|
 |
Keenie Almost An Agent

Joined: 31 Oct 2003 Posts: 1071
 
|
Posted: Sat Jan 24, 2004 9:33 pm Post subject: |
|
|
the the first obvious thing is if you want the ammount of users you shouldnt be using $al_list, but $al_count
other than that make sure you name the file reloadname.pl and try escaping some of the characters in the name it sets, like )({}><, so a ")" becomes "\)" |
|
| Back to top |
|
 |
Drayshak Young One

Joined: 06 Jan 2004 Posts: 93 Location: Nottinghamshire, UK
      votes: 4
|
Posted: Sat Jan 24, 2004 9:52 pm Post subject: |
|
|
| its meant to show the amount of *lazy* in *lazy* nick when *lazy* do it so 1 day *lazy* have 56 in it, *lazy* reload it and it now shows the current number, 78 |
|
| Back to top |
|
 |
Keenie Almost An Agent

Joined: 31 Oct 2003 Posts: 1071
 
|
Posted: Sat Jan 24, 2004 9:56 pm Post subject: |
|
|
| Quote: | my @al_list = $bot->{'msn'}->getlist( 'AL' ); my $al_count = scalar @al_list; my $al_list = join( ',', @al_list |
read the names of the variables, which would do you think has the count of the AL |
|
| Back to top |
|
 |
Drayshak Young One

Joined: 06 Jan 2004 Posts: 93 Location: Nottinghamshire, UK
      votes: 4
|
Posted: Sat Jan 24, 2004 9:58 pm Post subject: |
|
|
| i changed it to count and its still not working :'( |
|
| Back to top |
|
 |
Mojave Almost An Agent

Joined: 01 Nov 2003 Posts: 1434
 
|
Posted: Sat Jan 24, 2004 10:25 pm Post subject: |
|
|
You weren't ending the command code block. Try this:
| Code: | | sub reloadname {<br /> my ($bot, $self, $user, $msg) = @_;<br /> my $user_settings = $bot->{users}->{$user};<br /> my $msn = $bot->{msn};<br /> my $settings = $bot->{settings};<br /><br />my @rl_list = $bot->{'msn'}->getlist( 'RL' );<br />my $rl_count = scalar @rl_list;<br />my $rl_list = join( ',', @rl_list );<br />my @al_list = $bot->{'msn'}->getlist( 'AL' );<br />my $al_count = scalar @al_list;<br />my $al_list = join( ',', @al_list );<br />my @fl_list = $bot->{'msn'}->getlist( 'FL' );<br />my $fl_count = scalar @fl_list;<br />my $fl_list = join( ',', @fl_list );<br /><br />$self->set_name(":) K a P o K s B o T {Type !chat To Come To Chat} {<:o) Now With $al_count Amount Of Users <:o)}");<br />}<br /><br />{<br /> Description => "Reloads The Contact Number In Nickname",<br /> Category => "System"<br />}; |
|
|
| Back to top |
|
 |
eric256 The Keymaker

Joined: 03 May 2006 Posts: 2292 Location: Colorado
     
|
Posted: Sat Jan 24, 2004 10:28 pm Post subject: |
|
|
| Code: | | <br />my $fl_list = join( ',', @fl_list );<br />{<br /> $self->set_name(":) K a P o K s B o T <br /> |
That { up there is extra. Remove it and you shouldn't have any more problems. _________________ Eric256
Proud previous owner and current admin of Bot-depot.com |
|
| Back to top |
|
 |
Drayshak Young One

Joined: 06 Jan 2004 Posts: 93 Location: Nottinghamshire, UK
      votes: 4
|
Posted: Sat Jan 24, 2004 11:26 pm Post subject: |
|
|
it works!! thnx *lazy* guys all it does now is returns 186 i dont know why it does that but at least it works now  |
|
| Back to top |
|
 |
Keenie Almost An Agent

Joined: 31 Oct 2003 Posts: 1071
 
|
Posted: Sun Jan 25, 2004 12:07 am Post subject: |
|
|
make it return a message then just a note to, generally you should be setting your name with the NS server not the SB, so $bot->{msn}->set_name(); but I guess the set name sub uses that GetMaster thing, so it gets the right socket for you |
|
| Back to top |
|
 |
Drayshak Young One

Joined: 06 Jan 2004 Posts: 93 Location: Nottinghamshire, UK
      votes: 4
|
Posted: Sun Jan 25, 2004 12:17 pm Post subject: |
|
|
| thnx lol i added it into my popup thingy *lazy* old name changed the bots nickname to its email addy |
|
| Back to top |
|
 |
Dazzy Agent

Joined: 09 Jan 2004 Posts: 1731
 
|
Posted: Sun Jan 25, 2004 12:29 pm Post subject: |
|
|
| thats because you didnt have the oldname thig set up right |
|
| Back to top |
|
 |
Dazzy Agent

Joined: 09 Jan 2004 Posts: 1731
 
|
Posted: Sun Jan 25, 2004 12:34 pm Post subject: |
|
|
right i tried this, and what it does it change the name to i have 52 users and sends 110, ive got 110 users not 52! can you help? |
|
| Back to top |
|
 |
eric256 The Keymaker

Joined: 03 May 2006 Posts: 2292 Location: Colorado
     
|
Posted: Sun Jan 25, 2004 5:28 pm Post subject: |
|
|
If you don't set a specific value for the return of a functiino then it returns the values of the last line in that function. I believe that set name for some bizaarre reason returns the length of the msg sent to the MSN server. So 110 is prob the lenthg of the command to change the name. Also remember that msn lists can be confusing. The AL list should hold all people who have ever talked to it, while the RL holds all people that have added it to there list. _________________ Eric256
Proud previous owner and current admin of Bot-depot.com |
|
| Back to top |
|
 |
|