DMDircthe intelligent IRC client

Plugins

Filed under: Plugins, Tech — Shane on May 26, 2007 @ 1:10 am — Permalink

Ok, so you’ve read about actions and seen just how amazingly useful they are, maybe you’ve even used them and feel like donating your life savings to the creator? (It’s me, honest! Don’t believe Chris!) Well then, what happens when you come across something that you just can’t manage to do with actions? (It’s rare, but it happens — though if you believe it should be possible with actions let us know in #DMDirc on Quakenet and we’ll see what we can do). The answer is simple: Plugins :D

Plugins, unlike actions, are made from compiled Java code. This means that (also unlike actions) they require a considerable bit more technical knowledge to create.

The plugins system is tied into the actions system for most events, and whilst using this is not required, it is probably desirable for a lot of plugins.

Plugins can do a lot of things, from adding new action types, to manipulating the actual IRC Parser callbacks and line processing, in summary they give you the most control over the client, but at the cost of being harder to get to grips with.

Some plugins are available in source-form from the SVN repository for the project (and are compiled into the nightly jar files, so you can extract the .class files if you’re not comfortable compiling plugins yourself) and before 0.4 is released http://addons.dmdirc.com/ will be completed to allow plugins to be downloaded in source and/or compiled form.

Clicking on “more” will guide you through writing your first plugin. In further blog posts I will expand on this first plugin.
(more…)

Actions: now with added UI

Filed under: Actions — Chris on May 25, 2007 @ 7:03 pm — Permalink

Following on from my previous post, the front-end for actions is just about complete. Here are some preview images:

Actions Manager dialog
The actions manager lists all known actions, sorted into groups (which correspond to directories on the disk).

Editing an action: tab 1
The “general” tab of the actions editor allows you to select which triggers the action responds to, as well as specifying its friendly name.

Editing an action: tab 2
The “conditions” tab allows you to specify conditions for the action. The pencil icon brings up the condition editor for that condition (see next image), while the cross button deletes the corresponding condition.

Editing an action: conditions
The conditions editor allows you to add or modify an action condition. Once you select an argument, the components list is updated to contain only the applicable components, and when you select a component the comparison list is updated similarly.

Editing an action: tab 3
Finally, the response tab allows you to specify how the client should respond if this action is triggered. The commands are executed as though you typed them in the window that triggered the event.

Introducing actions

Filed under: Actions, Tech — Chris on May 11, 2007 @ 4:55 pm — Permalink

‘Actions’ are one of the major features we’ve introduced since DMDirc 0.3 was released. Actions provide a way for the user to make the client respond to events in certain ways, and basically provide a subset of the functionality of scripting in other clients (e.g. mIRC), but in a much more user-friendly manner.

The graphical front-end for actions is still under construction, but the back end has been fully functional for a week or so. Here’s an example of one of the actions I use:

trigger=CHANNEL_USERAWAY
conditions=0
response=/setnickcolour $source 14

This rather brief action makes the client colour anyone who is set away to a light grey colour. (Aside: DMDirc can now be configured to send /who requests at a certain interval (60 seconds, by default). This functionality can also be enabled and disabled per channel; if it’s disabled then the CHANNEL_USERAWAY events won’t be triggered unless the user manually sends a who request). The ‘trigger’ field specifies which event triggers the action (and may, as we’ll see in a minute, contain more than one event); the ‘conditions’ field tells DMDirc how many conditions there are for the execution of the action - in this case, none; finally the ‘response’ field contains commands to be executed (or text to be sent to the channel) - here it uses a recently-introduced command to set the colour of a specified nickname. The “$source” part will be explained shortly.

Here’s a slightly more complex action:

trigger=CHANNEL_MESSAGE|CHANNEL_ACTION
conditions=1

condition0-arg=2
condition0-component=STRING_STRING
condition0-comparison=STRING_CONTAINS
condition0-target=$nick

response=/notify $highlightcolour\\n/popup Highlight on $chan: <$source> $message
format=channelHighlight

Here we have two triggers: CHANNEL_MESSAGE and CHANNEL_ACTION. If multiple triggers are specified, they have to be type-compatible (they must have the same number of potential arguments, which must be of the same classes) - this restriction, like any others mentioned hereafter, will be transparently enforced by the graphical editor, so there will be no need for users to worry about this.

Unlike the previous example, this one also specifies a condition. There are four parts to a condition: the argument, component, comparison and target. The first two determine what the user wants to test - the argument identifies which object they’re interested in (e.g. a Channel or User), and the component determines which aspect of that they want to test (A channel’s name, a user’s modes, etc). The comparison, rather unsurprisingly, determines what comparison should be used to compare between the test subject and the user’s target. Some comparisons for strings, for example, are “starts with”, “contains” and “equals”. The target, as implied, is the data that the subject is compared to. An action can have any number of conditions, and will only be executed if all of them pass.

In this example you’ll also notice that the ‘response’ field contains two commands (both new since 0.3), which are both executed. It also contains a few variables. These are dynamically replaced when the action is being tested and executed (they can appear both in the response and the targets of any conditions). The exact replacements available depend upon the arguments - $source will be set to the user’s nickname if the action was triggered by someone, and $chan will be set to the channel name if the action is channel-based, for example. Others are always present (such as $nick, used in the condition, which equals your current nickname on the server that the action is being executed for). The actions system will also replace any variable with the same name as a config setting under the “actions” domain - in the example above, the $highlightcolour variable is replaced by the value of my ‘actions.highlightcolour’ setting.

Finally, we have the ‘formatter’ field. This allows the user to control the default output that is normally associated with an action. In this example, it changes the formatter name from ‘channelMessage’ (the default), to ‘channelHighlight’, which is a new format I’ve written which makes the line show up red. You can use this to stop default messages entirely (by setting the formatter to an empty string), or, for example, to display a custom message if a certain event happens.

You can try out actions in the latest nightly builds. There is a pack of actions available here that provide some basic functionality for changing the colour of channels in the treeview (joins/parts/quit make the channels turn green, messages make them turn blue, and highlights turn them red).

Meet the developers

Filed under: General — Chris on May 3, 2007 @ 3:22 pm — Permalink

This is a brief introduction to DMDirc’s developers.

I’m Chris, aka MD87. I’m the “core” developer of DMDirc, which means I’m responsible for most of the back-end logic, handling data storage, and a small mountain of others things. I’m also apparently the best writer, so I’ll probably be the one who posts most to this blog.

Next up, we have Shane, aka Dataforce. He’s primarily in charge of the IRC Parser (the code that interfaces between the client and the IRC server), but is also working on the plugins system, and writing the logging plugin. You can identity Shane’s code by the length of lines and the number of code conventions it breaks (if there are >300 char lines, and it breaks every convention you can think of, it’s probably his).

Last but not least, there’s Greg, aka Greboid. He’s in charge of the client user interface, and can often be found complaining on IRC about problems he’s having with it (his latest favourite subject is the TextPane rewrite we have scheduled for 0.4).

So, that’s us. We can all be found on IRC, in #DMDirc on Quakenet (irc.quakenet.org) among other places. We can also be contacted via e-mail by prepending our name (as above) to @dmdirc.com.

Welcome to the DMDirc development blog

Filed under: General — Chris on May 2, 2007 @ 8:43 pm — Permalink

Welcome to the DMDirc development blog. The idea behind this blog to allow us, the developers, to show off new features we’re implementing, discuss various aspects of IRC and writing an IRC client, and to get some feedback from our users. We’ll try to make semi-regular posts to keep everyone up to date with the client’s status.

If you want to try the features we’re describing, you can try a nightly build, as explained on the development page of our main website. Please note that nightly builds may be horrendously buggy, so don’t be hugely surprised if one of them deletes your config files, makes your screen turn red, or sacrifices your first born child to the gods of IRC.

If you have any questions about DMDirc, want us to blog about anything in particular, or just want to chat, you can find all of the developers in #dmdirc on Quakenet (irc.quakenet.org).

Powered by WordPress