Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Projects has a deprecated constructor in /home/protected/ci/application/controllers/projects.php on line 3
Chris Nestrud - Watcher
Skip Navigation

You are here: Home > Projects > Watcher


Watcher is a small perl script which, with the help of Net::IRC, will monitor an irc channel keeping tabs on who speaks. If at least X people speak in a rolling Y-second period, the people_talking sub is executed. When the number of people drops below X, the no_people_talking sub is run. You can modify these subs to do something useful when encountering these events.


The script is called It also requires the Net::IRC module, available from CPAN. Please read on for documentation.


Documentation is minimal, but the script is pretty straight forward. Refer to the following sections for necessary information.

Variables to Modify

You will need to modify the variables near the top of the script, including:

The nickname to use while on irc
The channel to join upon connecting to the server
The ircname to display (shown when someone runs a /whois on the nickname)
The irc server to connect to
The minimum number of people speaking that will trigger sub people_talking
The maximum number of seconds after someone last spoke before they are removed from consideration

Recognized Messages

The bot will respond to certain messages and provide information or perform a given action. A list of the understood commands follows.

The bot will exit the server and the program will end.
The bot will report various status information.
The bot will immediately perform a check of people in the channel. Normally checks are performed whenever someone new speaks, provided that at least 5 seconds have elapsed since the last check.
The bot will clear its information on people in the channel
minpeople (number)
Resets the minimum number that, when found speaking, will be considered to mean the channel is active
maxseconds (number)
Resets the number of seconds to pause before considering someone who has not spoken as not contributing to the channel
info (nick)
Provides information on a given nick, including when they last spoke

Command-Line Arguments

The script accepts two command-line arguments. The first is the minimum number of peple, and the second is the maximum number of seconds. If the second argument or both arguments are not supplied, defaults are taken from the lines near the top of the script.