| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- #var lib_ui_chat[META] {
- {NAME} {聊天日志}
- {DESC} {抓取聊天信息,分置到不同的日志文件里去}
- {AUTHOR} {担子炮}
- };
- #var chat-channel {};
- #list chat-channel create {
- {{pattern}{求助} {action}{helpmeLog} {gag}{true}}
- {{pattern}{北侠QQ群} {action}{qqLog} {gag}{true}}
- {{pattern}{%!{闲聊|副本|谣言}} {action}{chatLog} {gag}{true}}
- {{pattern}{%!{江湖|任务|交易}} {action}{jhLog} {gag}{true}}
- {{pattern}{%!{队伍|门派|本地|区域}} {action}{bdLog} {gag}{true}}
- {{pattern}{私聊} {action}{tellLog} {gag}{false}}
- {{pattern}{%*} {action}{groupLog} {gag}{true}}
- };
- #func {lib_ui_chat.Init} {
- load-file {etc/ui-chat.tin};
- #return true;
- };
- #nop 普通聊天信息;
- #action {~^%c【%+2..5u】%c%*%+1..10u%c({[a-z A-Z]+})%c: %*$E} {
- chat.log {%2} {%0};
- } {4.994};
- #nop 单行的 emote 表情;
- #action {~{*UTF8}{?:^}%c【{\p{Han}{2,5}}】%*(%+1..S{| \S+} ||{| \S+} %+1..S)%c{|◆\p{Han}+◆}%c$E} {
- chat.log {%2} {%0};
- } {4.994};
- #nop 多行的 emote 表情;
- #action {~^%c【%+2..5u】%*$E} {
- chat.log-multi-line {%2} {%0};
- } {4.995};
- #alias {chat.log} {
- #local type {%1};
- #local text {%2};
- #local id {};
- #loop {1} {&chat-channel[]} {id} {
- #local pattern {$chat-channel[$id][pattern]};
- #local action {$chat-channel[$id][action]};
- #local gag {$chat-channel[$id][gag]};
- #if { "$type" == "$pattern" } {
- $action $text;
- #if { "$gag" == "true" } {
- #line gag;
- };
- #return;
- };
- };
- };
- #alias {chat.log-multi-line} {
- #local type {%1};
- #local text {%2};
- chat.log {$type} {$text};
- #if { "$type" != "{闲聊|求助|谣言}" } {
- #return;
- };
- #if { "$type" == "{闲聊|谣言}" && {$text} == {%* {\e\[0m}} } {
- #return;
- };
- #if { {$text} == {%c【求助】{我是大高手|大高手告诉|大高手说}%*} } {
- #return;
- };
- #if { {$text} == {%c【谣言】某人: 我看到了!!就是%*造的谣!!%c} } {
- #return;
- };
- #class chat.log open;
- #action {~^%*{|ID=chat.log}$} {
- chat.log {%1} {%%0};
- } {4.993};
- #action {~^%*(%w ||{| \S+} %+1..S)%c{|ID=chat.log}$} {
- chat.log {%1} {%%0};
- #class chat.log kill;
- } {4.992};
- #if { "$type" == "{闲聊|谣言}" } {
- #action {~^%* {\e\[0m}{|ID=chat.log}$} {
- chat.log {%1} {%%0};
- #class chat.log kill;
- } {4.992};
- };
- #delay chat.log {#class chat.log kill} 0;
- #class chat.log close;
- };
- #action {~^%c%u%c(%w)告诉你:%*$} {chat.log 私聊 {%0}} {9.999};
- #action {~^%c%u%c回答你:%*$} {chat.log 私聊 {%0}} {9.999};
- #action {~^%c你告诉%c%u%c:%*$} {chat.log 私聊 {%0}} {9.997};
- #action {~^%c你回答%c%u%c:%*$} {chat.log 私聊 {%0}} {9.997};
- #action {^关闭所有频道。$} {
- #class chat-turn-on open;
- #gag {^你现在并没有打开任何频道。$};
- #gag {^打开 %*频道。$};
- #gag {^你现在打开的频道:%*。$};
- #action {^目前你的频道使用情况如下:$} {
- #class chat-turn-on kill;
- };
- #class chat-turn-on close;
- #line gag;
- };
- event.HandleOnce {user-online} {chat/init} {ui/chat} {
- tune all;
- tune bd;
- tune chat;
- tune fb;
- tune group;
- tune helpme;
- tune jh;
- tune jy;
- tune mp;
- tune nation;
- tune qq;
- tune qy;
- tune rumor;
- tune rw;
- tune tt;
- tune;
- set learn_emote 1;
- };
|