mud_sanc 板


LINE

这个东西其实就在plugin里面,只是没预载,你必须手动挂上去。 挂上去以後的log档纪录就会有ANSI色码,不过之前的好像不会有。 名称是Ansi_Log.xml。 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE muclient [ <!ENTITY PreserveLineBreaksWanted "vbTrue" > <!ENTITY LogOutputWanted "vbTrue" > <!ENTITY LogCommandsWanted "vbTrue" > ]> <!-- Saved on Friday, July 25, 2003, 10:50 AM --> <!-- MuClient version 3.42 --> <!-- Plugin "ANSI_Log" generated by Plugin Wizard --> <!-- You can change the entities at the top to control the way it works. PreserveLineBreaksWanted = Whether or not each line ends with a hard carriage return LogOutputWanted = Whether output from the MUD is to be logged LogCommandsWanted = Whether commands you type are to be logged vbTrue = yes vbFalse = no --> <muclient> <plugin name="ANSI_Log" author="Nick Gammon" id="08025212f70f54d3bb25dd02" language="VBscript" purpose="Logs commands and MUD output using ANSI colours" date_written="2003-07-25 10:45:39" requires="3.35" version="1.0" > <description trim="y"> <![CDATA[ Once installed, this plugin will log player commands, and output from the MUD, to the current log file using ANSI colour sequences. As far as possible, the plugin will try to match the colours on the output lines to existing ANSI codes (this may fail if you are using MXP and the MUD sends non-ANSI colours). It then generates the appropriate ANSI code and writes it to the log file. The trigger and alias in the plugin set the "omit from log" flags so the lines are not logged twice. They are set to "keep evaluating" so that other triggers and aliases are still processed. ]]> </description> </plugin> <!-- Triggers --> <triggers> <trigger enabled="y" keep_evaluating="y" match="^.*$" name="ansi_log" omit_from_log="y" regexp="y" script="LogOutput" sequence="5" > </trigger> </triggers> <!-- Aliases --> <aliases> <alias name="ansi_log" script="LogCommand" match="^.*$" enabled="y" omit_from_log="y" regexp="y" keep_evaluating="y" sequence="5" > <send>%0</send> </alias> </aliases> <!-- Script --> <script> dim PreserveLineBreaksWanted PreserveLineBreaksWanted = &PreserveLineBreaksWanted; dim LogOutputWanted LogOutputWanted = &LogOutputWanted; dim LogCommandsWanted LogCommandsWanted = &LogCommandsWanted; <![CDATA[ ' ' Helper function to output code for bold, underline etc. ' Function DoExtra (is_set, was_set, on_code, off_code) DoExtra = "" If is_set And (not was_set) Then DoExtra = ANSI (on_code) ' send setting code ElseIf (Not is_set) And (was_set) Then DoExtra = ANSI (off_code) ' send resetting code End If ' need to un-set it End Function ' log in ANSI colours (call from trigger/alias that matches everything) ' sub LogOutput (name, matchingline, wildcards) dim firstline, lastline, line, style, styles dim logline, colour, target, bold, column dim normal (8) dim hilite (8) dim lastfore, lastback, lastbold dim lastul, lastblink, lastinverse dim ul, blink, inverse dim i ' ' Not necessary if logging not active or not wanted ' If (Not IsLogOpen) Or (not LogOutputWanted) Then Exit Sub End If ' find which line this is lastline = GetLinesInBufferCount ' now find the first line in this paragraph firstline = lastline - 1 do while firstline > 0 if GetLineInfo (firstline, 3) then exit do end if firstline = firstline - 1 loop ' end while loop - finding start of paragraph ' ' paragraph starts with first line *past* the previous newline ' firstline = firstline + 1 ' ' paragraph can't end past where it started ' if firstline > lastline then firstline = lastline ' ' discard world.notes and user input ' if GetLineInfo (firstline, 4) then exit sub ' note line if GetLineInfo (firstline, 5) then exit sub ' input line ' ' Empty lines are a special and simple case ' if firstline = lastline and GetLineInfo (firstline, 2) = 0 then WriteLog "" ' just write the blank line Exit Sub end if ' ' find what the ANSI colours are for this world ' for i = 1 to 8 normal (i) = NormalColour (i) ' normal hilite (i) = BoldColour (i) ' highlight next ' ' process entire paragraph ' logline = logline & ANSI (0) ' reset all styles lastfore = 37 ' reset is white lastback = 40 ' on black lastbold = vbFalse lastul = vbFalse lastblink = vbFalse lastinverse = vbFalse for line = firstline to lastline styles = GetLineInfo (line, 11) ' how many styles ' process all styles runs in this line ' ' ' find text style (ANSI code) ' target = GetStyleInfo (line, style, 14) ' RGB colour of style text colour = -1 bold = vbFalse ' ' work out which ANSI colour it must have been by a scan ' for i = 1 to 8 ' normal colour if target = normal (i) then colour = 29 + i exit for end if ' bold colour if target = hilite (i) then colour = 29 + i bold = vbTrue exit for end if next ' colour ' ' if found, output that colour ' if colour <> -1 then ' ' only output if colour change ' if colour <> lastfore then logline = logline & ANSI (colour) lastfore = colour end if end if ' colour found logline = logline & DoExtra (bold, lastbold, 1, 22) lastbold = bold target = GetStyleInfo (line, style, 15) ' RGB colour of style background colour = -1 ' ' work out which ANSI colour it must have been by a scan ' for i = 1 to 8 ' normal colour if target = normal (i) then colour = 39 + i exit for end if next ' colour ' ' if found, output that colour ' if colour <> -1 then ' ' only output if colour change ' if colour <> lastback then logline = logline & ANSI (colour) lastback = colour end if ' ' do other styles (underline, blink, inverse) ' bold = GetStyleInfo (line, style, 8) ' bold flag logline = logline & DoExtra (bold, lastbold, 1, 22) lastbold = bold ul = GetStyleInfo (line, style, 9) ' underline flag logline = logline & DoExtra (ul, lastul, 4, 24) lastul = ul blink = GetStyleInfo (line, style, 10) ' blink flag logline = logline & DoExtra (blink, lastblink, 3, 23) lastblink = blink inverse = GetStyleInfo (line, style, 11) ' inverse flag logline = logline & DoExtra (inverse, lastinverse, 7, 27) lastinverse = inverse ' ' now output the text ' logline = logline & GetStyleInfo (line, style, 1) next ' process the next style ' ' If wanted, keep the original (soft) line breaks ' If PreserveLineBreaksWanted And line <> lastline Then logline = logline & vbCrLf End If next ' end for loop - processing each line in the paragraph WriteLog logline end sub ' end of LogOutput sub LogCommand (name, matchingline, wildcards) ' ' Not necessary if logging not active or not wanted ' If (Not IsLogOpen) Or (not LogCommandsWanted) Then Exit Sub End If ' ' simply log in default ANSI colours ' WriteLog ANSI (0) & matchingline end sub ]]> </script> </muclient> --



※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.132.196.45
1F:→ hmml :实务上,这个会和很多东西相冲(如alias),所以没使 06/09 01:12
2F:→ hmml :用的时候,建议先Disable。 06/09 01:12







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:BabyMother站内搜寻

TOP