Elections

Elections are related to running more than one bMotion bot in the same channel (see MultiplebMotions).

Because bMotion tries to be as un-annoying as possible and there are plugins which trigger without the bot being directly addressed, it's necessary for bots which are in a channel together to coordinate to avoid having them both respond.

bMotion handles this automatically by holding elections over the eggdrop botnet. When a bot announces an election for a particular channel, it picks a number between 0 and 100. Or 1 and 100, I can't remember. It doesn't matter really and I can't be bothered looking at the code right now. What's important is it picks a number. It broadcasts this on the botnet. Other bMotion bots which are active on that channel respond by broadcasting random number of their own. Whichever bot holds the highest number is deemed by all to be the next bot to answer a plugin event for that channel.

Elections are held at the following times:

  • When a bot starts bMotion up
  • When a bot returns from being away
  • When a bot triggers on a plugin that uses the election syste
  • Every 600 - 1200 seconds (randomly chosen)

Note that just because a bot is the currently elected one, it won't necessarily answer something - if the plugin never triggers, the election check is never made.