The Eggdrop FAQ
Linking and Sharing


How do I link two bots?

Two bots can link through a TCP connection (telnet) and you will then be able to talk to the people on others bots partyline. You will need at least Botnet Master access on both bots to link them, or have someone do their stuff on the other side. You will have to know the address and port each bot is listening to.

Then, all you need to link them is to set the following:

  1. Decide which bot you will want to link to which one. Let's say it is BotA and BotB.

  2. On BotA, add an bot record for BotB.

      .+bot BotB botb.telnetaddress.here:port  

    (if you already have a BotB user without the +b flag, remove it, and readd it this way. You cannot simply do a .chattr BotB +b to turn it into a bot)

  3. On BotB, do the same for BotA:

      .+bot BotA bota.telnetaddress.here:port  
  4. Link both bots, from any side. For example from BotA, type:

      .link BotB  
  5. They should link and tell you that it was successful.


How can I find out in which port one bot is listening on?

Use the .dccstat command, it will give you some output similar to:

  SOCK ADDR     PORT  NICK      HOST              TYPE                       
  ---- -------- ----- --------- ----------------- ----                       
  3    D01E1C15  2323 (telnet)  *                 lstn                       
  4    D01E1C15  8080 (script)  http:new_idx      lstn                       
  8    00000000  6667 (server)  irc.trends.ca     serv  (lag: -1)            
  6    00000000  5555 OtherBot  lamesthost.org    bot   flags: pucOsgwliA    
  22   D01E1C15  1357 (users)   *                 lstn                       
  11   81451FAA  1684 Ernst     .uni-stuttgart.de chat  flags: cPtEp/429496  
  14   00000000  2324 LagBot    host.lagnet.net   conn  bot                  
  34   C8F1E217  1083 *         200.241.226.23    scri  http:readsock        

You can see that it is listening at port 2323 for telnet connections. The TYPE = "lstn" and NICK = "(telnet)" indicates you that.


What if my bots won't link for some reason?
  1. The password is incorrect.

    • Remove the password on both bots:

        on BotB:  .chpass BotA  
        on BotA:  .chpass BotB  
    • Link again

  2. Some other error occurred:

    • Check if you have set the telnet-addresses and the port number correct.

    • Use the .dccstat command on both bots to see if they are really listening "(telnet) * lstn" on the ports you specified.

    • Make sure you are not using a firewall, if you are, you need to guarantee that the telnet connection from one bot to the other can come through it. See some settings in the sample configuration file for further help.


How can I make my bots always connect to each other when they start (+h)?

You will want to make one of the bots the HUB of your little botnet, that is, other bots will always try to connect to it first. For this, you must set it with the +h bot flag on all other bots. In the case you have BotA and BotB, and want BotA to connect to BotB and vice-versa, you set the +h flag to the opposite bot:

  on BotB:  .botattr +h BotA  
  on BotA:  .botattr +h BotB  

Why would I want alternate HUBS (+a)?

If your botnet is getting bigger, you should try to decide over two or three bots which have fast connections to all others, and set one of them as your HUB and the other(s) as your alternate HUB(s), in case the main HUB is dead.

