Боты для Рагнарок

Информация о пользователе

Привет, Гость! Войдите или зарегистрируйтесь.


Вы здесь » Боты для Рагнарок » Макросы » Плагины....


Плагины....

Сообщений 1 страница 7 из 7

1

Предлагаю скидывать сюда плагины и макросы.....
Знаю такая тема гдето была НО...ТАМ СТОКА ФЛУДА...что Х*Й что найдеш
Здесь писать тока плагины\макросы и НИЧЕГО КРОМЕ!!!!!!!
Пример ниже....
ЗЫ
Добавте ето в кофиг(проста не помню чток чему.....=)

recordWarpNpc_integrate 1
recordWarpNpc_recompile 1
logDeath 1
logAppendUsername 1
logDeathSize 25
macro_nowarn 0
macro_filen macros.txt
macro_orphans reregister
logExp 1
logInventory 1
logStorage 0
logSt 1
logStatus 1
autoIdentify 1

Отредактировано MERKATOR (2006-08-19 04:06:18)

2

Полезнейший плагин --Показывает Списокт Склада ввиде HTML-страницы
хранится страницавм LOGS
***************************************************************************

############################################################
#
# storagelog
# By: MindChild
# unload fixed by: Joseph (thanks Joseph ^^)
#
# hooks revised to use addHooks by MindChild
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#

package storagelog;

use strict;
use Plugins;
use Settings;
use Globals;
use Log;

Plugins::register('storagelog', 'creates an HTML storage log in username_storage.html', \&Unload);
my $hooks = Plugins::addHooks(
['packet_storage_open', \&storageLog, undef],
['packet_storage_added', \&storageLog, undef],
['packet_storage_close', \&storageLog, undef]
);

sub Unload {
Plugins::delHooks($hooks);
}

sub storageLog {
return if ($::config{'storageLogOff'});
my $storage_log_file = "$Settings::logs_folder/$::config{'username'}_storage.html";
open STORAGELOG, "> $storage_log_file";
print STORAGELOG "<HTML><BODY><TABLE>";
print STORAGELOG "<tr bgcolor=\"#C0C0C0\"><td>&nbsp;</td><th>Storage</th><td>&nbsp;</td></tr>\n";
print STORAGELOG "<tr bgcolor=\"#808080\"><td>Storage ID</td><td>Item Name</td><td>Amount</td></tr>\n";
for (my $i = 0; $i < @::storageID; $i++) {

next if ($::storageID[$i] eq "");
my $display = "$::storage{$::storageID[$i]}{'name'}";
if ($::storage{$::storageID[$i]}{'enchant'}) {
$display = "+$::storage{$::storageID[$i]}{'enchant'} ".$display;
}
if ($::storage{$::storageID[$i]}{'slotName'} ne "") {
$display = $display ." [$::storage{$::storageID[$i]}{'slotName'}]";
}

$display = "<tr bgcolor=\"#fffde8\"><td>$i</td><td>" . $display . "</td><td>$::storage{$::storageID[$i]}{'amount'}</td></tr>\n";

print STORAGELOG $display;

}
print STORAGELOG "<tr><td></td><td>Capacity: </td><td>$::storage{'items'}/$::storage{'items_max'}</td></tr>\n";
print STORAGELOG "</table></body></html>";
close STORAGELOG;
}

return 1;

3

Сохраняет полный отчет...типа

------------Exp Report------------
Botting time : 11 hours 13 minutes 41 seconds
BaseExp      : 139,352 (217.60%)
JobExp       : 85,911 (163.90%)
BaseExp/Hour : 12,411 (19.38%)
JobExp/Hour  : 7,651 (14.60%)
Zenny        : -180
Zenny/Hour   : -16
Base Levelup Time Estimation : 23 minutes 31 seconds
Job Levelup Time Estimation  : 1 hours 44 minutes 53 seconds
Died : 2
Bytes Sent   : 390,999
Bytes Rcvd   : 7,765,286
---------------------------------

сохранить как logExp.pl
***************************************
##########################
# Licensed by iheartopenkore under GPL
package logExp;

use strict;
use Exporter;
use warnings;

use Globals;
use Log qw(message debug error warning);
use Network::Send;
use Settings;
use Plugins;
use Skills;
use Utils;
use Misc;
use AI;
use Match;
use Interface;

Plugins::register('logExp', 'creates text file of experience', \&Unload);

my$hooks = Plugins::addHooks(
['packet/exp_zeny_info', \&ai_hook, undef],
['packet/party_exp', \&ai_hook, undef]
);

sub unload {
Plugins::delHooks($hooks);
message "logExp plugin unloaded";
}

sub ai_hook {
logExp();
}

