Need help in editing playerRecorder.pl
Posted: 04 Dec 2012, 11:28
I'm looking for help to edit playerRecorder.pl. I have no idea how to write plugins, I can only edit a thing or two and very poorly.
Could you guys help me to (a) make an exlusion for a specific list of players so the plugin won't trigger if these specific players are spotted and (b) also make an exclusion for specific maps (to avoid towns, for example)?
EDIT #1: I think I got how to exclude the autorized players (Player1, Player2) by looking at other macros, but I don't know which order should I give to make the bot ignore them (marked by ####### COMMAND TO IGNORE EXCLUDED PLAYERS #######)
Still need help to exclude fields, tough.
Could you guys help me to (a) make an exlusion for a specific list of players so the plugin won't trigger if these specific players are spotted and (b) also make an exclusion for specific maps (to avoid towns, for example)?
Code: Select all
sub write_player {
my (undef, $args) = @_;
my $targetId = $args->{player}{nameID};
my $targetName = $args->{player}{name};
my $selfName = $char->name();
my $file = "$Settings::logs_folder/players_$selfName.txt";
message "Player Exists: $targetName ($targetId)\n";
open FILE, ">>:utf8", $file;
my $time=localtime time;
print FILE "[$time] " . $field->baseName . "\t$targetId $targetName\n";
close FILE;
}
1;
Code: Select all
sub write_player {
my (undef, $args) = @_;
my $targetId = $args->{player}{nameID};
my $targetName = $args->{player}{name};
my $selfName = $char->name();
my $file = "$Settings::logs_folder/players_$selfName.txt";
if ($name =~ /^([Player1|Player2/i) {
####### COMMAND TO IGNORE EXCLUDED PLAYERS #######
} else {
message "Player Exists: $targetName ($targetId)\n";
}