User Control Panel
Advertisements

HELP US, HELP YOU!

al list in nickname

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Perl
View unanswered posts
Author Message
Drayshak
Young One
Young One


Joined: 06 Jan 2004
Posts: 93
Location: Nottinghamshire, UK
Reputation: 46.2Reputation: 46.2Reputation: 46.2Reputation: 46.2Reputation: 46.2
votes: 4

PostPosted: Sat Jan 24, 2004 8:41 pm    Post subject: Reply with quote

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("Smile K a P o K s B o T Smile {Type !chat To Come To Chat} {<Surprised) Now With $al_count Amount Of Users <Surprised)}");

}

{
    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
God Like


Joined: 14 Jan 2004
Posts: 540
Location: england
Reputation: 66.6

PostPosted: Sat Jan 24, 2004 8:46 pm    Post subject: Reply with quote

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
Almost An Agent


Joined: 31 Oct 2003
Posts: 1071

Reputation: 52.4

PostPosted: Sat Jan 24, 2004 9:33 pm    Post subject: Reply with quote

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
Young One


Joined: 06 Jan 2004
Posts: 93
Location: Nottinghamshire, UK
Reputation: 46.2Reputation: 46.2Reputation: 46.2Reputation: 46.2Reputation: 46.2
votes: 4

PostPosted: Sat Jan 24, 2004 9:52 pm    Post subject: Reply with quote

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
Almost An Agent


Joined: 31 Oct 2003
Posts: 1071

Reputation: 52.4

PostPosted: Sat Jan 24, 2004 9:56 pm    Post subject: Reply with quote

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
Young One


Joined: 06 Jan 2004
Posts: 93
Location: Nottinghamshire, UK
Reputation: 46.2Reputation: 46.2Reputation: 46.2Reputation: 46.2Reputation: 46.2
votes: 4

PostPosted: Sat Jan 24, 2004 9:58 pm    Post subject: Reply with quote

i changed it to count and its still not working :'(
Back to top
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Sat Jan 24, 2004 10:25 pm    Post subject: Reply with quote

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
The Keymaker


Joined: 03 May 2006
Posts: 2292
Location: Colorado
Reputation: 47Reputation: 47Reputation: 47Reputation: 47Reputation: 47

PostPosted: Sat Jan 24, 2004 10:28 pm    Post subject: Reply with quote

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
Young One


Joined: 06 Jan 2004
Posts: 93
Location: Nottinghamshire, UK
Reputation: 46.2Reputation: 46.2Reputation: 46.2Reputation: 46.2Reputation: 46.2
votes: 4

PostPosted: Sat Jan 24, 2004 11:26 pm    Post subject: Reply with quote

it works!! thnx *lazy* guys Smile all it does now is returns 186 i dont know why it does that but at least it works now Smile
Back to top
Keenie
Almost An Agent
Almost An Agent


Joined: 31 Oct 2003
Posts: 1071

Reputation: 52.4

PostPosted: Sun Jan 25, 2004 12:07 am    Post subject: Reply with quote

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
Young One


Joined: 06 Jan 2004
Posts: 93
Location: Nottinghamshire, UK
Reputation: 46.2Reputation: 46.2Reputation: 46.2Reputation: 46.2Reputation: 46.2
votes: 4

PostPosted: Sun Jan 25, 2004 12:17 pm    Post subject: Reply with quote

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
Agent


Joined: 09 Jan 2004
Posts: 1731

Reputation: 72.3

PostPosted: Sun Jan 25, 2004 12:29 pm    Post subject: Reply with quote

thats because you didnt have the oldname thig set up right
Back to top
Dazzy
Agent
Agent


Joined: 09 Jan 2004
Posts: 1731

Reputation: 72.3

PostPosted: Sun Jan 25, 2004 12:34 pm    Post subject: Reply with quote

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
The Keymaker


Joined: 03 May 2006
Posts: 2292
Location: Colorado
Reputation: 47Reputation: 47Reputation: 47Reputation: 47Reputation: 47

PostPosted: Sun Jan 25, 2004 5:28 pm    Post subject: Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Perl 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