You can also do that with a script:
on ^*:
PART:
#channel: haltdef
Where
PART can be changed to JOIN, QUIT*, etc.. and
#channel can be changed to any channel you want or
* to all channels.
* The on QUIT event
does not have a channel, so it would be
on ^*:QUIT: haltdefZyzzyx