Like this:
[Apr 7 17:19:29 2008] (From: Evil_Bot_Hunter) : You are a bot!
[Apr 7 17:19:30 2008] (To Master) : PM: "Evil_Bot_Hunter" : You are a bot!
[Apr 7 17:19:30 2008] (To Sub Master) : PM: "Evil_Bot_Hunter" : You are a bot!
Just load the plugin and set forwardPM_masterList with a comma-separated list of Masters. Using the above example, your forwardPM_masterList would be like this:
forwardPM_masterList Master,Sub Master
Please note that master names wich include commas are not supported so far, like "Blabla, the Great"
Original idea by klas
Code: Select all
############################
# forwardPms plugin for OpenKore by thefallen
#
# This software is open source, licensed under the GNU General Public
# License, version 2.
#
# Configuration:
# Place on your config.txt:
#
# forwardPM_masterList My Character,My Other Character,Someone Else
#
# Whenever the bot recives a PM, it will forward to all masters listed
# Do not place too many masters, or you might be disconnected for too
# many packets or get muted :P
#
# Use at your own risk.
#
# This plugin should be in a subfolder of plugins like 'plugins/forwardPms.pl'.
#
############################
package itemLog;
use strict;
use Plugins;
use Globals qw(%config %npcs @npcsID %field $char %cart $shopstarted @articles $net);
use Commands;
Plugins::register('forwardPms', 'Forwards PMs received to master(s).', \&onUnload);
my $hooks = Plugins::addHooks(
['packet_privMsg', \&receivedPM, undef]
);
sub onUnload {
Plugins::delHooks($hooks);
}
sub receivedPM {
my ($self, $args) = @_;
return if (!$config{forwardPM_masterList});
my @masters=split(/ *, */, $config{forwardPM_masterList});
foreach (@masters) {
Commands::run("pm \"$_\" PM: \"".$args->{privMsgUser}."\" : ".$args->{privMsg});
}
return;
}
1;