ditto [Modified] XD

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

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

ditto [Modified] XD

#1 Post by iamanoob »

original from Thaize

Code: Select all

# =======================
# Ditto
# =======================
#
# add to config.txt
# dittoMaster <name>						-> name of commander
#
# Commands
# ditto								-> to view commander name
# ditto <name>							-> to change commander name
#

package ditto;

use strict;
use AI;
use Plugins;
use Log qw(message error);
use Translation qw(TF);
use Globals;
use Commands;

Plugins::register("ditto", "A simple whisper commandline forwarder", \&onUnload, \&on_reload);
my $hooks = Plugins::addHooks(['packet/private_message', \&onPrivateChat, undef]);
my $chooks = Commands::register(["ditto", "cmdDitto", \&cmdDitto]);

sub onPrivateChat{
		my $master = $config{dittoMaster};
        my ($packet, $args) = @_;
        my $sender = $args->{privMsgUser};
        if ($sender eq $master){
                Commands::run($args->{privMsg});
        }
}

sub cmdDitto {
my $lastSetting = $config{dittoMaster};
my (undef, $args) = @_;
if (defined $args) {
	$config{dittoMaster} = $args;
	message TF ("dittoMaster is set to %s (was %s)\n",$config{dittoMaster},$lastSetting),"info";
	return;
	}
message TF ("dittoMaster is %s\n",$config{dittoMaster}),"info";
return;
}

sub onUnload {
   Plugins::delHooks($hooks);
   Commands::unregister($chooks);
}

sub on_reload{
        &on_unload;
}

1;

this is the one i use
thanks to Thaize (from the old Openkore Forums)
Image
DARKest Ninja
fco2783
Plain Yogurt
Plain Yogurt
Posts: 95
Joined: 05 Apr 2008, 05:15
Noob?: Yes
Location: in place where you cant go

Re: ditto [Modified] XD

#2 Post by fco2783 »

# add to config.txt
# dittoMaster <name> -> name of commander
#
# Commands
# ditto -> to view commander name
# ditto <name> -> to change commander name

what this do??? auto change dittoMaster?
iamanoob
Plain Yogurt
Plain Yogurt
Posts: 82
Joined: 04 Apr 2008, 09:49

Re: ditto [Modified] XD

#3 Post by iamanoob »

XD
awww...
this is kinda old

anyways
in the old ditto
u need to change the master inside the plugin file
with only one master for all the bots to obey

with this
each bot has its own master
because it is set in the config rather than in the old one

and u can set dittoMaster in the console
type ditto to view the current dittoMaster in the config
and type ditto <name> to change the current dittoMaster in the config
Image
DARKest Ninja
Thaize
Noob
Noob
Posts: 17
Joined: 19 Sep 2008, 22:16
Noob?: No

Re: ditto [Modified] XD

#4 Post by Thaize »

I approve these changes lol XD