sub logExp {
if ($config{'logExp'}) {
my ($endTime_EXP, $w_sec, $bExpPerHour, $jExpPerHour, $EstB_sec, $percentB, $percentJ, $zennyMade, $zennyPerHour, $EstJ_sec, $percentJhr, $percentBhr);
$endTime_EXP = time;
$w_sec = int($endTime_EXP - $startTime_EXP);
if ($w_sec > 0) {
$zennyMade = $char->{zenny} - $startingZenny;
$bExpPerHour = int($totalBaseExp / $w_sec * 3600);
$jExpPerHour = int($totalJobExp / $w_sec * 3600);
$zennyPerHour = int($zennyMade / $w_sec * 3600);
if ($char->{exp_max} && $bExpPerHour){
$percentB = "(".sprintf("%.2f",$totalBaseExp * 100 / $char->{exp_max})."%)";
$percentBhr = "(".sprintf("%.2f",$bExpPerHour * 100 / $char->{exp_max})."%)";
$EstB_sec = int(($char->{exp_max} - $char->{exp})/($bExpPerHour/3600));
}
if ($char->{exp_job_max} && $jExpPerHour){
$percentJ = "(".sprintf("%.2f",$totalJobExp * 100 / $char->{exp_job_max})."%)";
$percentJhr = "(".sprintf("%.2f",$jExpPerHour * 100 / $char->{exp_job_max})."%)";
$EstJ_sec = int(($char->{'exp_job_max'} - $char->{exp_job})/($jExpPerHour/3600));
}
}
$char->{deathCount} = 0 if (!defined $char->{deathCount});
my $msg = "------------Exp Report------------\n";
$msg .= "Botting time : " . timeConvert($w_sec) . "\n";
$msg .= "BaseExp      : " . formatNumber($totalBaseExp) . " $percentB\n";
$msg .= "JobExp       : " . formatNumber($totalJobExp) . " $percentJ\n";
$msg .= "BaseExp/Hour : " . formatNumber($bExpPerHour) . " $percentBhr\n";
$msg .= "JobExp/Hour  : " . formatNumber($jExpPerHour) . " $percentJhr\n";
$msg .= "Zenny        : " . formatNumber($zennyMade) . "\n";
$msg .= "Zenny/Hour   : " . formatNumber($zennyPerHour) . "\n";
$msg .= "Base Levelup Time Estimation : " . timeConvert($EstB_sec) . "\n";
$msg .= "Job Levelup Time Estimation  : " . timeConvert($EstJ_sec) . "\n";
$msg .= "Died : $char->{'deathCount'}\n";
$msg .= "Bytes Sent   : " . formatNumber($bytesSent) . "\n";
$msg .= "Bytes Rcvd   : " . formatNumber($bytesReceived) . "\n", "info" . "\n";
$msg .= "---------------------------------\n";

open(F, ">$Settings::logs_folder/exp.txt");
print F $msg;
close(F);
message "[logExp] Experience Logged\n"
}
}

return 1;

4

Сохранить как  reactOnNPC.pl

# =======================
# reactOnNPC v.1.1.1
# =======================
# This plugin is licensed under the GNU GPL
# Copyright 2006 by hakore
#По етому адресу все описывается куда-и что!!!(англ)
# http://forums.openkore.com/viewtopic.php?t=19973

package reactOnNPC;

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

Plugins::register('reactOnNPC', "react on NPC messages", \&Unload);

my $hooks = ((substr($Settings::VERSION, 0, 3) >= 1.9) ?
Plugins::addHooks(
            ['packet/npc_talk', \&onNPCTalk, undef],
            ['packet/npc_talk_close', \&onNPCAction, undef],
            ['packet/npc_talk_continue', \&onNPCAction, undef],
            ['packet/npc_talk_number', \&onNPCAction, undef],
            ['packet/npc_talk_responses', \&onNPCAction, undef],
            ['packet/npc_talk_text', \&onNPCAction, undef]
) :
Plugins::addHooks(
            ['parseMsg/pre', \&onParseMsg,
        {
        '00B4' => [\&onNPCTalk, 'packet/npc_talk'],
        '00B5' => [\&onNPCAction, 'packet/npc_talk_continue'],
        '00B6' => [\&onNPCAction, 'packet/npc_talk_close'],
        '00B7' => [\&onNPCAction, 'packet/npc_talk_responses'],
        '0142' => [\&onNPCAction, 'packet/npc_talk_number'],
        '01D4' => [\&onNPCAction, 'packet/npc_talk_text']
        }
    ]
)
);

my %reactOnNPC;

sub Unload
{
Plugins::delHooks($hooks);
};

sub onNPCTalk
{
my (undef, $args) = @_;
my $ID = unpack("V", substr($args->{RAW_MSG}, 4, 4));
my $msg = unpack("Z*", substr($args->{RAW_MSG}, 8));
if ((substr($Settings::VERSION, 0, 3) >= 1.9) && (substr($Settings::VERSION, 4) >= 1))
{
    $msg = I18N::bytesToString($msg);
}

if (!defined %reactOnNPC || $reactOnNPC{action})
{
    undef %reactOnNPC if defined %reactOnNPC;
    $reactOnNPC{index} = 0;
    $reactOnNPC{ID} = $ID;
    $reactOnNPC{msg}[$reactOnNPC{index}] = $msg;
}
else
{
    $reactOnNPC{index}++;
    $reactOnNPC{msg}[$reactOnNPC{index}] = $msg;
}
debug "[reactOnNPC] NPC message saved ($reactOnNPC{index}): \"$msg\".\n", "reactOnNPC";
}

