04703efec375915d6aee1fc5e9cfc2fb4101ae1c
[packages] / xemacs-packages / zenirc / src / zenirc-oink.el
1 ;;; zenirc-oink.el --- auto-oink
2
3 ;; Copyright (C) 1995, 1997 Noah S. Friedman
4
5 ;; Author: Noah Friedman <friedman@prep.ai.mit.edu>
6 ;; Maintainer: friedman@prep.ai.mit.edu
7 ;; Keywords: zenirc, extensions
8 ;; Created: 1995-04-09
9
10 ;; This program is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; any later version.
14 ;;
15 ;; This program is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 ;; GNU General Public License for more details.
19 ;;
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with this program; if not, you can either send email to this
22 ;; program's maintainer or write to: The Free Software Foundation,
23 ;; Inc.; 675 Massachusetts Avenue; Cambridge, MA 02139, USA.
24
25 ;;; Commentary:
26 ;;; Code:
27
28 (require 'zenirc-trigger)
29
30 (defconst zenirc-oink-response-percentage 1)
31
32 (defconst zenirc-oink-response-list
33   '("oink"
34     "oink!"
35     "oink."
36     "bozoink"
37     "oinkage"
38     "knio"
39     "you will be in your oink soon"
40     "don't say oink"
41     ":1 s/oink/oink oink/g; b 1"
42     ;; the oink combinator
43     "(define oink (lambda (oink?) ((lambda (oink) (oink? (lambda (oink!) ((oink oink) oink!)))) (lambda (oink) (oink? (lambda (oink!) ((oink oink) oink!)))))))"))
44
45 (defun zenirc-oink ()
46   (and (< (random 1000) zenirc-oink-response-percentage)
47        (nth (random (length zenirc-oink-response-list))
48             zenirc-oink-response-list)))
49
50 (zenirc-trigger-register "oink" 'zenirc-oink "oink\\|knio")
51
52 (provide 'zenirc-oink)
53
54 ;; zenirc-oink.el ends here