Optimizing action combiner (for IRC bots)

   1. Purpose
   2. Examples
      2.1. Distributing and combining mode commands:
      2.2. Combining without agents
   3. Copying
   4. Requirements
   5. Downloading

1. Purpose

modecombiner is a generic three-input logical expression optimizer, designed to distribute IRC operative actions to agents on various channels.
It takes a list of agents, list of channels each agent is on, list of actions and list of channels each action affects.
It produces a list of operations for each agent, to submit the wanted operations. It tries to produce the smallest list of operations to do the job, utilizing the necessary number of agents.
It also takes the priorities for each agent, and picks the ones who are most eager to do the job.
IRC Action combiner v1.5.6.1 for agent system like in BisqBot
Copyright (C) 1992,2002 Bisqwit (http://iki.fi/bisqwit/)
No warranty whatsoever. Distributed under the terms of GPL v2, see COPYING

Usage: modecombiner [--notest] <agentdef> [<...>] /<op> [<opdef> [<...>]]

	--notest disables combining parameter limits.
	agentdef is: <nick>[:<load>[:<reliability>[:<hostload>]]] <channellist>
	channellist is: "<chan> [<...>]"
	For op='M', opdef is: <modestring>
	For op='K', opdef is: <kickstring>
	For op='T', opdef is: <topicstring>
	For op='G', opdef is: <msgstring>
	For op='N', opdef is: <noticestring>
	For op='Q', opdef is: <whoisstring>
	For op='O', opdef is: <functionstring>
	modestring is: "<chans> <modes> [<parameter> [<...>]]"
	kickstring is: "<chans> <nicks> <text>"
	topicstring, msgstring and noticestring are: "<chans> <text>"
	whoisstring is: "<nicks>"
	functionstring is: "<chan> <function> [<parameters> [<...>]]"
	chans is: <chan>[,<chan>[<...>]]
	nicks is: <nick>[,<nick>[<...>]]
	modes is a combination of alphabets and +/- signs.
	load is an unsigned integer, describing the load the agent has.
	reliability is an unsigned integer, bigger value meaning more reliable.
	hostload is an unsigned integer, used in functionstring; means host load.
		reliability value is used if two agents have equal chance otherwise.
Output consists of lines of following format:
	<op> <nick> <command>
	op=W is a special case: it means there is no agent
	able to do the job for the particular channel.
	op=O is handled specially (no grouping happens).

2. Examples

2.1. Distributing and combining mode commands:

  modecombiner \
    Agent1 '#c2' \
    Agent2 '#c1 #c3 #c2' \
    Agent3 '#c3' \
    /M \
    '#c1 +o bisqwit' \
    '#c2 +mnsto bisqwit' \
    '#c3 +ooo bisqwit bisqbot nick' \
    '#c3,#c1 +v Mog' \
    '#c4 +o bisqwit' 
  W #c4 M +o bisqwit
  M Agent1 #c2 +omnst bisqwit
  M Agent2 #c1,#c3 +ov bisqwit Mog
  M Agent3 #c3 +ooo bisqwit bisqbot nick

2.2. Combining without agents

If you just want to combine actions but don't have a list of agents to do it, specify one agent that is on all the channels.
For example, with this task list (file tasklist.txt):
M #Huffi +o Guffi
M #Frumble +o nngh
M #Frumble +o Zonk
M #fozz +o nngh
M #fozz +o Zonk
M #Muffi +o Guffi
M #fiuu +o nngh
M #fiuu +o Zonk
M #sc2.ja +o nngh
M #sc2.ja +o Zonk
and this shell command:
chanlist="$(echo `sed 's/^..//;s/ .*//' <$fn |sort|uniq`)"
sed s/^..// <"$fn"|tr '\n' '\0'|xargs -0 modecombiner --notest _ "$chanlist" /M
You get this task list:
_ M #Huffi,#Muffi +o Guffi
_ M #Frumble,#fozz,#fiuu,#sc2.ja +oo nngh Zonk
Okay, this might not look as simple as it is, but the result is nice, isn't it?
The --notest is there to allow grouping more than three parameters for modes.

3. Copying

modecombiner has been written by Joel Yliluoma, a.k.a. Bisqwit,
and is distributed under the terms of the General Public License (GPL).

4. Requirements

GNU make is probably required.
A C++ compiler with a decent support of templates and virtual classes is required too.

5. Downloading

Downloading help

  • Do not download everything - you only need one file (newest version for your platform)!
  • Do not use download accelerators or you will be banned from this server before your download is complete!

Date (Y-md-Hi) acc        Size Name                
2003-0613-1303 r--       28166 modecombiner-
2003-0613-1303 r--        1280 patch-modecombiner-1.5.6-
2003-0603-1126 r--       28157 modecombiner-1.5.6.tar.bz2
2003-0603-1126 r--       11086 patch-modecombiner-1.5.5-1.5.6.bz2
2002-0514-1437 r--       26548 modecombiner-1.5.5.tar.bz2
2002-0514-1437 r--        4718 patch-modecombiner-1.5.4-1.5.5.bz2
2002-0410-2038 r--       23757 modecombiner-1.5.4.tar.bz2
2002-0410-2038 r--        1764 patch-modecombiner-1.5.3-1.5.4.bz2
2002-0410-1958 r--       23448 modecombiner-1.5.3.tar.bz2
2002-0410-1958 r--        1267 patch-modecombiner-1.5.2-1.5.3.bz2
2002-0408-1116 r--       23205 modecombiner-1.5.2.tar.bz2
2002-0408-1116 r--        3202 patch-modecombiner-1.5.1-1.5.2.bz2
2002-0408-1103 r--       21235 modecombiner-1.5.1.tar.bz2
2002-0408-1103 r--        1056 patch-modecombiner-1.5.0-1.5.1.bz2
2002-0404-0552 r--       21203 modecombiner-1.5.0.tar.bz2
2002-0404-0552 r--        4724 patch-modecombiner-1.0.9-1.5.0.bz2
2002-0404-0014 r--       20600 modecombiner-1.0.9.tar.bz2
2002-0404-0014 r--        2433 patch-modecombiner-1.0.8-1.0.9.bz2
2002-0403-1728 r--       20396 modecombiner-1.0.8.tar.bz2
2002-0403-1728 r--       27634 modecombiner-1.0.8.zip
2002-0403-1728 r--        1327 patch-modecombiner-1.0.7-1.0.8.bz2
2002-0329-2054 r--       20266 modecombiner-1.0.7.tar.bz2
2002-0329-2054 r--        3905 patch-modecombiner-1.0.6-1.0.7.bz2
2002-0118-2123 r--       21168 modecombiner-1.0.6.rar
2002-0118-2123 r--       20101 modecombiner-1.0.6.tar.bz2
2002-0118-2123 r--        2694 patch-modecombiner-1.0.5-1.0.6.bz2
2001-1217-1204 r--       20510 modecombiner-1.0.5.rar
2001-1217-1204 r--       19404 modecombiner-1.0.5.tar.bz2
2001-1217-1204 r--        3840 patch-modecombiner-1.0.4-1.0.5.bz2
2001-1112-0005 r--       19721 modecombiner-1.0.4.rar
2001-1112-0005 r--       18618 modecombiner-1.0.4.tar.bz2
2001-1112-0005 r--        2968 patch-modecombiner-1.0.3-1.0.4.bz2
2001-1111-2243 r--       19475 modecombiner-1.0.3.rar
2001-1111-2243 r--       18464 modecombiner-1.0.3.tar.bz2
2001-1111-2243 r--       10323 patch-modecombiner-1.0.2-1.0.3.bz2
2001-1110-2230 r--       12456 modecombiner-1.0.2.rar
2001-1110-2230 r--       11643 modecombiner-1.0.2.tar.bz2
2001-1110-2230 r--        8608 patch-modecombiner-1.0.1-1.0.2.bz2
2001-1108-0542 r--       10714 modecombiner-1.0.1.rar
2001-1108-0542 r--       10117 modecombiner-1.0.1.tar.bz2
2001-1108-0542 r--        2792 patch-modecombiner-1.0.0-1.0.1.bz2
2001-1108-0420 r--       10595 modecombiner-1.0.0.rar
2001-1108-0420 r--       10033 modecombiner-1.0.0.tar.bz2
2001-1108-0420 r--        4157 patch-modecombiner-0.0.3-1.0.0.bz2
2001-1108-0120 r--        9687 modecombiner-0.0.3.rar
2001-1108-0120 r--        9217 modecombiner-0.0.3.tar.bz2
2001-1108-0120 r--        7241 patch-modecombiner-0.0.2-0.0.3.bz2
2001-1107-2028 r--       10185 modecombiner-0.0.2.rar
2001-1107-2028 r--        9892 modecombiner-0.0.2.tar.bz2
2001-1107-2028 r--        4265 patch-modecombiner-0.0.1-0.0.2.bz2
2001-1107-0145 r--        9803 modecombiner-0.0.1.rar
2001-1107-0145 r--        9613 modecombiner-0.0.1.tar.bz2
2001-1107-0145 r--         602 patch-modecombiner-0.0.0-0.0.1.bz2
2001-1107-0128 r--       10031 modecombiner-0.0.0.rar
2001-1107-0128 r--        9842 modecombiner-0.0.0.tar.bz2
Back to the source directory index at Bisqwit's homepage