playerRecorder plugin

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
claude
Human
Human
Posts: 40
Joined: 18 May 2008, 03:27
Noob?: No
Location: Atlantis
Contact:

Re: playerRecorder plugin

#21 Post by claude »

Just a suggestion ,

record all there equipment , hair color and etc
since the bot can see these things , i am suggesting to record all this information for War Of Emperium .
we are likely to know there is some change of there headgear and weapon of other guild member .
make player recorder plugin record what ever it can do to the maximum .

-------------------------------------------------
Body direction: North (0) Head direction: North (0)
Weapon: Mes [3]
Shield: None
Shoes : Unknown
Upper headgear: Nothing Middle headgear: Nothing
Lower headgear: Nothing Hair color: Purple (2)
Walk speed: 0.15 secs per block
------------------- Statuses -------------------
Image
learn how to be smart using search
"If I giv u a bot I'll feed u a day, but if I teach u to bot I'll feed u for life time" --wise izh
never ever send messages to me because i won't reply .

genuineopenkore
Plain Yogurt
Plain Yogurt
Posts: 52
Joined: 16 Jan 2011, 03:06
Noob?: Yes

Re: playerRecorder plugin

#22 Post by genuineopenkore »

Code: Select all

package playerRecord;

use strict;
use Plugins;
use Log qw(message);
use Globals;
use Settings;
use Actor;

Plugins::register("prec", "playerRecord", \&on_unload, \&on_reload);
my $hook = Plugins::addHook('charNameUpdate', \&write_player, undef);

sub on_unload {
	Plugins::delHook("charNameUpdate", $hook);
}
sub on_reload {
	message "playerRecord plugin reloading, ";
	Plugins::delHook("charNameUpdate", $hook);
}
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

	message "Player Exists: $targetName ($targetId)\n";
how to make this speak also in a party?

Kaspy
Halfway to Eternity
Halfway to Eternity
Posts: 398
Joined: 08 Jun 2012, 15:42
Noob?: No
Location: Brazil

Re: playerRecorder plugin

#23 Post by Kaspy »

genuineopenkore wrote:

Code: Select all

	message "Player Exists: $targetName ($targetId)\n";
how to make this speak also in a party?

Code: Select all

Commands::run("p Player Exists: $targetName ($targetId)");
Image

genuineopenkore
Plain Yogurt
Plain Yogurt
Posts: 52
Joined: 16 Jan 2011, 03:06
Noob?: Yes

Re: playerRecorder plugin

#24 Post by genuineopenkore »

KeplerBR wrote:
genuineopenkore wrote:

Code: Select all

	message "Player Exists: $targetName ($targetId)\n";
how to make this speak also in a party?

Code: Select all

Commands::run("p Player Exists: $targetName ($targetId)");

thanks sir

genuineopenkore
Plain Yogurt
Plain Yogurt
Posts: 52
Joined: 16 Jan 2011, 03:06
Noob?: Yes

Re: playerRecorder plugin

#25 Post by genuineopenkore »

how to make this plugin sir to repeat it's process every 3 minutes?

Kaspy
Halfway to Eternity
Halfway to Eternity
Posts: 398
Joined: 08 Jun 2012, 15:42
Noob?: No
Location: Brazil

Re: playerRecorder plugin

#26 Post by Kaspy »

genuineopenkore wrote:how to make this plugin sir to repeat it's process every 3 minutes?
You mean to send PM every 3 minutes? How so?
Image

genuineopenkore
Plain Yogurt
Plain Yogurt
Posts: 52
Joined: 16 Jan 2011, 03:06
Noob?: Yes

Re: playerRecorder plugin

#27 Post by genuineopenkore »

because this plugin sir triggers only when there is a newly seen player or just seen player?
so what if to let the plugin check every three minutes if there's still a player near him or something like a timeout or release in macro.

Code: Select all

automacro PlayerExist {
    player /(.*)/
	timeout 10
    call {
			log I saw $.lastPlayerName
 }
}

Raider
The Kore Devil
The Kore Devil
Posts: 672
Joined: 22 Feb 2013, 03:40
Noob?: No
Location: The Netherlands

Re: playerRecorder plugin

#28 Post by Raider »

It triggers when a player is visible to Kore, e.g. when there are eight players visible to Kore he will trigger 8 times.

genuineopenkore
Plain Yogurt
Plain Yogurt
Posts: 52
Joined: 16 Jan 2011, 03:06
Noob?: Yes

Re: playerRecorder plugin

#29 Post by genuineopenkore »

Raider wrote:It triggers when a player is visible to Kore, e.g. when there are eight players visible to Kore he will trigger 8 times.
yes sir exactly, but what i want to do is that it will again re-check its area for about 3 minutes so that even if that player who triggers the plugin it will be recorded again. it will record players near him in every 3 minutes.

example:
player 1 is visible and the bot records player 1 then player 2 comes and the bot records player 2, but when the part were player 2 records the bot doesn't record player 1 anymore.

what i want is:
if player 1 is visible the bot will record player 1 and player 2 comes the bot will record player 2 and player 1 then after 3 minutes it will re-check its area if there's a player near him and will record again all the players even if player 1 and player 2 is still there near him and no other players need for trigger.

here's what I've done

Code: Select all

package ExamplePlugin;
use Plugins;
use Log qw(message);
use Globals;
use Settings;
use Actor;


Plugins::register('example', 'Example Plugin  ', \&Unload, \&Reload);
Plugins::addHook('charNameUpdate', \&Called, undef);
	
sub Unload {
Plugins::addHook('charNameUpdate', \&Called);
}

sub Reload {
Plugins::addHook('charNameUpdate', \&Called);
}

sub Called {
    my (undef, $args) = @_;
   	my $targetName = $args->{player}{name};

	Commands::run("p Player Seen: $targetName");

## what will i add here to redo its process again?

return 1;

Kaspy
Halfway to Eternity
Halfway to Eternity
Posts: 398
Joined: 08 Jun 2012, 15:42
Noob?: No
Location: Brazil

Re: playerRecorder plugin

#30 Post by Kaspy »

I think I understand... Well, I guess that solves the problem well:

Code: Select all

package ExamplePlugin;
use Plugins;
use Log qw(message);
use Globals;
use Settings;
use Actor;

Plugins::register('example', 'Example Plugin  ', \&Unload, \&Reload);
Plugins::addHook('charNameUpdate', \&Called, undef);

my %nickListTime;
 
sub Unload {
Plugins::addHook('charNameUpdate', \&Called);
}

sub Reload {
Plugins::addHook('charNameUpdate', \&Called);
}

sub Called {
    my (undef, $args) = @_;
    my $targetName = $args->{player}{name};

	return if ((time - $nickListTime{$targetName}) < 180);
	$nickListTime{$targetName} = time;
		
    Commands::run("p Player Seen: $targetName");
}

return 1;

I did not get to test, but I think that works.
Image

Post Reply