chat.tin 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. #function {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 {~^%c【%+2..5u】%*(%+1..S{| \S+} ||{| \S+} %+1..S)%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 { "$type" == "求助" && {$text} == {%c【求助】{我是大高手|大高手告诉|大高手说}%*} } {
  60. #return;
  61. };
  62. #class chat.log open;
  63. #action {~^%*{|ID=chat.log}$} {
  64. chat.log {%1} {%%0};
  65. } {4.993};
  66. #action {~^%*(%w ||{| \S+} %+1..S)%c{|ID=chat.log}$} {
  67. chat.log {%1} {%%0};
  68. #class chat.log kill;
  69. } {4.992};
  70. #if { "$type" == "{闲聊|谣言}" } {
  71. #action {~^%* {\e\[0m}{|ID=chat.log}$} {
  72. chat.log {%1} {%%0};
  73. #class chat.log kill;
  74. } {4.992};
  75. };
  76. #delay chat.log {#class chat.log kill} 0;
  77. #class chat.log close;
  78. };
  79. #action {~^%c%u%c(%w)告诉你:%*$} {chat.log 私聊 {%0}} {9.999};
  80. #action {~^%c%u%c回答你:%*$} {chat.log 私聊 {%0}} {9.999};
  81. #action {~^%c你告诉%c%u%c:%*$} {chat.log 私聊 {%0}} {9.997};
  82. #action {~^%c你回答%c%u%c:%*$} {chat.log 私聊 {%0}} {9.997};
  83. #action {^关闭所有频道。$} {
  84. #class chat-turn-on open;
  85. #gag {^你现在并没有打开任何频道。$};
  86. #gag {^打开 %*频道。$};
  87. #gag {^你现在打开的频道:%*。$};
  88. #action {^目前你的频道使用情况如下:$} {
  89. #class chat-turn-on kill;
  90. };
  91. #class chat-turn-on close;
  92. #line gag;
  93. };
  94. event.HandleOnce {user-online} {chat/init} {ui/chat} {
  95. tune all;
  96. tune bd;
  97. tune chat;
  98. tune fb;
  99. tune group;
  100. tune helpme;
  101. tune jh;
  102. tune jy;
  103. tune mp;
  104. tune nation;
  105. tune qq;
  106. tune qy;
  107. tune rumor;
  108. tune rw;
  109. tune tt;
  110. tune;
  111. set learn_emote 1;
  112. };