1 |
;;; erbc.el --- Erbot user-interface commands. |
;;; erbc.el --- Erbot user-interface commands. |
2 |
;; Time-stamp: <2005-01-23 23:19:33 deego> |
;; Time-stamp: <2005-01-24 08:00:32 deego> |
3 |
;; Copyright (C) 2002 D. Goel |
;; Copyright (C) 2002 D. Goel |
4 |
;; Emacs Lisp Archive entry |
;; Emacs Lisp Archive entry |
5 |
;; Filename: erbc.el |
;; Filename: erbc.el |
1276 |
|
|
1277 |
|
|
1278 |
(defun fsi-eval-or-say (str &optional fs-victim) |
(defun fsi-eval-or-say (str &optional fs-victim) |
|
(unless fs-victim (setq fs-victim fs-nick)) |
|
1279 |
(let ((aa (when (stringp str) |
(let ((aa (when (stringp str) |
1280 |
(ignore-errors (read str))))) |
(ignore-errors (read str))))) |
1281 |
(cond |
(cond |
1282 |
((consp aa) (fsi-eval aa)) |
((consp aa) |
1283 |
(t (format "%s: %s" fs-victim str))))) |
(unless fs-victim (setq fs-victim fs-nick)) |
1284 |
|
(fsi-eval aa)) |
1285 |
|
(fs-victim |
1286 |
|
(format "%s: %s" fs-victim str)) |
1287 |
|
(t |
1288 |
|
(format "%s" str))))) |
1289 |
|
|
1290 |
|
|
1291 |
|
|
1292 |
|
|
1293 |
|
|
1294 |
|
|
1298 |
(if (first args) |
(if (first args) |
1299 |
(format "%s" (first args)) |
(format "%s" (first args)) |
1300 |
erbot-end-user-nick)) |
erbot-end-user-nick)) |
1301 |
|
(num (second args)) |
1302 |
(flames (ignore-errors (fs-notes "flames")))) |
(flames (ignore-errors (fs-notes "flames")))) |
1303 |
(if (string= (format "%s" fs-flame-target) "me") |
(if (string= (format "%s" fs-flame-target) "me") |
1304 |
(setq fs-flame-target erbot-end-user-nick)) |
(setq fs-flame-target erbot-end-user-nick)) |
1305 |
;; Check for flame.el support |
;; Check for flame.el support |
1306 |
(cond |
(cond |
1307 |
((and (consp flames) (> (length flames) 0)) |
((and (consp flames) (> (length flames) 0)) |
1308 |
(fsi-eval-or-say (fs-random-choose flames) fs-flame-target)) |
(fsi-eval-or-say |
1309 |
|
(if (numberp num) |
1310 |
|
(nth num flames) |
1311 |
|
(fs-random-choose flames)) |
1312 |
|
fs-flame-target)) |
1313 |
(t (fs-flame-mild fs-flame-target))))) |
(t (fs-flame-mild fs-flame-target))))) |
1314 |
|
|
1315 |
|
|
1316 |
|
|
1317 |
|
|
1318 |
|
|
1319 |
|
|
1320 |
(defun fs-flame-mild (&rest args) |
(defun fs-flame-mild (&rest args) |
1321 |
"Doesn't really flame right now.. |
"Doesn't really flame right now.. |