chat.tin 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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. #if { {$text} == {%*天空中突然闪出一道绚丽的火花%*} } {
  55. #class chat.log open;
  56. #action {~^%*{|ID=chat.log}$} {
  57. chat.log {%1} {%%0};
  58. } {4.993};
  59. #action {~^%c{\e\[2;37;0m|}\e[36m{|\e\[2;37;0m }{|\e\[0m}{|ID=chat.log}$} {
  60. chat.log {%1} {%%0};
  61. #class chat.log kill;
  62. } {4.992};
  63. #class chat.log close;
  64. };
  65. };
  66. #if { "$type" == "江湖" } {
  67. #if { {$text} == {%*神力和纵跃排行榜%*} } {
  68. #class chat.log open;
  69. #action {~^%*{|ID=chat.log}$} {
  70. chat.log {%1} {%%0};
  71. } {4.993};
  72. #action {~^%c{[' -]+}\e[2;37;0m {|\e\[0m}{|ID=chat.log}$} {
  73. chat.log {%1} {%%0};
  74. #class chat.log kill;
  75. } {4.992};
  76. #class chat.log close;
  77. };
  78. #elseif { {$text} == {%*{[^m )]}\e[0m} } {
  79. #local lines {1};
  80. #if { {$text} == {%*请大家挖泥之余去各大BBS和论坛宣传北大侠客行,宣传内容详见%*} } {
  81. #local lines {2};
  82. };
  83. #line multishot $lines #action {~^%*{|ID=chat.log}$} {
  84. chat.log {%1} {%%0};
  85. } {4.993};
  86. };
  87. #return;
  88. };
  89. #if { "$type" != "{闲聊|求助|谣言}" } {
  90. #return;
  91. };
  92. #if { "$type" == "{闲聊|谣言}" && {$text} == {%* {\e\[0m}} } {
  93. #return;
  94. };
  95. #if { {$text} == {%c【求助】{我是大高手|大高手告诉|大高手说}%*} } {
  96. #return;
  97. };
  98. #if { {$text} == {%c【谣言】某人: 我看到了!!就是%*造的谣!!%c} } {
  99. #return;
  100. };
  101. #class chat.log open;
  102. #action {~^%*{|ID=chat.log}$} {
  103. chat.log {%1} {%%0};
  104. } {4.993};
  105. #action {~^%*(%w ||{| \S+} %+1..S)%c{|ID=chat.log}$} {
  106. chat.log {%1} {%%0};
  107. #class chat.log kill;
  108. } {4.992};
  109. #if { "$type" == "{闲聊|谣言}" } {
  110. #action {~^%*{\S \e\[0m}{|ID=chat.log}$} {
  111. chat.log {%1} {%%0};
  112. #class chat.log kill;
  113. } {4.992};
  114. };
  115. #delay chat.log {#class chat.log kill} 0;
  116. #class chat.log close;
  117. };
  118. #action {~^%c%u%c(%w)告诉你:%*$} {chat.log 私聊 {%0}} {9.999};
  119. #action {~^%c%u%c回答你:%*$} {chat.log 私聊 {%0}} {9.999};
  120. #action {~^%c你告诉%c%u%c:%*$} {chat.log 私聊 {%0}} {9.997};
  121. #action {~^%c你回答%c%u%c:%*$} {chat.log 私聊 {%0}} {9.997};
  122. #action {^关闭所有频道。$} {
  123. #class chat-turn-on open;
  124. #gag {^你现在并没有打开任何频道。$};
  125. #gag {^打开 %*频道。$};
  126. #gag {^你现在打开的频道:%*。$};
  127. #action {^目前你的频道使用情况如下:$} {
  128. #class chat-turn-on kill;
  129. };
  130. #class chat-turn-on close;
  131. #line gag;
  132. };
  133. event.HandleOnce {user-online} {chat/init} {ui/chat} {
  134. tune all;
  135. tune bd;
  136. tune chat;
  137. tune fb;
  138. tune group;
  139. tune helpme;
  140. tune jh;
  141. tune jy;
  142. tune mp;
  143. tune nation;
  144. tune qq;
  145. tune qy;
  146. tune rumor;
  147. tune rw;
  148. tune tt;
  149. tune;
  150. set learn_emote 1;
  151. };