User Control Panel
Advertisements

HELP US, HELP YOU!

Mirror module for MSN2.0
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Bot Depot Forum Index -> Modules & Add-ons
View unanswered posts
Author Message
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Fri Sep 24, 2004 6:46 pm    Post subject: Reply with quote

QuadLB is module for doing mirroring (or load-balancing) for MSN bots. The attached zip contains the module and a test bot.

QuadLB stands for Quick and dirty Load Balancing. From the name, you can guess that this module contains the bare minimum needed to have multiple MSN mirrors running. I plan to add more functionality over time, but I like the name and it will probably stick. Razz

See the quadtext.pl file for an example of using the module. Set YOUR own email in the $admin variable. The bots will call this email when they connect. Set each of your bot's handles and passwords in the section where it says "add mirrors". You can add as many more mirrors here as you like. Each needs to have its own handle and password, so be sure to register those with MSN. This is the hard-coded way of doing things. For a more dynamic way of storing your mirrors, see this post, especially reading Cer's comments about 4 posts down.

When you call addMirror, it returns the MSN instance for that mirror. You can also use the methods remMirror, getMirror, connect and disconnect. The exit command in the bot shows how you can disconnect from ALL mirrors by calling $quad->disconnect();
Back to top
dvondrake
Not Yet a God
Not Yet a God


Joined: 11 Mar 2004
Posts: 314
Location: El Paso, Texas
Reputation: 32.6Reputation: 32.6Reputation: 32.6

PostPosted: Fri Sep 24, 2004 6:58 pm    Post subject: Reply with quote

Cool, just what I was looking for!

EDIT: I'll have to plus you later, I already plused you today Razz
Back to top
Gavin
God Like
God Like


Joined: 15 Mar 2004
Posts: 661
Location: Manchester, UK
Reputation: 36.2Reputation: 36.2Reputation: 36.2Reputation: 36.2

PostPosted: Fri Sep 24, 2004 7:03 pm    Post subject: Reply with quote

Thats ace, I can have mirrors now Razz

I can't plus you either I plused your rep other day, when I can I will.

_________________
MSN: gavin [at] gavinbrittain [dot] co [dot] uk
E-Portfolio: www.gavinbrittain.co.uk (New version comming soon)
Back to top
mattaustin
Sentinel
Sentinel


Joined: 19 Jul 2004
Posts: 556
Location: Los Angeles, CA
Reputation: 50.7
votes: 1

PostPosted: Fri Sep 24, 2004 7:06 pm    Post subject: Reply with quote

Sweet! great job!!!
_________________
[ matt ]
Back to top
Addict
Not Yet a God
Not Yet a God


Joined: 21 Jan 2004
Posts: 473

Reputation: 34.4Reputation: 34.4Reputation: 34.4

PostPosted: Fri Sep 24, 2004 7:13 pm    Post subject: Reply with quote

This MSN module is going to be great!
Back to top
Dazzy
Agent
Agent


Joined: 09 Jan 2004
Posts: 1731

Reputation: 72.3

PostPosted: Fri Sep 24, 2004 7:20 pm    Post subject: Reply with quote

QUOTE(Gavin @ Sep 24 2004, 07:03 PM)
I can't plus you either I plused your rep other day, when I can I will.

I cannnn!!!! nice one mojave, you're really doing amazing with all this!
Back to top
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Fri Sep 24, 2004 8:25 pm    Post subject: Reply with quote

The following are some ideas and examples for using your bot mirrors. I'll most likely add some of this functionality in future versions of QuadLB. They are off the top of my head and have <*lazy*>not been tested.

Hints for doing actual load balancing using this module:

Whenever a user adds your bot to his contact list, your bot will get the ContactAddingUs event. If your bot doesn't handle this event, the bot simply allows the user to see it. But you can use this event to check the current number or users this particular mirror has on its contact list and decide to add another mirror or to tell the user to use a different mirror, etc.

Here is an example of using ContactAddingUs to directly redirect the user to a different mirror:

