chat.tin 3.2 KB

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