On Conditions in Zircon in 1.18 It is possible in zircon to execute pieces of your own code whenever particular messages arrive from the server. This is a brief guide to the sorts of things that you can do, though in order to write the handler code you may need to know more about the internals of zircon than is pleasant at the moment! The Events ---------- POPUP This is called when a channel window popups on the screen. This means that the window was iconified and some activity has taken place. I use this to sound a bell when I am msged. POPDOWN This is called when a channel has been inactive and its window is being automatically iconified. MODE Called when mode changes take place NOTICE Called when a notice arrives. JOIN Called when someone joins a channel. NICK Called when someone changes their nick. LEAVE Called when somoen leaves a channel. KICK Called when someone is kicked. QUIT Called when someone quits. INVITE Called when you receive an invitation. KILL Called when someone is killed. TOPIC Called when someon changes the topic. HEAL Called when a netsplit heals. SPLIT Called when there is a netsplit. USPLIT Called for each affected nick when there is a netsplit. STARTUP Called when zircon starts a connection to a server. CLOSE Called when zircon closes the connection to a server. MSG Called when someone se4nds you a message. PUBLIC Called when someone on the channel sends a message to a channel. PUBLIC_MSG Called when someone *not* on the channel sends a message to a channel. There are some special Channel options that avoid the use of on conditions. You set these up in your .zircon/preferences file. -ops {{}...} -patterns { {{ } {}}...} All the patterns are regular expressions and the nick!user@host are all matched case insensitive. -ops will automatically op anyone matching one of the patterns in the list who joins a channel on which you are an operator. -patterns will execute the when anyone matching the nick pattern sends a text that matches the text pattern. There can be as many entries as you like in the patterns list - though note the more you have the greater the impact on performance! Patterns and ops are on a per channel basis. If you want a pattern or auto-op list to apply to all channels, then you can give -ops or -patterns to the *default* channel. At the moment no other events are catered for. You can use the pattern matching facilities for Channels to causes actions to take place when messages sent to the channel match a particular value. If there are other things you have a burning desire to handle let me know. N.B. You have to understand tcl/tk to write on condition handlers!!] Watchpoint: tcl/tk has some special characters. If your patterns or commands contain the charcters { or } then you should escape them using a \ when you include them. (But there may be occassions when even this doesn't work - mail me if you have trouble....) Use the tcl list command to help you make lists if you are having problems. Specifying on conditions ------------------------ You set up on conditions in your .zircon/preferences file thus: on When the EVENT named takes place, zircon matches each of the patterns in the list against the values associated with that event. If all the patterns match, then the code is executed at global scope. Patterns are specified using tcl regular expression syntax. So that you can determine what was matched, zircon sets up some global variables called 0, 1 etc. which contain the actual values, so you can access them using the tcl variable accesses $0, $1 etc. Here are are two very simple on conditions : on POPUP {{^[^#&].*}} { exec rplay ring.au & } on POPUP #zircon {exec rplay drip.au &} The first plays a telephone ringing sound whenever a message or notice comes in that is directed to me. Message channels are named for the nick of the person sending the message. The pattern excludes all channels whose names begin with # or &. The second condition explicitly matches the channel #zircon and plays a different sound when that is matched. Note that only the first condition that matches is executed. If you wish the system to match multiple conditions for an event add the line net multion 1 to your .zircon/preferences or netspace file.