Code:
sub ContactAddingUs<br />{<br />   my $self = shift;<br />   my $handle = shift;<br /><br />   my $al_count = scalar $self->{Msn}->getContactList( 'AL' );<br /><br />   if( $al_count > 100 )<br />   {<br />      ## pick a NEW mirror bot here<br />      ## and call the user from this the mirror bot<br />      $msn5->call( $handle, "Hi, please add me to your contact list" );<br /><br />      # return 0 means don't add this contact to THIS bot's allow list<br />      return 0;<br />   }<br />   else<br />   {<br />      return 1;<br />   }<br />}


Here is an example of using ContactAddingUs to indirectly redirect the user to a different mirror:

Code:
sub ContactAddingUs<br />{<br />   my $self = shift;<br />   my $handle = shift;<br /><br />   my $al_count = scalar $self->{Msn}->getContactList( 'AL' );<br /><br />   if( $al_count > 100 )<br />   {<br />      ## tell the user to add a different bot on his contact list<br />      $self->call( $handle, "I am full, please add bot5@domain.com to your contact list" );<br /><br />      # return 0 means don't add this contact to THIS bot's allow list<br />      return 0;<br />   }<br />   else<br />   {<br />      return 1;<br />   }<br />}
Back to top
Addict
Not Yet a God
Not Yet a God


Joined: 21 Jan 2004
Posts: 473

Reputation: 34.4Reputation: 34.4Reputation: 34.4

PostPosted: Fri Sep 24, 2004 9:01 pm    Post subject: Reply with quote

Nice job! I havnt tested it yet.. I will in a second.

+1! B)
Back to top
lawrence
Senior Member
Senior Member


Joined: 19 Apr 2004
Posts: 203

Reputation: 29Reputation: 29Reputation: 29

PostPosted: Fri Sep 24, 2004 10:35 pm    Post subject: Reply with quote

omfg mojave you have contributed more to the bot community in about 2 weeks than was contributed over about the past 2 months Surprised its really great to see this much progress being made after all the inactivity on bot depto well im rele tired an talkin sum shiety stuff but you mite get the idea
Back to top
Gavin
God Like
God Like


Joined: 15 Mar 2004
Posts: 661
Location: Manchester, UK
Reputation: 36.2Reputation: 36.2Reputation: 36.2Reputation: 36.2

PostPosted: Sat Sep 25, 2004 8:44 am    Post subject: Reply with quote

QUOTE(lawrence @ Sep 24 2004, 11:35 PM)
omfg mojave you have contributed more to the bot community in about 2 weeks than was contributed over about the past 2 months Surprised its really great to see this much progress being made after all the inactivity on bot depto well im rele tired an talkin sum shiety stuff but you mite get the idea

I know what you mean he's on fire lol, Mojave doing a hell of a lot and I am sure everyone on bot-depot is extremely thankful.

_________________
MSN: gavin [at] gavinbrittain [dot] co [dot] uk
E-Portfolio: www.gavinbrittain.co.uk (New version comming soon)
Back to top
lawrence
Senior Member
Senior Member


Joined: 19 Apr 2004
Posts: 203

Reputation: 29Reputation: 29Reputation: 29

PostPosted: Sat Sep 25, 2004 1:24 pm    Post subject: Reply with quote

erm yeah, thats it. Thanks Razz
Back to top
Art
God Like
God Like


Joined: 25 May 2004
Posts: 551
Location: Amsterdam, Holland
Reputation: 35.2Reputation: 35.2Reputation: 35.2Reputation: 35.2

PostPosted: Sat Sep 25, 2004 4:48 pm    Post subject: Reply with quote

Awesome, Mojave. +1

[b]EDIT[b] you guessed it, i cant, i also have to wait. Razz
Back to top
Eaxposed
Newbie
Newbie


Joined: 06 Sep 2004
Posts: 48

Reputation: 21.3Reputation: 21.3

PostPosted: Mon Sep 27, 2004 7:03 am    Post subject: Reply with quote

Is this the msn module i cant seem to find the latest module for msn 2.0 one? i did have it but my bot went wrong when attempting to make it so i need it again (note my mate got the msn module for me)
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Mon Sep 27, 2004 11:44 am    Post subject: Reply with quote

Go into the "MSN Protocol Modules" forum, the most recent MSN module is pinned.
_________________
Current Site (2008) http://www.cuvou.com/
Back to top
davidk
Senior Member
Senior Member


Joined: 14 Feb 2004
Posts: 195
Location: United Kingdom, Europe, Earth, Solar system, The Milky Way, The Universe, the 3rd Dimension.
Reputation: 31.1Reputation: 31.1Reputation: 31.1

PostPosted: Sat Feb 26, 2005 9:38 am    Post subject: Reply with quote

Do I have to add Event Handlers Manually for each connection or does $quad->setHandler(); do this for me?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Modules & Add-ons All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 



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