仙境傳說|RO私服

標題: 使用plugin追查殺外掛的小白臉 [打印本頁]

作者: config    時間: 2010-12-13 18:22
標題: 使用plugin追查殺外掛的小白臉

常常被殺的不明不白,被一堆死仙境傳說小白自以為正義亂殺外掛,現在使用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下載

作者: r11monkey    時間: 2011-1-26 01:13
感覺不錯唷
作者: r11monkey    時間: 2011-1-26 01:13
感覺不錯唷
作者: xiru2ly3rd88    時間: 2013-12-14 20:01
正困擾著阿~

感謝大大教學
作者: buono    時間: 2015-3-21 19:14
感謝大大 已苦惱很久
作者: 3366789    時間: 2016-1-10 08:38
回覆看看   感謝大大
作者: k74927    時間: 2016-1-15 23:31
正好需要用的到~感謝分享

作者: Ryan    時間: 2016-2-3 05:00
來看看是怎麼一回事
作者: garth1900    時間: 2016-3-8 11:30
GOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOD
作者: j11477    時間: 2016-7-14 23:59
感謝分享  快來試用看看
作者: 125566    時間: 2016-9-30 18:35
正需要這個呢!!!     感謝謝

作者: 2305137d    時間: 2016-12-10 18:08
感謝分享  快來試用看看
作者: 網路高手    時間: 2017-1-9 21:33
剛好需要
作者: millerzan    時間: 2017-1-12 06:52
感謝大大無私的分享
馬上來用看看




歡迎光臨 仙境傳說|RO私服 (http://ro.private-servers-game.com/) Powered by Discuz! X3.2