sub onNPCAction
{
my $type = substr(shift, 16);
$reactOnNPC{action} = $type;
debug "[reactOnNPC] onNPCAction type is: $type.\n", "reactOnNPC";

if ($type eq 'responses')
{
    my $args = shift;
    my $msg = unpack("Z*", substr($args->{RAW_MSG}, 8));
    if ((substr($Settings::VERSION, 0, 3) >= 1.9) && (substr($Settings::VERSION, 4) >= 1))
    {
    $msg = I18N::bytesToString($msg);
    }
    undef @{$reactOnNPC{responses}};
    my @responses = split /:/, $msg;
    foreach (@responses) {
    push @{$reactOnNPC{responses}}, $_ if $_ ne "";
    }
}

my $i = 0;
while (exists $config{"reactOnNPC_$i"}) {
    if (
    !$config{"reactOnNPC_$i"}
    || !main::checkSelfCondition("reactOnNPC_$i")
    || ($config{"reactOnNPC_${i}_type"} && $config{"reactOnNPC_${i}_type"} ne $type)
    ) {
    debug "[reactOnNPC] Conditions for reactOnNPC_$i not met.\n", "reactOnNPC";
    $i++;
    next;
    }
    my $j = 0;
    my $ok = 1;
    while (exists $config{"reactOnNPC_${i}_msg_$j"})
    {
    my $msg;
    if (exists $reactOnNPC{msg}[$j])
    {
        $msg = $reactOnNPC{msg}[$j];
        # Remove RO color codes
        $msg =~ s/\^[a-fA-F0-9]{6}//g unless ($config{"reactOnNPC_${i}_useColors"});
    }

    if (!defined $msg || !match($j, $msg, $config{"reactOnNPC_${i}_msg_$j"}))
    {
        debug "[reactOnNPC] One or more lines doesn't match for \"reactOnNPC_$i\" ($j).\n", "reactOnNPC";
        $ok = 0;
        last;
    }
    $j++;
    }

    if ($ok)
    {
    my $cmd = $config{"reactOnNPC_$i"};
    $cmd =~ s/#(\d+)~(\d+)/$reactOnNPC{match}[$1][$2]/g;
    my $kws = 'eval|resp';
    while (my ($kw, $expr) = $cmd =~ /\@($kws)\(((?:(?!(?<!\@)\@$kws\().)+?)(?<!\@)\)/)
    {
        my $eval;
        my $eval_expr = $expr;
        $eval_expr =~ s/\@(?=[\@)])//g;
        if ($kw eq 'eval')
        {
        $eval = eval $eval_expr;
        }
        elsif ($kw eq 'resp')
        {
        $i = 0;
        foreach (@{$reactOnNPC{responses}}) {
            if (match(undef, $_, $eval_expr))
            {
            last;
            }
            $i++;
        }
        $eval = $i;
        }
        $expr = quotemeta $expr;
        $cmd =~ s/\@$kw\($expr\)/$eval/g;
    }
    message "[reactOnNPC] Reacting to NPC. Executing command \"$cmd\".\n", "success";
    Commands::run($cmd);
    last;
    }
    $i++;
}
undef %reactOnNPC if $type eq 'close';
}

sub match
{
my ($line, $subject, $pattern) = @_;

debug "[reactOnNPC] Matching \"$subject\" to \"$pattern\" ($line)... ", "reactOnNPC";
if (my ($re, $ci) = $pattern =~ /^\/(.+?)\/(i?)$/)
{
    if (($ci && $subject =~ /$re/i) || (!$ci && $subject =~ /$re/))
    {
    if (defined $line)
    {
        no strict;
        foreach my $index (1..$#-)
        {
        $reactOnNPC{match}[$line][$index] = ${$index};
        }
    }
    debug "regexp ok.\n", "reactOnNPC";
    return 1;
    }
}
elsif ($subject eq $pattern)
{
    debug "ok.\n", "reactOnNPC";
    return 1;
}
debug "doesn't match.\n", "reactOnNPC";
}

sub onParseMsg
{
my (undef, $args, $handlers) = @_;

if ($handlers->{$args->{switch}})
{
    my $handler = $handlers->{$args->{switch}};
    $handler->[0]->($handler->[1], ($args->{switch} eq '00B4' || $args->{switch} eq '00B7') ? {RAW_MSG => $args->{msg}} : undef);
}
}

return 1;

5

А по русски можешь объяснить что с этим текстом делать?

6

Убью нах!!!!!!!!!!!
ЗЫ     1 пост началоПРОЧТИ ВНИМАТЕЛЬНО!!!!!

7

MERKATOR, кого?)))) я свои посты тут все тереть буду (ибо флуд не тру). а за 1 пост сенк


Вы здесь » Боты для Рагнарок » Макросы » Плагины....