Say your botnet looks like

  BotHUB     
   |-- BotA  
   |-- BotB  
   `-- BotC  

And you have alread set BotHUB as your main HUB with:

  on BotA:    .botattr +h BotHUB                                       
  on BotB:    .botattr +h BotHUB                                       
  on BotC:    .botattr +h BotHUB                                       
  on BotHUB:  .botattr +h BotA   (in case BotHUB dies and comes back)  

Now you want BotA to become the alternate HUB.

  on BotB:    .botattr +a BotA  
  on BotC:    .botattr +a BotA  

So if BotHUB dies, BotB and BotC will try to connect to their alternate HUB, BotA. For this to work, you must make sure they have linked to each other at least one time. Do this one time manually on each bot (BotA, BotB and BotC):

  .link BotHUB    
  .unlink BotHUB  

On BotB and BotC, make sure they can connect to BotA, the alternate HUB:

  .link BotA    
  .unlink BotA  

That way you will see if everything works and makes the bot sets their (random) password.


How do I share a userfile between two bots?

You will have a HUB bot, the bot that will send the userfile to other bots. Decide who that will be. Then, on this Hub bot (BotHUB) do this for each bot that is going to receive the userfile:

  .botattr ShareBot +s|+s #sharedchannel  

On your passive bot (ShareBot) do this:

  .botattr BotHUB +p|+s #sharedchannel                                   
  .botattr BotHUB +h (only do this  when  you want the bots to connect)  

The |+s is used to make the bot also share flags for the given channel. For this to work, you must also set the channel in your configuration file to be "shared". Set this in both bots configuration.

  channel set #sharedchannel +shared  

I get Rejected flags for unshared channel #channel from Hub_Bot. Why?
  • In the bots config, make sure you have the channel set as "+shared". This can be confusing if you have a dynamic channel file, so to make sure, type .chaninfo #channel in your bot, and see what the bot really is using.

    Change the setting with .chanset #channel +shared (on ALL your bots) and do a .save to store your changes.

  • Check if you have given the +s flag for this channel to the hub bot on all leaf bots, and to all leaf bots on your hub bot:

      .botattr botname -|+s #sharedchannel  

I always get wrong password when relinking two bots that were just connected, why?

If you are trying to link bots with different major version numbers (for example linking a 1.3 bot with an 1.0 one, there is a problem with the passwords, when the bots make the first link without a pass. So to be sure, set the password on your own on both bots. Say you have BotA (1.3.x) and BotB (1.0s), you do:

  on BotA:  .chpass BotB mylink  
  on BotB:  .chpass BotA mylink  

Sharing users between bots (an example)

04/08/98 - ArmrOfGod <silas@technologist.com>
revised by Ernst

This is NOT an introduction to setting up a botnet. This document expects that you already know how to set up bots to link to hubs and alternate hubs, and that know how to use the Get-Ops scripts. If you don't know these things, don't even bother to read this document.

For our first example, we will be using three bots. We will call them Peter, Paul, and Mary. We will also use three channels: #Music, #Folk, #GetReal. Here is the way the bots live in the channels:

  #Music    Peter, Paul, Mary  
  #Folk     Peter, Mary        
  #GetReal  Peter, Paul        

Here is the way the bots will be linked:

  Peter      
   |-- Paul  
   `-- Mary  

The records for each bot are listed below:

  Peter                               
                                      
  <Peter> #ArmrOfGod# whois Paul      
  <Peter> HANDLE    PASS NOTES FLAGS  
  <Peter> Paul       yes     0 b      
  <Peter>   #Music             sof    
  <Peter>   #GetReal           sof    
  <Peter>   #Folk              of     
  <Peter>   BOT FLAGS: p              
                                      
  <Peter> #ArmrOfGod# whois Mary      
  <Peter> HANDLE    PASS NOTES FLAGS  
  <Peter> Mary      yes      0 b      
  <Peter>   #Music             sof    
  <Peter>   #GetReal           of     
  <Peter>   #Folk              sof    
  <Peter>   BOT FLAGS: p              
  Paul                                
                                      
  <Paul> #ArmrOfGod# whois Peter      
  <Paul> HANDLE    PASS NOTES FLAGS   
  <Paul> Paul       yes     0 b       
  <Paul>   #Music             sof     
  <Paul>   #GetReal           sof     
  <Paul>   #Folk                      
  <Paul>   BOT FLAGS: sh              
  Mary                                
                                      
  <Mary> #ArmrOfGod# whois Peter      
  <Mary> HANDLE    PASS NOTES FLAGS   
  <Mary> Mary       yes     0 b       
  <Mary>   #Music             sof     
  <Mary>   #GetReal                   
  <Mary>   #Folk              sof     
  <Mary>   BOT FLAGS: sh              

