1 |
;;; erbot.el --- Another robot for ERC. |
;;; erbot.el --- Another robot for ERC. |
2 |
;; Time-stamp: <2005-08-31 11:35:11 deego> |
;; Time-stamp: <2005-09-02 15:08:03 deego> |
3 |
;; Emacs Lisp Archive entry |
;; Emacs Lisp Archive entry |
4 |
;; Filename: erbot.el |
;; Filename: erbot.el |
5 |
;; Package: erbot |
;; Package: erbot |
455 |
(erc-response.sender parsed)) |
(erc-response.sender parsed)) |
456 |
(t (aref parsed 1)))) |
(t (aref parsed 1)))) |
457 |
(userinfo (erc-parse-user sspec)) |
(userinfo (erc-parse-user sspec)) |
458 |
(nick (nth 0 userinfo)) |
(nick (erbutils-remove-text-properties-maybe (nth 0 userinfo))) |
459 |
;; bind fs-nick in a let.. so that changes to fs-nick are |
;; bind fs-nick in a let.. so that changes to fs-nick are |
460 |
;; independent and do not affect each other.. when it is |
;; independent and do not affect each other.. when it is |
461 |
;; parsing too many messages once.. |
;; parsing too many messages once.. |
462 |
(fs-nick nick) |
(fs-nick nick) |
463 |
(erbn-nick nick) |
(erbn-nick fs-nick) |
464 |
(cmdargs (and erbot-on-new-erc-p |
(cmdargs (and erbot-on-new-erc-p |
465 |
(erc-response.command-args parsed))) |
(erc-response.command-args parsed))) |
466 |
(tgta (cond (cmdargs |
(tgta |
467 |
(nth 0 cmdargs)) |
(erbutils-remove-text-properties-maybe |
468 |
(t (aref parsed 2)))) |
(cond (cmdargs |
469 |
|
(nth 0 cmdargs)) |
470 |
|
(t (aref parsed 2))))) |
471 |
(tgt (if (equalp tgta (or (erc-current-nick) erbot-nick)) |
(tgt (if (equalp tgta (or (erc-current-nick) erbot-nick)) |
472 |
nick |
nick |
473 |
tgta)) |
tgta)) |
474 |
(erbn-tgt tgt) |
(erbn-tgt tgt) |
475 |
(fs-tgt tgt) |
(fs-tgt tgt) |
476 |
(msg (cond (cmdargs |
(msg |
477 |
(nth 1 cmdargs)) |
(erbutils-remove-text-properties-maybe |
478 |
(t (aref parsed 3)))) |
(cond (cmdargs |
479 |
|
(nth 1 cmdargs)) |
480 |
|
(t (aref parsed 3))))) |
481 |
(erbot-end-user-nick nick) |
(erbot-end-user-nick nick) |
482 |
) |
) |
483 |
;; changing the structure here.. |
;; changing the structure here.. |
523 |
(while (re-search-forward "\n" nil t) |
(while (re-search-forward "\n" nil t) |
524 |
(replace-match |
(replace-match |
525 |
(concat "\n" erbot-init-string) nil t)) |
(concat "\n" erbot-init-string) nil t)) |
526 |
(concat erbot-init-string (buffer-string)))))) |
(concat erbot-init-string (erbutils-buffer-string)))))) |
527 |
|
|
528 |
(defvar erbot-init-string "" |
(defvar erbot-init-string "" |
529 |
"The basic init string.. should be concated to ALL lines of |
"The basic init string.. should be concated to ALL lines of |