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燈, 水草

請輸入看板名稱,例如:Boy-Girl站內搜尋

TOP