仙境傳說|RO私服

 找回密碼
 註冊
搜索
熱搜: 活動 交友 discuz
查看: 15077|回復: 13
打印 上一主題 下一主題

使用plugin追查殺外掛的小白臉

[複製鏈接]
跳轉到指定樓層
1#
config 發表於 2010-12-13 18:22:17 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式

常常被殺的不明不白,被一堆死仙境傳說小白自以為正義亂殺外掛,現在使用plugin就可以把RO這些死小白找出來
讓這些自己為的小白抓出來,方法很簡單,首先在openkore裡面的 config.txt 中加入下列設定 (位置隨便都可以,我是加在" LOG 紀錄檔 (其它)"區域)

openkore設定第一
logDeath 1
# 是否要開啟角色死亡記錄,在 logs/deathlog.txt
# Plugin 功能,若 openkore/plugins/ 裡沒有 Autopsy.pl 的話此功能無效
logDeathSize 50
# 角色死亡記錄的行數,記錄死亡前幾行的訊息
deathMessage 您已經死了

將以下代碼存成 Autopsy.pl
置於 openkore 的 plugins 目錄裡面 (ex: c:\ok\plugins)

以下是openkore代碼:
# This software is open source, licensed under the GNU General Public
# License, version 2.
# Basically, this means that you're allowed to modify and distribute
# this software. However, if you distribute modified versions, you MUST
# also distribute the source code.

#Autopsy.pl
#Plugin by: PlayingSafe, Openkore
#Revision 3 by Rbin
#Openkore 2.0.0 (SVN) upper
#How to use
#At your config file put
#logDeath 1 <-- put 1 to enable logging
#logDeathSize # <--- put your desired number of lines to save
#deathMessage <-- put the "You have died" word on your local language if kore is set to local language
#example:
#logDeathSize 25 (this will save 25 lines of console messages)
#deathMessage You have died (Default language English)

package Autopsy;

use Utils;
use strict;
use Plugins;
use Globals;
use Settings;
use Log qw(message debug);

Plugins::register('Autopsy', 'Record console messages after bot died', \&unload);
my $cHook = Log::addHook(\&cHook, "DeathLog");

sub unload {
        Log::delHook('cHook', $cHook);
}

my @messages = ();

sub cHook {
        my $type = shift;
        my $domain = (shift or "console");
        my $level = (shift or 0);
        my $currentVerbosity = shift;
        my $message = shift;
        my $user_data = shift;
        my $logfile = shift;
        my $deathmsg = shift;
        my $location = shift;

if ($level <= $currentVerbosity && $config{'logDeath'} == 1) {

        my (undef, $microseconds) = Time::HiRes::gettimeofday;
        $microseconds = substr($microseconds, 0, 2);
        my $message2 = "[".getFormattedDate(int(time)).".$microseconds] ".$message;

        push(@messages, $message2);
        my $size = scalar @messages;
        if ($size == $config{'logDeathSize'} + 1) {
                        shift(@messages);
        }
        if ($config{logAppendUsername}) {
                $logfile = "$Settings::logs_folder/deathlog_$config{username}_$config{char}.txt";
        } else {
                $logfile = "$Settings::logs_folder/deathlog.txt";
        }
        $deathmsg = $config{'deathMessage'};
        if ($message =~ /$deathmsg/) {
                my $pos = calcPosition($char);
                $location = "\nYou died at " . $field->descName . " (" . $field->name . ") : $pos->{x}, $pos->{y}\n";
                                use encoding 'utf8';
                                open(DFILE, ">>:utf8", "$logfile"); {
                                print DFILE "\n*** Start of console death log ***\n\n";
                                print DFILE @messages;
                                print DFILE $location;
                                print DFILE "\n*** End of console death log ***\n\n";
                                close(DFILE);
                        }
                }
        }
}
return 1;


openkore下載
遊客,如果您要查看本帖隱藏內容請回復
2#
r11monkey 發表於 2011-1-26 01:13:38 | 只看該作者
感覺不錯唷
3#
r11monkey 發表於 2011-1-26 01:13:40 | 只看該作者
感覺不錯唷
4#
xiru2ly3rd88 發表於 2013-12-14 20:01:21 | 只看該作者
正困擾著阿~

感謝大大教學
5#
buono 發表於 2015-3-21 19:14:47 | 只看該作者
感謝大大 已苦惱很久
6#
3366789 發表於 2016-1-10 08:38:25 | 只看該作者
回覆看看   感謝大大
7#
k74927 發表於 2016-1-15 23:31:29 | 只看該作者
正好需要用的到~感謝分享
8#
Ryan 發表於 2016-2-3 05:00:44 | 只看該作者
來看看是怎麼一回事
9#
garth1900 發表於 2016-3-8 11:30:20 | 只看該作者
GOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOD
10#
j11477 發表於 2016-7-14 23:59:13 | 只看該作者
感謝分享  快來試用看看
11#
125566 發表於 2016-9-30 18:35:44 | 只看該作者
正需要這個呢!!!     感謝謝
12#
2305137d 發表於 2016-12-10 18:08:56 | 只看該作者
感謝分享  快來試用看看
14#
millerzan 發表於 2017-1-12 06:52:55 | 只看該作者
感謝大大無私的分享
馬上來用看看
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

小黑屋|手機版|Archiver|仙境傳說|RO私服

GMT+8, 2024-4-25 21:07 , Processed in 1.530648 second(s), 20 queries .

快速回復 返回頂部 返回列表