;;Another Bot
(defun ibot-hello ()
"Hello someone when she/he say regexp something
This function should be in the insert-post-hook."
(goto-char (point-min))
(when (re-search-forward
(concat "\(<\([^>]*\)>\)" ; <someone> "<nickname>"
"\("
"\([ ]*\(hello\|hi\)[ ,.!?~;,。!~]?[ ]*$\)"
"\|"
"\(.*[木没]?有人[在]?[没不么吗].*\)"
"\|"
"\([^:,,]*[请]?[教问][一]?\(个问题\|一下\)[ ,.!?~;,。!~]?$\)"
"\|"
"\([ ]*\(test\|测试\|测试一下\|测试下\|试试\)[ ]*$\)"
"\|"
"\([ ]*[大各]+[位家]+好.*\)"
"\|"
"\(.*\(苍井空\|小月月\|凤姐\|芙蓉姐姐\).*\)"
"\|"
"\([ ]*[木灭l]?[o]?[l哈呵]+[ .,@#$%^&*;:'`/?!!~~]*$\)"
"\|"
"\([ ]*同志们.*好.*\)"
"\|"
"\(.*ylmf.*\)"
"\)"
)
nil t)
(when (and (not (string-equal (regexp-quote (erc-current-nick)) (match-string-no-properties 2)))
(not (erc-list-match erc-fools (match-string-no-properties 2)))
(not (erc-list-match erc-keywords (match-string-no-properties 2))))
(setq nick (match-string-no-properties 2))
;; (when (< 0 (length (match-string-no-properties 4))) ;; for hello,hi
;; (erc-send-message (concat nick ": " "hey,老大~ ;-)")))
(when (< 0 (length (match-string-no-properties 6))) ;有人么
;; (erc-send-message (concat nick ": " "你是MM不 ;-)")))
(erc-send-message (concat ": " "木有人!!! http://forum.ubuntu.org.cn/viewtopic.php?f=95&t=267605 ;)")))
(when (< 0 (length (match-string-no-properties 7)))
(erc-send-message (concat nick ": " "问呗,GG|MM http://forum.ubuntu.org.cn/viewtopic.php?f=95&t=267605 :-)")))
(when (< 0 (length (match-string-no-properties 9))) ;; for test
(erc-send-message (concat ": " (yow) " http://forum.ubuntu.org.cn/viewtopic.php?f=95&t=267605 :-)")))
(when (< 0 (length (match-string-no-properties 11))) ;大家好
(erc-send-message (concat nick ": " "你好~ http://forum.ubuntu.org.cn/viewtopic.php?f=95&t=267605 :)"))) ;ubuntu910教程。
(when (< 0 (length (match-string-no-properties 12)))
(erc-send-message (concat nick ": " "hoho~~>:-) :-(")))
;; (when (< 0 (length (match-string-no-properties 14)))
;; (erc-send-message (concat nick ": " "lol ;-)")))
(when (< 0 (length (match-string-no-properties 15)))
(erc-send-message (concat nick ": " "别。。俺真不是同志 :-(")))
(when (< 0 (length (match-string-no-properties 16)))
(erc-send-message (concat ": " "在这里谈雨淋麻风的, 要被tjjtds lol http://forum.ubuntu.org.cn/viewtopic.php?f=95&t=267605 ;-)")))
)))
(add-hook 'erc-insert-post-hook 'ibot-hello)
-