chat.tin 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. #var lib_ui_chat[META] {
  2. {NAME} {聊天日志}
  3. {DESC} {抓取聊天信息,分置到不同的日志文件里去}
  4. {AUTHOR} {担子炮}
  5. };
  6. #var chat-channel {};
  7. #list chat-channel create {
  8. {{pattern}{求助} {action}{helpmeLog} {gag}{true}}
  9. {{pattern}{北侠QQ群} {action}{qqLog} {gag}{true}}
  10. {{pattern}{%!{闲聊|副本|谣言}} {action}{chatLog} {gag}{true}}
  11. {{pattern}{%!{江湖|任务|交易}} {action}{jhLog} {gag}{true}}
  12. {{pattern}{%!{队伍|门派|本地|区域}} {action}{bdLog} {gag}{true}}
  13. {{pattern}{私聊} {action}{tellLog} {gag}{false}}
  14. {{pattern}{%*} {action}{groupLog} {gag}{true}}
  15. };
  16. #func {lib_ui_chat.Init} {
  17. load-file {etc/ui-chat.tin};
  18. #return true;
  19. };
  20. #nop 普通聊天信息;
  21. #action {~^%c【%+2..5u】%c%*%+1..10u%c({[a-z A-Z]+})%c: %*$E} {
  22. chat.log {%2} {%0};
  23. } {4.994};
  24. #nop 单行的 emote 表情;
  25. #action {~{*UTF8}{?:^}%c【{\p{Han}{2,5}}】%*(%+1..S{| \S+} ||{| \S+} %+1..S)%c{|◆\p{Han}+◆}%c$E} {
  26. chat.log {%2} {%0};
  27. } {4.994};
  28. #nop 多行的 emote 表情;
  29. #action {~^%c【%+2..5u】%*$E} {
  30. chat.log-multi-line {%2} {%0};
  31. } {4.995};
  32. #alias {chat.log} {
  33. #local type {%1};
  34. #local text {%2};
  35. #local id {};
  36. #loop {1} {&chat-channel[]} {id} {
  37. #local pattern {$chat-channel[$id][pattern]};
  38. #local action {$chat-channel[$id][action]};
  39. #local gag {$chat-channel[$id][gag]};
  40. #if { "$type" == "$pattern" } {
  41. $action $text;
  42. #if { "$gag" == "true" } {
  43. #line gag;
  44. };
  45. #return;
  46. };
  47. };
  48. };
  49. #alias {chat.log-multi-line} {
  50. #local type {%1};
  51. #local text {%2};
  52. chat.log {$type} {$text};
  53. #if { "$type" != "{闲聊|求助|谣言}" } {
  54. #return;
  55. };
  56. #if { "$type" == "{闲聊|谣言}" && {$text} == {%* {\e\[0m}} } {
  57. #return;
  58. };
  59. #if { {$text} == {%c【求助】{我是大高手|大高手告诉|大高手说}%*} } {
  60. #return;
  61. };
  62. #if { {$text} == {%c【谣言】某人: 我看到了!!就是%*造的谣!!%c} } {
  63. #return;
  64. };
  65. #class chat.log open;
  66. #action {~^%*{|ID=chat.log}$} {
  67. chat.log {%1} {%%0};
  68. } {4.993};
  69. #action {~^%*(%w ||{| \S+} %+1..S)%c{|ID=chat.log}$} {
  70. chat.log {%1} {%%0};
  71. #class chat.log kill;
  72. } {4.992};
  73. #if { "$type" == "{闲聊|谣言}" } {
  74. #action {~^%* {\e\[0m}{|ID=chat.log}$} {
  75. chat.log {%1} {%%0};
  76. #class chat.log kill;
  77. } {4.992};
  78. };
  79. #delay chat.log {#class chat.log kill} 0;
  80. #class chat.log close;
  81. };
  82. #action {~^%c%u%c(%w)告诉你:%*$} {chat.log 私聊 {%0}} {9.999};
  83. #action {~^%c%u%c回答你:%*$} {chat.log 私聊 {%0}} {9.999};
  84. #action {~^%c你告诉%c%u%c:%*$} {chat.log 私聊 {%0}} {9.997};
  85. #action {~^%c你回答%c%u%c:%*$} {chat.log 私聊 {%0}} {9.997};
  86. #action {^关闭所有频道。$} {
  87. #class chat-turn-on open;
  88. #gag {^你现在并没有打开任何频道。$};
  89. #gag {^打开 %*频道。$};
  90. #gag {^你现在打开的频道:%*。$};
  91. #action {^目前你的频道使用情况如下:$} {
  92. #class chat-turn-on kill;
  93. };
  94. #class chat-turn-on close;
  95. #line gag;
  96. };
  97. event.HandleOnce {user-online} {chat/init} {ui/chat} {
  98. tune all;
  99. tune bd;
  100. tune chat;
  101. tune fb;
  102. tune group;
  103. tune helpme;
  104. tune jh;
  105. tune jy;
  106. tune mp;
  107. tune nation;
  108. tune qq;
  109. tune qy;
  110. tune rumor;
  111. tune rw;
  112. tune tt;
  113. tune;
  114. set learn_emote 1;
  115. };