forwardPM - forwards PMs received by Openkore to master(s)

Other plugins for extending OpenKore's functionality. This forum is only for posting new plugins and commenting on existing plugins. For support, use the Support forum.

Moderator: Moderators

Message
Author
fallen
Noob
Noob
Posts: 7
Joined: 06 Apr 2008, 09:01
Noob?: Yes
Location: near respawn at Prontera

forwardPM - forwards PMs received by Openkore to master(s)

#1 Post by fallen »

What this plugin does is forward PMs to a list of nicknames defined as "masters".

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;
Image

kali
OpenKore Monk
OpenKore Monk
Posts: 457
Joined: 04 Apr 2008, 10:10

Re: forwardPM - forwards PMs received by Openkore to master(s)

#2 Post by kali »

You might want to put a small timeout between PMing each master for cases where there are a lot of masters to PM - the server might drop some of the messages or you might get caught spamming the server.

One can use this plugin for commanding an army of bots for example: each bot has the rest of the army as its master, and if one bot gets caught it PMs the rest to quit or disconnect.
Got your topic trashed by a mod?

Trashing topics is one click, and moving a topic to its proper forum is a lot harder. You expend the least effort in deciding where to post, mods expend the least effort by trashing.

Have a nice day.

Krai
Been there done that!
Been there done that!
Posts: 106
Joined: 04 Apr 2008, 16:23
Noob?: Yes
Location: The Bay

Re: forwardPM - forwards PMs received by Openkore to master(s)

#3 Post by Krai »

i'm going to have to give this a shot when i am botting and playing at the same time. i dont get too many pms that aren't already taken care of by macros. nice plugin though
Don't Get Owned! Do Your Research First.
The Manual | Packet Extractor | Use Macros | Server Info Guide | Old Forum
You got banned? Krai me a fuckin river..

iamanoob
Plain Yogurt
Plain Yogurt
Posts: 82
Joined: 04 Apr 2008, 09:49

Re: forwardPM - forwards PMs received by Openkore to master(s)

#4 Post by iamanoob »

:D

u may use this

sendMessage($messageSender, "pm", $msg, $to);

just change $msg to <your message>
change $to to <recipient>


for commanding bots from master
u may use that ditto.pl

just an idea...
Image
DARKest Ninja

acemg
Noob
Noob
Posts: 9
Joined: 08 Apr 2008, 22:36

Re: forwardPM - forwards PMs received by Openkore to master(s)

#5 Post by acemg »

i say its a great plugin, i tried and tested works very good since my creator who fcp me receives a lot of pm's, lol i just rcv a pm wait...

Post Reply