作者 Anonymous [lisp] 2012-04-28 21:53 (点击下载)

  1.  
  2. (defun ibot-log-hi (&rest ignore)
  3. "Add greeting hi message to ibot."
  4. (goto-char (point-min))
  5. (if (re-search-forward
  6. (concat "\(<\([^>]*\)>\)[[:space:]]+,say[[:space:]]*\(.*\)")
  7. nil t 1)
  8. (let ((nick (match-string-no-properties 2))
  9. (erc-hi-text (match-string-no-properties 3))
  10. )
  11. (if (not (string= erc-hi-text ""))
  12. (progn
  13. (with-temp-buffer
  14. (insert-file "~/.emacs.d/erc-hi.txt")
  15. (goto-char (point-min))
  16. (replace-regexp (concat "^" nick " :: " "\(.*\)n") "")
  17. (write-file "~/.emacs.d/erc-hi.txt")
  18. )
  19. (append-to-file (concat nick " :: " erc-hi-text "n") nil "~/.emacs.d/erc-hi.txt")
  20. (erc-send-message (concat nick ": SUCCESS! Next login i'll say '" erc-hi-text "' to you!")))
  21. (progn
  22. (with-temp-buffer
  23. (insert-file "~/.emacs.d/erc-hi.txt")
  24. (goto-char (point-min))
  25. (replace-regexp (concat "^" nick " :: " "\(.*\)n") "")
  26. (write-file "~/.emacs.d/erc-hi.txt")
  27. )
  28. (erc-send-message (concat nick ": Okay! I'll say nothing to you!")))
  29. ))))
  30.  
  31. (add-hook 'erc-insert-post-hook 'ibot-log-hi)

提交下面的校正或者修改. (点击这里开始一个新的帖子)
姓名: 在 cookie 中记住我的名字

屏幕抓图:(jpeg 或 png)