Peter, (the hub bot) contains the master userfile for all three channels. However, we only want to share some of that information with the other two bots, not all of it. In the bot's config files, each channel must have the channel set <#channelname> +shared for each channel it will be sharing.

In this case, Peter will have:

  channel set #Music +shared    
  channel set #GetReal +shared  
  channel set #Folk +shared     

Paul will have:

  channel set #Music +shared    
  channel set #GetReal +shared  

Mary will have:

  channel set #Music +shared  
  channel set #Folk +shared   

Since Peter is in all three channels, we must define those channels as being shared, since Peter is sharing user records with the other two bots.

Now, here is the tricky part of the .whois fields. The +p (passive share) and +s (active share) flags are often confusing.

When a bot is set with BOT FLAG: p

  <Peter> #ArmrOfGod# whois Paul      
  <Peter> HANDLE    PASS NOTES FLAGS  
  <Peter> Paul       yes     0 b      
  <Peter>   #Music             sof    
  <Peter>   #GetReal           sof    
  <Peter>   #Folk                     
  <Peter>   BOT FLAGS: p              

This means "this bot (Paul) will accept user files that I (Peter) send it."

When a bot is set with BOT FLAG: s

  <Paul> #ArmrOfGod# whois Peter      
  <Paul> HANDLE    PASS NOTES FLAGS   
  <Paul> Paul       yes     0 b       
  <Paul>   #Music             sof     
  <Paul>   #GetReal           sof     
  <Paul>   #Folk                      
  <Paul>   BOT FLAGS: s               

This means "I (Paul) expect to get a user file from this bot (Peter)."

So, looking at the above two listings, we can see that Paul expects Peter to send it a user file, and Peter expects Paul to receive the user file. This is one of two critical points to get right! If you reverse or don't get these flags correct, your user files will not transfer. This flags is set with the .botattr command.

  On Paul:  .botattr Peter +s  
  On Peter: .botattr Paul +p   

The second step is the +s flags for each channel. This is simpler. It means "I'm sharing user records for this channel." If you don't get these right, no user records will be sent or accepted for the channel in question. Here is a more detailed explanation:

  <Peter> #ArmrOfGod# whois Paul       
  <Peter> HANDLE    PASS NOTES FLAGS   
  <Peter> Paul       yes     0 b       
  <Peter>   #Music             sof     
  <Peter>   #GetReal           sof     
  <Peter>   #Folk                      
  <Peter>   BOT FLAGS: p               
                                       
  <Peter> #ArmrOfGod# whois Mary       
  <Peter> HANDLE    PASS NOTES FLAGS   
  <Peter> Mary      yes      0 b       
  <Peter>   #Music             sof     
  <Peter>   #GetReal                   
  <Peter>   #Folk              sof     
  <Peter>   BOT FLAGS: p               

Peter expects bots Mary and Paul to accept user files (the +p BOT FLAG). The specific channels it will share with each bot is identified with the +s channel flag ('s' == share). Peter will attempt to send Paul all flags that users have for both #Music and #GetReal, and will send Mary all flags that users have for #Music and #Folk. Mary will receive nothing regarding #GetReal, because even though there is a channel record, the +s flag is not present.

  Mary                               
                                     
  <Mary> #ArmrOfGod# whois Peter     
  <Mary> HANDLE    PASS NOTES FLAGS  
  <Mary> Mary       yes     0 b      
  <Mary>   #Music             sof    
  <Mary>   #GetReal                  
  <Mary>   #Folk              sof    
  <Mary>   BOT FLAGS: sh             

Mary expects Peter to send her (+s BOT FLAG) user flags and info for #Music and #Folk. If Peter were to send anything for #GetReal, Mary would automatically reject it, since the +s flag is missing for that channel.

There is a patch that implements a global flag for userfile sharing, meaning that the entire userfile will be transferred. I would recommend against using this, simply because it makes it MUCH more difficult in the future to change the structure of which bots share what channels.



© 1998-2000 by Ernst